DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

Wolf4SDL released
Page 18 of 18 Goto page Previous  1, 2, 3 ... 16, 17, 18
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 22 Jun 2017

Topics: 64
Posts: 564

blank.gif

PostPosted: Mon Nov 07, 2016 11:35 am
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I have another quick question that doesn't deserve its own thread. Is there a way to make a boss continually fire and not reverting to T_Chase until the player is out of view?

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:00 ago.

Topics: 35
Posts: 2328
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Mon Nov 07, 2016 2:29 pm
   Subject: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That's reasonably easy; you want a function like this (I'll use the standard guard statetypes as an example):

::: CODE :::
void T_KeepFiring(objtype *ob)
{
    if (CheckLine(ob))
    {
        NewState (ob,&s_grdshoot1);
        return;
    }
}


Where s_grdshoot1 is whatever you want the first repeated attack frame to be. Then you'll need to insert T_KeepFiring into the last attack statetype similar to this:

::: CODE :::
statetype s_grdshoot3           = {false,SPR_GRD_SHOOT3,20,NULL,(statefunc)T_KeepFiring,&s_grdchase1};
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 22 Jun 2017

Topics: 64
Posts: 564

blank.gif

PostPosted: Mon Nov 07, 2016 10:42 pm
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That worked. Thanks!

I have successfully turned the ghost Hitler into a stationary turret.

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 22 Jun 2017

Topics: 64
Posts: 564

blank.gif

PostPosted: Wed Dec 28, 2016 9:22 am
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This is more of a generic C++ question, but when do you use a switch and when do you use the "OR" function? For instance, is

::: CODE :::
        switch(ob->obclass)
        {
            case ssobj:
            case komobj:
            case gretelobj:
            case mechahitlerobj:
                dist = dist*2/3;
            break;
        }



The same as

::: CODE :::


if (ob->obclass == ssobj || ob->obclass == komobj || ob->obclass == gretelobj || ob->obclass == mechahitlerobj)
     dist = dist*2/3;                                        // ss are better shots


?

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
fraggeur
DieHard Guard
DieHard Guard


Joined: 31 Dec 2012
Last Visit: 17 May 2017

Topics: 11
Posts: 256

blank.gif

PostPosted: Wed Dec 28, 2016 11:45 am
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That sounds like an interesting question and I have launched a quick research

http://stackoverflow.com/questions/97987/advantage-of-switch-over-if-else-statement

It appears that a good approach would be to use the switch knowing that it will behaves either like a "if" or better, if the compiler can optimize it.
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:00 ago.

Topics: 35
Posts: 2328
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Wed Dec 28, 2016 12:58 pm
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

In most cases a modern compiler will optimize both to the same result; in the above case I'd use the if statement for readability.
linuxwolf
Bring 'em On
Bring 'em On


Joined: 16 Oct 2012
Last Visit: 10:33 ago.

Topics: 5
Posts: 132


PostPosted: Sun Jan 01, 2017 4:53 pm
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

In some mods I would define an array data structure and then index it using the class type to get class dependent values, eliminating the need for any conditional.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:20 ago.

Topics: 158
Posts: 7899
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Jan 02, 2017 11:36 am
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Some updates of the source code do a lot of those things. BT's Bunker update does just that, as its values are in a separate H file that you can modify with your own values. It has damage points, enemy health values, weapons data ... the list goes on. I coded much of Base Of Operations with the same sort of thing, but I tried to make it comparable to the original code so it'd be easier to add more code tutorials to it.
Military
DieHard Guard
DieHard Guard


Joined: 10 Oct 2015
Last Visit: 3:40 ago.

Topics: 20
Posts: 266

blank.gif

PostPosted: Sun Mar 26, 2017 1:04 pm
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I have a question about the built-in feature. How exactly is the fog intensity controlled? LSHADE_NORMAL and LSHADE_FOG values seem to correspond to intensity, but I can't tell what they do exactly (I didn't even see them defined anywhere, only used in the example definition list), and are those the only options?
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:00 ago.

Topics: 35
Posts: 2328
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sun Mar 26, 2017 2:07 pm
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Those set LSHADE_flag as used in GetShade; I believe that basically shifts the shades closer to the player.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:20 ago.

Topics: 158
Posts: 7899
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Mar 26, 2017 5:49 pm
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

With fog enabled, the colors are faded to a shade of grey rather than just fading it to black.
Military
DieHard Guard
DieHard Guard


Joined: 10 Oct 2015
Last Visit: 3:40 ago.

Topics: 20
Posts: 266

blank.gif

PostPosted: Mon May 22, 2017 8:44 am
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I just noticed that if the title screen and menu were skipped with the --tedlevel command and the episode is finished, the game shuts down after leaving the high scores screen. Is that supposed to happen?
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:20 ago.

Topics: 158
Posts: 7899
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon May 22, 2017 2:04 pm
   Subject: Re: Wolf4SDL released
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Yep; the DOS version does the same thing. Smile
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 18 of 18 Goto page Previous  1, 2, 3 ... 16, 17, 18
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 5481 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 1824 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 1940 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 2107 Tue May 06, 2008 1:15 pm
Ripper View latest post
No new posts [SDL] Apply 2nd ScaleFactor to selected (hi-res) vga gfx
Author: Andy_Nonymous
9 2683 Sun Apr 27, 2008 2:30 am
AlumiuN View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group