Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Stormtrooper rifle settings
Stormtrooper rifle settings
2002-10-11, 4:33 AM #1
Hi,

I already made the stormtrooper rifle fire without moving the camera. I have to admit that it was easy. But I tried to do another thing, but I couldn't, so I need your help and experience. I hope you can help me out.

I'd like to add a secondary fire mode to the E-11 blaster. It would be a fast firerate, but woth lower aiming. I mean, like the secondary one from JO [http://forums.massassi.net/html/smile.gif]. I already made the rifle aim to the center of the aiming cross (well, you told me how to do [http://forums.massassi.net/html/smile.gif]), so the aiming of this should be like the normal JK. Does someone know how to do this? (What am I saying, I bet that you know [http://forums.massassi.net/html/smile.gif]). Thanks.

BTW, if someone knows something about weapon 3do's, could put an eye on this? http://forums.massassi.net/html/Forum2/HTML/010202.html

[http://forums.massassi.net/html/smile.gif] Have a nice day. [http://forums.massassi.net/html/smile.gif]

The Spanish Kid
2002-10-11, 5:14 AM #2
Well, the senderref of the fire message is the mode. 0 for primary, 1 for secondary. Run a conditional checking for the sender, and take the apporpriate action. Place your current fire code under the 0 condition, and the faster/less accurate code under 1.


To make it fire faster, lower the firewait value. The lower it is, the faster you can fire. For the inaccuracy, just replace the original random-vector-error code, from the original ST cog.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-10-11, 9:05 AM #3
Sendrref... [http://forums.massassi.net/html/confused.gif] ... conditional checking for the sender... (wth is a sender?) ... [http://forums.massassi.net/html/confused.gif]

I really thought that it would be easier (grrrrr.... the aiming and camera shake thingies made me think it...).

I'll try, but I really don't know how to do all that things that you said. Can you post it in the normal code, I mean, code that I have to add, and tell me where do I have to put it? Pleaseeeeeeee... [http://forums.massassi.net/html/smile.gif] [http://forums.massassi.net/html/smile.gif] [http://forums.massassi.net/html/smile.gif]

Thank you a lot in advance.

[http://forums.massassi.net/html/smile.gif] And have a nice day. [http://forums.massassi.net/html/smile.gif]

The Spanish Kid
2002-10-11, 12:15 PM #4
Make your Fire section in strifle something like this:

Code:
fire:
   player = GetSourceRef();
   mode = GetSenderRef();

   // Check that the player is still alive.
   if(GetThingHealth(player) <= 0)
   {
      Return;
   }

   // Check Ammo - If we are out, autoselect best weapon.
   // It should always use two energy cells, but -- as in DF --
   // allow the last fire if there is only one left...
   if(GetInv(player, 11) < 1.0)
   {
      PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
      if((GetAutoSwitch() & 1))
         SelectWeapon(player, AutoSelectWeapon(player, 1));
      Return;
   }

   powerBoost = GetInv(player, 63);
   if(mode == 1)  
   {
    // Fire2 - Fast Fire, Inaccurate.
    randVec = VectorSet((Rand()-0.5)*5, (Rand()-0.5)*5, 0.0);
    dummy = FireProjectile(player, projectile, fireSound, 8, '0.0168 0.1896 0.00', randVec, 1.0, 0x30, autoAimFOV, autoAimFOV*2);
    fireWait = 0.4;
    ChangeFireRate(player, fireWait/powerBoost);
   }
   else
   {
    // Fire1 - Slower Fire Rate, Accurate.
    randVec = VectorSet(0, 0, 0);
    dummy = FireProjectile(player, projectile, fireSound, 8, '0.0168 0.1896 0.00', randVec, 1.0, 0x30, autoAimFOV, autoAimFOV*2);
    fireWait = 0.8;
    ChangeFireRate(player, fireWait/powerBoost);
   }
   ChangeInv( player, 11, -2.0 );
   jkPlayPOVKey( player, povfireAnim, 1, 0x38 );
Return;
- Wisdom is 99% experience, 1% knowledge. -
2002-10-12, 2:20 AM #5
Thank you a lot The New Guy. It worked. I just had to set the fire1 speed to 0.2 and the fire2 speed to 0.05 to make it like I wanted to do, and it's perfect now. Thank you. [http://forums.massassi.net/html/smile.gif]

The Spanish Kid

↑ Up to the top!