Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Code] SS Firing - More Like Doom Chaingun Zombie

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  
Author Message
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Wed Jul 06, 2005 9:23 pm    Post subject: [Code] SS Firing - More Like Doom Chaingun Zombie Reply with quote

In this tuturial I will show you how to make the ss shoot more like the Chaingun Zombie in Doom. This way, if he can, he will keep shooting at you. I also made it so if he isn't by the player, he may stop shooting and move like normal - that way he is using more realistic tatics.


NOTE: THIS IS STILL BETA CODE - HE DOESN'T STOP FIRING YET

First, open up WL_ACT2. All of the changes will be made here. Find:
Code:
void   T_Shoot (objtype *ob);

and under that, add this:
Code:
void   T_SSFire (objtype *ob);


Now, with this you will need fewer state types. Find:
Code:
extern   statetype s_ssshoot5;
extern   statetype s_ssshoot6;
extern   statetype s_ssshoot7;
extern   statetype s_ssshoot8;
extern   statetype s_ssshoot9;

Delete those lines.

Now, find:

Code:
statetype s_ssshoot1    = {false,SPR_GRD_SHOOT1,20,NULL,NULL,&s_ssshoot2};
statetype s_ssshoot2    = {false,SPR_GRD_SHOOT2,20,NULL,T_Shoot,&s_ssshoot3};
statetype s_ssshoot3    = {false,SPR_GRD_SHOOT3,10,NULL,NULL,&s_ssshoot4};
statetype s_ssshoot4    = {false,SPR_GRD_SHOOT2,10,NULL,T_Shoot,&s_ssshoot5};
statetype s_ssshoot5    = {false,SPR_GRD_SHOOT3,10,NULL,NULL,&s_ssshoot6};
statetype s_ssshoot6    = {false,SPR_GRD_SHOOT2,10,NULL,T_Shoot,&s_ssshoot7};
statetype s_ssshoot7     = {false,SPR_GRD_SHOOT3,10,NULL,NULL,&s_ssshoot8};
statetype s_ssshoot8     = {false,SPR_GRD_SHOOT2,10,NULL,T_Shoot,&s_ssshoot9};
statetype s_ssshoot9     = {false,SPR_GRD_SHOOT3,10,NULL,NULL,&s_grdchase1};

Change those to:

Code:
statetype s_ssshoot1    = {false,SPR_GRD_SHOOT1,10,NULL,NULL,&s_ssshoot2};
statetype s_ssshoot2    = {false,SPR_GRD_SHOOT2,20,NULL,T_Shoot,&s_ssshoot3};
statetype s_ssshoot3    = {false,SPR_GRD_SHOOT3,5,NULL,T_SSFire,&s_ssshoot4};
statetype s_ssshoot4    = {false,SPR_GRD_SHOOT2,10,NULL,T_Shoot,&s_grdchase1};

Note: My State Types are merged. If your's aren't, make sure you reset the state's sprites and the 4th's turning into the guard's chase

Now, find:

Code:
void T_Shoot (objtype *ob)


Now, under that ENTIRE FUNCTION, including the "/*", add this:
Code:
===============
=
= T_SSFire
=
= Try to damage the player, based on skill level and player's speed
=
===============
*/

void T_SSFire (objtype *ob)
{
   int   chance,refire;

   chance = 128;


   if (!CheckLine (ob))         // player is behind a wall
     return;
   
   if (CheckLine (ob))
     {
   if (!areabyplayer[ob->areanumber])
      {
      if (US_RndT()<chance)
      refire = 1;
      }
   else
   refire = 1;
     }
if (refire == 1)
{
         switch(ob->obclass)
   {
    case ssobj:
      NewState (ob,&s_ssshoot1);
      break;
   }
   }
}


/*


There, now the ss should act more like the doom chaingun zombie. If you have a fix for the bug I mentioned above, please post it!
_________________
My Wolfenstein Website:
http://www.wolf94.cjb.net

Status: Falling apart over a product I ordered that is taking forever to arrive.
Back to top
View user's profile Send private message Visit poster's website
Deathshead
Corporal


Joined: 18 Feb 2005
Posts: 87

PostPosted: Thu Jul 07, 2005 10:17 am    Post subject: Reply with quote

so basikally, up'd intelligence? wikid dude, although I dont mod nemore, dis be useful 4 sum1
_________________
Myspace
VampireFreaks
Music4Life
Wolfing Time
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Thu Jul 07, 2005 12:31 pm    Post subject: Reply with quote

Thanks! This is just one of many changes I plan to have with War Storm so enemies are more lethal - not just uping hitpoints and weapon damage, but actually modifing their AI like this tutoiral.
_________________
My Wolfenstein Website:
http://www.wolf94.cjb.net

Status: Falling apart over a product I ordered that is taking forever to arrive.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

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


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.