Hell Templar
Dec 1 2005, 12:33 AM
I have been working with a tutorial, attempting to create a script so I create a riddle chest/Door. You try to open it and if you get the wrong answer a spell goes off. However I seem to be running into a problem. The script is below...
Begin 666_Krag_Riddle_Chest
Short Controlvar
Short Button
Float Timer
If ( MenuMode == 1 )
Return
Endif
If ( OnActivate == 1 )
If ( Controlvar == 0 )
MessageBox "I have two Arms, Two Legs, Two Eyes and one thousand heads, what am I?", "A Farmer", "A Man selling Cabbage", "A Teacher", "A King"
Set Controlvar to 1
Elseif Controlvar > 1
Activate
endif
endif
endif
endif
if ( controlvar == 1 )
set button to GetButtonPressed
if ( button == -1 )
return
elseif ( button == 2 )
MessageBox "Your answer is correct."
Activate
set Controlvar to 2
else
MessageBox "Your answer is incorrect!"
Player -> Addspell, "Frost_Curse"
set controlvar to -1
endif
elseif ( controlvar == 2 )
Activate
Set controlvar to 3
elseif ( controlvar == -1 )
set timer to ( timer + GetSecondsPassed )
if timer > 10
player -> RemoveSpell, "Frost_Curst
set controlvar to -2
endif
endif
End
Marxist ßastard
Dec 1 2005, 02:30 AM
"OMG CURST OEF COLD!!!11!" is a spell, range touch, that deals cold damage over the duration of ten seconds.
[codebox]begin "OMG RUDDLE CHEESET!One1.lsc"
short sc
short btn
if ( menumode )
return
elseif ( onactivate )
if ( sc == 0 )
messagebox "I have two arms, two legs, two eyes, and one thousand heads -- what am I?", "A farmer", "A man selling cabbage", "A teacher", "A king"
set sc to 1
elseif ( sc > 1 )
activate
; Comment out the next two lines if you want the PC to be punished only
; once for getting the wrong answer
elseif ( sc < 0 )
cast "OMG CURST OEF COLD!!!11!" player
endif
elseif ( sc == 1 )
set btn to getbuttonpressed
; Buttons start at 0, so second answer is 1
if ( btn == 1 )
messagebox "Your answer is correct."
activate
set sc to 2
elseif ( btn > -1 )
messagebox "Your answer is incorrect!"
cast "OMG CURST OEF COLD!!!11!" player
set sc to -1
endif
endif
end[/codebox]
Gabbe_master
Dec 1 2005, 10:27 AM
QUOTE
"OMG CURST OEF COLD!!!11!"
Eh... Sorry to say this, but I think you spelled something wrong there... It is supposed to be; "OMG CURST OEF
TEH COLD!!!11!"
You have to be carefull not to spell things wrong, some people wont understand what you are trying to say, if you forget those important parts...
Hell Templar
Dec 1 2005, 06:08 PM
QUOTE(Gabbe_master @ Dec 1 2005, 04:27 AM) [snapback]124908[/snapback]
QUOTE
"OMG CURST OEF COLD!!!11!"
Eh... Sorry to say this, but I think you spelled something wrong there... It is supposed to be; "OMG CURST OEF
TEH COLD!!!11!"
You have to be carefull not to spell things wrong, some people wont understand what you are trying to say, if you forget those important parts...

Well so far so good, seems to work perfectly. I had to fumble through a fw things to gt it working exactly the way I needed it, but it looks good. Thanx for all the help.
Wookiee
Dec 2 2005, 04:17 AM
take out the menumode break and put in a state conditional
edit: ohhhhh 666th post
Marxist ßastard
Dec 2 2005, 04:27 AM
The menumode break doesn't do anything detrimental, and stops stray clicks on the container while in menu mode from registering. The script already keeps track of its state.
Wookiee
Dec 2 2005, 04:50 PM
lol not from yours mb from his original
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.