DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d 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       

[Help] Weapon shooting Particles i.e rockets,flame
Page 1 of 2 Goto page 1, 2  Next
DieHard Wolfers Forum Index -> 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
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sat Mar 05, 2005 7:37 pm
   Subject: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I really really need some help, I know you'll all say to use Paal Olstads (or whatever hes called) tutorial on adding a rocket Launcher, but it just doesn't do it for me I can't stand it!!! Mad, im really stuck here, You can't really make a mod without having either one of the weapons that will compete very much with the others. As far as i kno Paals Rockety Launcher is the only tutorial of the kind that i'm looking for, and i can't use it. Can anybody help me? Perhaps, a page with a written tutorial (rather than a screen dumped one) or anything helpful (not like a useless piece of code for a crud programmer like me)...
Many thanks in return
Andy3012
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Sun Mar 06, 2005 12:53 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hey! That's not so hard... Here you go.
(This is an example on how to make a weapon shoot fire balls)

We are going to make the pistol fire fireballs.

In WL_AGENT.C, add this at the beginning of the file.

::: CODE :::
extern statetype s_fire1;


Then add this declaration before T_KnifeAttack
[BUG FIXED]

::: CODE :::
void FlamethrowerAttack (objtype *ob)
{
   if (gamestate.ammo<1)
   {
      return;
   }

   SD_PlaySound (FLAMETHROWERSND);

   GetNewActor ();

   new->state = &s_fire1;
   new->ticcount = 1;

   new->x = ob->x ;
   new->y = ob->y ;
   new->tilex = new->x >> TILESHIFT;
   new->tiley = new->y >> TILESHIFT;

   new->obclass = fireobj;
   new->dir = nodir;
   new->angle = ob->angle;
   new->speed = 0x4200l;
   new->flags = FL_NONMARK | FL_BONUS;
   new->active = true;
}


And then in GunAttack, change it to look like this:

::: CODE :::
void   GunAttack (objtype *ob)
{
   objtype *check,*closest,*oldclosest;
   int      damage;
   int      dx,dy,dist;
   long   viewdist;

   if (gamestate.weapon == wp_pistol) // change it to your liking.
                          {
      FlameThrowerAttack (ob);
      return;   }

   switch (gamestate.weapon)
   {
   case wp_machinegun:
      SD_PlaySound (ATKMACHINESND);
      madenoise = true;
      break;
   case wp_chaingun:
      SD_PlaySound (ATKGATLINGSND);
      madenoise = true;
      break;

[Rest of the code]


Then in WL_ACT2.C Change the T_Projectil to look like this.

::: CODE :::
void T_Projectile (objtype *ob)
{
   long   deltax,deltay;
   int      damage;
   long   speed;
   objtype *check, *extracheck;



   speed = (long)ob->speed*tics;

   deltax = FixedByFrac(speed,costable[ob->angle]);
   deltay = -FixedByFrac(speed,sintable[ob->angle]);

   if (deltax>0x10000l)
      deltax = 0x10000l;
   if (deltay>0x10000l)
      deltay = 0x10000l;

   ob->x += deltax;
   ob->y += deltay;

   if (!ProjectileTryMove (ob))
   {
      if (ob->obclass == rocketobj)
      {
         PlaySoundLocActor(MISSILEHITSND,ob);
         ob->state = &s_boom1;
      }
#ifdef SPEAR
      else if (ob->obclass == hrocketobj)
      {
         PlaySoundLocActor(MISSILEHITSND,ob);
         ob->state = &s_hboom1;
      }
#endif
      else
         ob->state = NULL;      // mark for removal

      return;
   }

      if (ob->obclass == fireobj && ob->flags & FL_NONMARK && ob->flags & FL_BONUS)
   {
      check = objlist ;
      while (check)
      {
         if (check->flags & FL_SHOOTABLE)
         {
            deltax = LABS(ob->x - check->x);
            deltay = LABS(ob->y - check->y);

            if (deltax < BJROCKETSIZE && deltay < BJROCKETSIZE)
            {
               if (check->obclass != angelobj)
                      //   PlaySoundLocActor(MISSILEHITSND,ob);
               ob->state = &s_boom1;      
               
               DamageActor (check, 25);
               
            }
         }
         check = check->next ;
      }
   }

   else
   {
   {
      // Check if player hit by anything

      deltax = LABS(ob->x - player->x);
      deltay = LABS(ob->y - player->y);

      if (deltax < PROJECTILESIZE && deltay < PROJECTILESIZE)
      {   // hit the player
         switch (ob->obclass)
         {
         case needleobj:
            damage = (US_RndT() >>3) + 20;
            break;
         case rocketobj:
         case hrocketobj:
             //   case sparkobj:
            damage = (US_RndT() >>3) + 30;
            break;
             #ifdef SPEAR
            case sparkobj:
            damage = (US_RndT() >> 3) + 30;
            break;
             #endif
         case fireobj:
            damage = (US_RndT() >>3);
            break;
         }

         TakeDamage (damage,ob);
         ob->state = NULL;      // mark for removal
         return;
      }
   }


   ob->tilex = ob->x >> TILESHIFT;
   ob->tiley = ob->y >> TILESHIFT;

}

   }


Then add this at the beggining of WL_ACT2.C


#define BJROCKETSIZE 0x6000l

There you go. Now the pistol will fire fireballs whenever you fire it..

Enjoy!

Breaker.

P.S This is just the shorter version of Paal's way. Please tell me if there is a bug. I must have mistyped or left something. Cheesy Grin

_________________
Gone from the community for a while. Will be back on July


Last edited by wolf3dbreaker on Sat Apr 16, 2005 10:22 pm; edited 3 times in total
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sun Mar 06, 2005 4:57 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wow!!! Thanks mate, yeah i'll get right on to checking it...
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Mon Mar 07, 2005 9:58 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Glad that you liked it! Very Happy

_________________
Gone from the community for a while. Will be back on July
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Mon Mar 07, 2005 8:55 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It doesn't work... I need to define a couple things, and change a few things to make it work... Ill post the errors on here tomorow
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Tue Mar 08, 2005 9:44 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

What exactly are the errors? they worked for me. (I must have mistyped something) Embarassed

_________________
Gone from the community for a while. Will be back on July
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Tue Mar 08, 2005 4:34 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wait, i don't think it's this code that is the problem, i think its something else, for some odd reason when i start the game and it comes up with "Get Psyched" screen when that finnishes, it crashes, i think its something to do with Hi-Res, some of my source code files probably got mixed about the place, so i clean up the problem...

Edit: The Problem above was because of my compiler, which was mashed! So i've reinstalled that, and sorted out my source code. When i install it now i get 4 errors in wl_agent.c and 1 in wl_act2.c

In Agent they are:

Undefined symbol: Hit by Rocket
Declaration not allowed here (before it was the flame attack, now its knife attack,
Declaration Syntax error
Declaration Missing ;

in Act2 they are:

Undefined symbol s_burn
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 13 Oct 2004
Last Visit: 21:35 ago.

Topics: 90
Posts: 1471
Location: A hole in the wall
australia.gif

PostPosted: Wed Mar 09, 2005 12:26 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:

In Agent they are:

1)Undefined symbol: Hit by Rocket
2)Declaration not allowed here (before it was the flame attack, now its knife attack,
3)Declaration Syntax error
4)Declaration Missing ;

in Act2 they are:

5)Undefined symbol s_burn


1)Hit by Rocket is a define from another tutorial for alternate death sequences

2)You probably missed a } somewhere just above the error

3) Shrug

4)Look above the line with the error, you most likely missed a ; at the end of it

5)Define it! at the top of WL_AGENT.C, in the appropriate place (see Paals tutorial)

Did that help?

_________________
BLOGS
WolfingTime - RSS Feed

HELP ME
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Wed Mar 09, 2005 9:34 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I fixed them already. I left it out from my code.
change:
::: CODE :::
ob->state = &s_burn;


to this.

::: CODE :::
ob->state = &s_boom1;


And I left this out. It was from my code. that's why.

::: CODE :::
SD_PlaySound (FLAMETHROWERSND);
   //hitbyrocket = 0;


Sorry. I must have forgotten to take those out of my code! Embarassed

There. That should fix your bugs. Very Happy

_________________
Gone from the community for a while. Will be back on July
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Thu Mar 10, 2005 6:35 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I eventually got this to work, their was just a few things that needed defining, and thanks to your bug fixes it works!!

Thank you ever so much Wolf3dbreaker
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Fri Mar 11, 2005 4:47 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You're welcome. It's my pleasure helping fellow wolfers. Very Happy

_________________
Gone from the community for a while. Will be back on July
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Sun Mar 20, 2005 9:04 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hey, I need a little Help, i have got my flamer and it works fine, but i want to make a crossbow fire objrocket (which will be the bolt), i have added the stuff to wl_agent.c and im sure theres no more that i need to change, but then when i actually shoot the gun in the game, all i get is damage to me. I know it must be something to do with T_Projectile in Wl_act2.c, and i have tried changing a few things, but the same still occours can any body help out please?
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Mon Mar 21, 2005 3:36 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Its probably because the crossbow thing is not named fireobj. If it is named rocketobj then modify the part in WL_ACT2 (T_Projectile) to look like this

::: CODE :::
     if (ob->obclass == fireobj && ob->flags & FL_NONMARK && ob->flags & FL_BONUS || ob->obclass == rocketobj && ob->flags & FL_NONMARK && ob->flags & FL_BONUS)
   {
      check = objlist ;
      while (check)
      {
         if (check->flags & FL_SHOOTABLE)
         {
            deltax = LABS(ob->x - check->x);
            deltay = LABS(ob->y - check->y);

            if (deltax < BJROCKETSIZE && deltay < BJROCKETSIZE)
            {
               PlaySoundLocActor(MISSILEHITSND,ob);
               ob->state = &s_boom1;       
               DamageActor (check, 25);  // change this to your liking   
            }
         }
         check = check->next ;
      }
   }


1.Add the red line

2.Change to word rocketobj to the name of the objtype stated in your Attack function in WL_AGENT.C

There you go. Hopefully this will fix that bug of yours.

_________________
Gone from the community for a while. Will be back on July
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 13 Oct 2004
Last Visit: 21:35 ago.

Topics: 90
Posts: 1471
Location: A hole in the wall
australia.gif

PostPosted: Mon Mar 21, 2005 6:15 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Maybe keep that hurting you effect, and make it you get burnt if you shoot it. That would give a realistic effect.

_________________
BLOGS
WolfingTime - RSS Feed

HELP ME
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Mon Mar 21, 2005 7:42 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Deathshead wrote:
Maybe keep that hurting you effect, and make it you get burnt if you shoot it. That would give a realistic effect.


Rolling Eyes erm.. I think what andy meant was that whenever he shoots his gun, no projectile comes out. the only thing that happens is that he damages himself.

_________________
Gone from the community for a while. Will be back on July
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Mon Mar 21, 2005 6:57 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yup, that was a great deal of help thanks wolf3dbreaker, and yeh you was right, it wasn't shooting a particle only damaging me.
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 10 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Tue Mar 22, 2005 5:12 am
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You're welcome Very Happy

_________________
Gone from the community for a while. Will be back on July
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 23:30 ago.

Topics: 16
Posts: 1040
Location: Rauma - Finland
finland.gif

PostPosted: Tue Mar 22, 2005 2:01 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:
Yup, that was a great deal of help thanks wolf3dbreaker, and yeh you was right, it wasn't shooting a particle only damaging me.


No, that's not exactly true. It did spawn those particles, only that they are spawn inside the player and they damage you. I guess that flag used in there (FL_BONUS) marks that it was fired by player so it should not damage player, and they can get past him.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
Guest




Last Visit:





PostPosted: Sat Apr 16, 2005 3:55 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

*EDIT* Nevermind!!! I fixed it myself!

When I made these sourcecode changes to get pistol to shoot fireballs, I got four errors. I was able to solve two of them but I can't solve the last two errors, these two are:

WL_AGENT.C 1366: Declaration is not allowed here
WL_AGENT.C 1367: Declaration syntax error

I think I got these errors because of I added the Flamethrower attack before T_Knifeattack.

Please help!
Guest




Last Visit:





PostPosted: Sat Apr 16, 2005 7:47 pm
   Subject: Re: [Help] Weapon shooting Particles i.e rockets,flame
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Quote:

1)WL_AGENT.C 1366: Declaration is not allowed here
2)WL_AGENT.C 1367: Declaration syntax error

1) At the end of FlameThrower Attack your missing a }.
2) Don`t know of the second one.
Wolf3dBreaker you should add that } on the Flamethrower attack routine.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 2 Goto page 1, 2  Next
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Sticky: [Info] Help for newbie coders! C++ Tutorial
Author: Dugtrio17
20 2180 Sun Jan 10, 2010 8:26 pm
Fragstein3D View latest post
No new posts [Help] Setting RocketLauncher: Explosive Range...?
Author: KyleRTCW
17 1027 Thu Jun 03, 2004 10:21 am
Codetech84 View latest post
No new posts [Help] Berserk mode
Author: wolf3dbreaker
2 540 Wed Feb 04, 2004 7:01 am
Xarkon View latest post
No new posts [Info] Silent Gun? - Adding a Silencer
Author: Guest
4 177 Fri Apr 18, 2003 3:34 pm
BrotherTank View latest post
No new posts [Info] Adding Locked Doors
Author: Guest
3 228 Thu Apr 17, 2003 1:30 pm
Ripper 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 subSilver Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group