Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Help with mortar gun script

Author
Message
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 20th Jan 2012 00:11
Hello Folks,

I am trying to create a mortar gun model.

It`s working well, but with some problems.

The model itself is a character entity with a rockect launcher gun as a weapon. However, this gun is a copy of the ww2 bazooka but with a transparent texture, this ways it will not be shown in top of the mortar (where is located the FIRESPOT)

I also made a hand animation that carries the mortar round and put it inside the mortar canon.

When the player comes close to it, the camera will adjust using the new command "entitycam", "camoffsetx",...

I want that when the player presses the "G" key, it will play the animation, then after finishes the animation, it will shoot.

But i`m trying and it`s not working, it plays the animation, then stays shooting forever and does not stop.

Can anyone help me?

Thanks,

007

Here is the code:



Goldenye 007 N64
DoubleRThree
13
Years of Service
User Offline
Joined: 29th Sep 2011
Location: UK
Posted: 21st Jan 2012 00:11 Edited at: 21st Jan 2012 00:12
I'm taking a guess here, but I think the mistake is here:



The "state=2" is making everything happen at the same time. Try replacing it with this:




I'm feeling really tired, so if I made some scripting errors, or got stuff in the wrong place, try and move it around a bit if the original doesn't work.
007
13
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 21st Jan 2012 23:31 Edited at: 21st Jan 2012 23:33
Thanks friend,

Yes, you are right, the problem was in state 2 in the reloadweapon command

I changed it to the beginning of the script, just after player "rides" the mortar gun, in the first moment that the script enters in state 2 it reloads the weapon.

This way it will not reload the weapon all the time infinite, so problem is solved.

Thanks for the repply.

Goldenye 007 N64
DoubleRThree
13
Years of Service
User Offline
Joined: 29th Sep 2011
Location: UK
Posted: 21st Jan 2012 23:39
Anytime

Login to post a reply

Server time is: 2024-11-24 01:35:04
Your offset time is: 2024-11-24 01:35:04