I've set some timers into my game, but it seems that the script only runs once, and not every time the interval reaches 0.
define timer <food>
interval <20>
action {
msg <|bYou begin to feel hungry.|xb>
timeron <food_two>
timeroff <food>
}
enabled
end define
define timer <thirst>
interval <20>
action {
msg <|bYou begin to look parched.|xb>
timeron <thirst_two>
timeroff <thirst>
}
enabled
end define
define timer <food_two>
interval <10>
action {
set numeric <hp; -5>
msg <|bYou feel hungry.|xb>
}
disabled
end define
define timer <thirst_two>
interval <10>
action {
set numeric <hp; -5>
msg <|bYou feel thirsty.|xb>
}
disabled
end define
The timers work together, and once food has been eaten:
define room <Items>
define object <water>
alias <Water>
take
use {
msg <|bYou drink the water.|xb>
timeroff <thirst_two>
timeron <thirst>
}
end define
define object <Apple>
take
use {
msg <|bYou bite into the apple.|xb>
timeroff <food_two>
timeron <food>
}
end define
end define
That sends the main food/thirst timer back off again. I need it to take off 5 each time the timer hits 0 on food_two/thirst_two.
Once the HP reaches the 0 or less, the player will die.