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 / Pause and Reload Script Issues

Author
Message
Pariah
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location:
Posted: 2nd May 2012 10:08
Alright I have two major questions on my hand. One serious, the other, not so much.

Alright, I will start off with the most problematic one: a script I developed. I basically wanted the player to enter a trigger zone, pause for 3000 milliseconds (approximately 3 seconds), reload his gun automatically, then the player can take control again.

Two problems:
1. After the player is 'frozen' by the trigger, he can't be unfrozen, even after 3000 ms has passed.
2. The guy doesn't automatically reload his gun.

HELP!
Here's the code:


and second question: I have noticed that I post a lot of questions
quite frequently. Does it irritate any of the admins or moderators?
Just want to know. Thanks!
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 2nd May 2012 11:13 Edited at: 2nd May 2012 11:25
Not sure kinda figuring out scripting myself. I starting to realize that once you get a basic idea, it slowly starts making more and more sense.
[/code]
:State=0:state=1
:state=1,plrwithinzone=1:plrfreeze=3000,state=2
:state=2 etc


Maybe this?

:state=1,plrwithinzone=1:state=2
:state=2:plrfreeze=3000,state=3
[code]

Now it just occurred to me is plrfreeze a condition as well as an action? Like timerstart and timergreater=x?
I'm sure someone will give u's both answers. I tried.
Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 2nd May 2012 13:29
Pariah, Troutflies

I think the answer lies within using 'plrfreeze' with 'timers' in the script.
Check BlackFox's thread (link below) for the 'etimers and timers' section to get more information on how to set them up in a script.

http://forum.thegamecreators.com/?m=forum_view&t=192148&b=23
Pariah
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location:
Posted: 2nd May 2012 13:38
Many thanks to you both. I will check out Black Fox's thread.
Keep this thread bumped please.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 2nd May 2012 14:22 Edited at: 2nd May 2012 14:27
look into the autosave-script, it does exactly what you want but autosaves instead of reloads the weapon.



edit: sorry, seems that autosave itself freezes the whole game for exactly 3 seconds. i thought it was scripted, but no action here delivers this. maybe you can integrate that feature into your game if you want to create some kind of a savezone.

gz

Pariah
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location:
Posted: 2nd May 2012 15:49
darn... seems like this is a little bit hard to pin down.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 2nd May 2012 16:27 Edited at: 3rd May 2012 16:43
Yes, Ross tra damus is right. You need to use a timer, then when the set time is up, you need to un-freeze the player. Like this;



I've tested this, it works. I also tried adding the reloadweapon action, but couldn't get that bit to work. So maybe someone else can help you with that part of the script...

(Edited to read couldn't instead of could!)

Pariah
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location:
Posted: 3rd May 2012 05:50
Quote: " Not sure kinda figuring out scripting myself. I starting to realize that once you get a basic idea, it slowly starts making more and more sense.
[/code]
:State=0:state=1
:state=1,plrwithinzone=1:plrfreeze=3000,state=2
:state=2 etc[code]"


Yeah the pause worked with the timer on. Now I just need the reload script to work, and then i'm in BUSINESSSSSSSS.....
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 3rd May 2012 20:50
what did the final script look like.
Where did you place the timers?
Pariah
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location:
Posted: 4th May 2012 11:19
@Troutflies:

The final script looked like this:


I got the player freeze snippet to work without the interjection of the timer.
However, in the time the player has frozen, I want him to reload the gun that he is holding, whether it be an M16, a pistol or a massive farting elephant, just to reload the gun the player currently has equipped.

Login to post a reply

Server time is: 2024-11-24 00:58:51
Your offset time is: 2024-11-24 00:58:51