Problems with scripting

Started by LucasK, April 15, 2012, 03:19:49 PM

Previous topic - Next topic

LucasK

I'm trying to use scripts to enhance my new level, just in the beginning i put a shaking effect, it worked well, but then i put something to viridian to say, well, i tested and he says it, but the music and the sounds don't play, someone can help me? (This only happens after i put something to Viridian to say)

EDIT: By the way, somebody can tell me how i make a script play only once?

FIQ

I guess you typed "m" in the script editor somewhere, it mutes the game. Unintuitive yes, and it's fixed in a patch (which is not released yet, however). Press m again to turn off the mute.

You can do this to prevent a script from happening more than once:

Script: script1
ifflag(1,stop)
do things here, bla bla ...
flag(1,on)

Script: stop
stop()

Then, if it runs one time, it will turn on a flag (flag 1). This is checked for before anything else, then the stop script is running (which contain nothing else than stop()). It will not stop the first time as flag 1 isn't on then.

LucasK

"Script: script1
ifflag(1,stop)
do things here, bla bla ...
flag(1,on)

Script: stop
stop()"

I tried this, but the dialogue still plays more than one time.  :victoria:

FIQ

Quote from: LucasK on April 15, 2012, 06:53:56 PM
"Script: script1
ifflag(1,stop)
do things here, bla bla ...
flag(1,on)

Script: stop
stop()"

I tried this, but the dialogue still plays more than one time.  :victoria:
Should work!
Can you post a quick small test level of you doing it so I can see what's wrong?

LucasK

Where i must put the "stop" script? I think that's the error.

FIQ

Create a scriptbox, and from there name the script "stop". Then, remove the scriptbox. The stop script will persist.