I was wondering how to use stats in if commands or just how if commands work in general for variables?
This is what i tried first. It always says its untrue and goes straight to the else. From what I read on the docs it seems like this one should work but I’m not sure.
if (== get_stat_value day 1):
I also tried these variants since they didn’t give me an error. They both always read as true no matter what.
if (get_stat_value day == 1):
if (get_stat_value day 1):
Lastly, I tried to make a variable to see what it thought the day was:
var day (get_stat_value day)
“its the %{day} day.”
And the error says that r is null so I’m not sure if I’m doing something wrong there too or what that means.
From what I understand, get_stat_value is something that returns the value of a state.
If you want to use days, lets say in a system that divides weekdays (1-5) and weekends (6-7) for example, because 1-5 is not a good loop, it would have to be like this:
main:
"A new day..."
choice:
"...a new dólar huh?"
"Work.":
"Oh shit, here we go again."
jump week
week:
if (<= $stats.(stat_id).value 5)
jump work
if (>= $stats.(stat_id).value 6)
"Weekend!"
jump end_week
work:
choice:
"What do you want to do?":
"Money, money, money!":
add_stat (stat_id) +1
jump week
"Health baby!":
add_stat (stat_id) +1
jump week
"A nice and smooth love.":
add_stat (stat_id) +1
jump week
"A good food to a hungry belly.":
add_stat (stat_id) +1
jump week
"I dont know yet.":
add_stat (stat_id) +1
jump week
end_week:
"A sacred moment of peace..."
choice:
"What are your plans for Saturday and Sunday?":
"Shut up! Let me sleep.":
if (>= $stats.(stat_id).value 7)
set_stat (stat_id) 1
jump week
else:
add_stat (stat_id) +1
jump end_week
"PARTYY! LETS GOOO!":
if (>= $stats.(stat_id).value 7)
set_stat (stat_id) 1
jump week
else:
add_stat (stat_id) +1
jump end_week
I left stat_id because you can use it as anything else. HP, MP, Days, etc.
The syntax is functions in parenthesis and arguments with spaces, == is a function, so (== stat 1). But then getting the value of the stat is a function call itself so wrap that in it’s own parenthesis