Immobilizing a player

Forgewright
My player is a creature which can turn to stone. When in this state he is unable to move or give any commands except the command to "turn" back to flesh. The game can give him input when he is stone and he can see things around him. I need a function to call to freeze the players inputs unless it is the command "turn". When flesh and the player "turns" to stone this is the script.
if (IsSwitchedOn(player)) {  
msg ("Let's just agree that turning to stone while flying is not your best option.....")
}
else if (player.turn = "Stone") {
msg ("You turn from stone to flesh and are able to continue.")
set (player, "turn", "Flesh")
}
else {
msg ("You hunch over and turn to stone.")
set (player, "turn", "Stone")
}


This is the attribute flagging the state the player is in.

attributeturn.PNG

The Pixie
See here:
http://docs.textadventures.co.uk/quest/ ... layer.html

Forgewright
So simple...no wonder I couldn't think of it. Thanks Pixie. I see why I couldn't find it. The title is spelled immobilised...lol

adammadam
Forgewright wrote:So simple...no wonder I couldn't think of it. Thanks Pixie. I see why I couldn't find it. The title is spelled immobilised...lol


yeah i think its all in british english so bear that in mind!!!

Forgewright
Well, I used something new to me called the function to get the result I wanted to immobilize/immobilise a player. I named the function 'transform' and placed a call function at the end of the above 'turn' command script.

get input {
if ( (result = "turn") ) {
msg ("You turn back to flesh.")
set (player, "turn", "Flesh")
}
else {
msg ("You are stone and can not do anything until you are flesh again.")
transform
}
}


this brings up the function and I call itself again in the last line of the function, looping the code until the player types in 'turn'. since that is the only action they can take until they are flesh again. Only took a couple days but I figured it out. :D

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums