PDA

View Full Version : Shooting


Akari
04-02-2003, 04:52 AM
Is there anyway to make the player shoot a weapon with him selecting it AND control how many bullets get shot? Thanks

tommulder
04-02-2003, 09:13 AM
um... i think i know what you mean. not really, you need several weapos with different modeswitch animations for them.

LJHalfbreed
04-02-2003, 10:00 AM
What? I'm afraid I don't understand the question...

-LJ

Mayur
04-02-2003, 10:21 AM
I think he's talking about burst fires...

|Mayur|

tommulder
04-02-2003, 10:37 AM
as far as i get it he want the option to change between single and burst fire. so i guesstimated as best i could.

LJHalfbreed
04-02-2003, 11:39 AM
Hmm... burst fire? Heh... well, i'd just go through and make a new 'weapon' in the same slot and share identities and such and change up one gun to fire 1 bullet on each shoot anim, and have the other fire 3 or something.

Basically, you'd have 2 weapon folders:

WeaponA: Main model, main information.

Weapon B: Would 'share' the model with A, including having the 'same' pix in the HUD, but would be a 'separate weapon', with the exception of sharing ammo with weapon B. This weapon would have to have it's own ID, with the regular batch of shoot anims, definitions, etc.

A good way to start would be to look at the beretta and berettadual files. The only thing that you would be doing different would be making sure that the script doesn't use multiple gunbones or two-handed animations.

Then, you have a choice of editing the weapon.txt file OR the skeleton.txt/skin.txt files.

If you edit the weapon file, on the 'weapon_shoot' animation, just add 2 more frames with strings firing projectiles. I don't recommend firing all 3 projectiles on the same frame, because it can get buggy at times and looks/sounds totally unrealistic.

If you edit the default skeleton/skin texts, add additional weaponshoot string calls on different frames. Keep in mind that you might have to adjust which frames they happen on AND adjust the rate of fire for the weapon to prevent any bugs. I usually define things in the skeleton txt with the weaponshoot calls because each weaponshoot animates the weapon and causes the muzzleflash and sound effect on each call. Makes it sound and look a whole lot more like a burst fire.

Then, remember to change it's level item to include an activator for both weaponA AND weaponB upon level_item pickup.


Anyway, after doing that, you'd have weapon A, and fire single shot, and then switch to weapon B for burst fire/full-auto. It would look like the same weapon and act very similar, but in game code terms, they would be two separate weapons.

I don't recommend changing the modeswitch animations because then it kinda doesn't fit right when switching back and forth from weaponA/B to other weapons in your set.

I guess he was asking for a way to do an 'alt. fire', similar to UT?

Hope that helps.

-LJ

Akari
04-02-2003, 04:02 PM
Hmmm. Really that's not what I was asking but thanks anyway's, I'll use that some time. I meant I want the player shoot without the REAL player left clicking. So in the map, he say for eg, walks to something and shoots mutiple times.

Akari
04-02-2003, 04:05 PM
You know LJ, can't you just change the reload animation for a weapon and make it shoot mutiple times? So when you "Right Click" you do the Alt fire, just like in other action games. Just a thought.

LJHalfbreed
04-02-2003, 04:24 PM
Oh, like in a cutscene? That's easy.

Just follow the tutorials for making a trigger. Have the trigger turn playercontrols and the "press space/escape to get out" to both false. Then, hide the PC. Have a second 'enemy' pc with whatever idle animations you want in it. Then, use FSM's to code it how you like.

I'd have a few waypoints, then have the guy do an idle pose of pointing the weapon (which you had the enemy spawn with but NOT start out with in hand) and then have him shoot a few times. If you can't use the fsm codes, edit a shoot animation to fire the way you want.

My best advice? Check the maxFX docs on which FSM's you'd want to use to get the right effect.

Check the Enemies and AI section of the MAX-ED document:
C_PickupWeapon( Pumpshotgun ); - Gives the enemy a pumpshotgun in addition to the desert eagle. With this message, the enemy will take the weapon out of his pocket with an animation, so it can be sent to an enemy in the middle of a combat situation if that is desired. Or you can for example have an enemy with empty weapon at startup, and send this message to the enemy as it spots the player. The enemy doesn't get any ammo with this message, and it won't use the weapon it has if it doesn't have any ammo. The valid parameters are the same as above.
<font size="2" face="Verdana, Arial">Stuff like that is all in there.

-LJ

LJHalfbreed
04-02-2003, 04:25 PM
Oh, definitely. There's nothing wrong with that.... unless you want to reload. You can do it with melee weapons because they don't have a true 'animation' for reloading.

-LJ