Hello all,
I'm continuing my attempt to make my first adventure...
My current hurdle is to do with taking things.
I have a picture that starts off life on the wall.
The first time I take it, I want to have a message saying "You rip the picture off the wall."
But then I might want to drop it and pick it up again later, in which case I want to have a message just saying "You pick up the picture."
I tried going to the Inventory tab, and using Run Script, and using a flag, saying if the flag was set to "Taken" then I just pick it up, but if not, then I rip it off the wall and then set the flag to Taken. But it doesn't quite work
The code-ificated version of it looks like this:
if (GetBoolean(Picture, "Taken")) {
msg ("You pick up the picture.")
AddToInventory (Picture)
}
else {
msg ("You rip the picture off the wall.")
AddToInventory (Picture)
SetObjectFlagOn (Picture, "Taken")
}
When I test it out, and do "take picture", it seems to run through the IF statement twice.
So the first time I 'take picture', it does:
"You rip the picture off the wall."
"You pick up the picture."
And then if I drop it, and take it again, it now says:
"You pick up the picture."
"You pick up the picture."
So it's clearly doing something right since it's realised I don't want to rip it twice, but for some reason it's doing the taking bit twice each time.
Any idea why?
Thanks,
psymann