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 / how do i delay time and how do i loop

Author
Message
SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 16th Jul 2010 12:01
Title says all

Who the hell is General Failure? And why is he trying to read my hard disk?

My software never has bugs. It just develops random features.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Jul 2010 01:16
Can you give an example of what you're after? I'm not understanding the title all too well.


The one and only,


SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 17th Jul 2010 05:25
How do I repeat a few lines of code over and over forever and how do I delay time like waiting 3 secondes for the door to open after using the switch.

Who the hell is General Failure? And why is he trying to read my hard disk?

My software never has bugs. It just develops random features.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Jul 2010 06:06
The script itself loops indefinitely during play. Just have it check for specific state value before running certain lines and only those lines will be used when the state is set to that value.

As for time delays, just use the timer. Here's an example:


That will wait 3 seconds before doing stuff.


The one and only,


SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 17th Jul 2010 08:14 Edited at: 17th Jul 2010 09:05
Thanks!

EDIT:
do i need to include the <> on <do stuff>?

Who the hell is General Failure? And why is he trying to read my hard disk?

My software never has bugs. It just develops random features.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 17th Jul 2010 14:36
I'm not sure if you're serious or not... but just to be sure. You don't actually put "<do stuff>" in the script. You put your own script code there to have it do what you want it to do after the 3 seconds are up.


The one and only,


SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 17th Jul 2010 18:13 Edited at: 17th Jul 2010 18:29
i know not to put the do stuff but do i need the <> and how do i reset the timer.

ps. by looping i ment like this

code

do
print "hi"
loop
code

code

is there a way to do that? so that once do isreached only the stuff in loop is used?

Who the hell is General Failure? And why is he trying to read my hard disk?

My software never has bugs. It just develops random features.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Jul 2010 02:46
No, you don't need the <>

For that loop, it would look like this:


It will loop that indefinitely, unless told to move to another state.

All you need to know is that the script itself is within a loop, and is the ONLY loop you need to worry about.



That'd be the pseudocode for the line of script I wrote above


The one and only,


SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 19th Jul 2010 19:23
Thank you plystire

Who the hell is General Failure? And why is he trying to read my hard disk?

My software never has bugs. It just develops random features.

Login to post a reply

Server time is: 2024-11-24 21:39:17
Your offset time is: 2024-11-24 21:39:17