Yet another question.

Anonymous
I apologize if all these questions I am asking is getting annoying but here I go again.

Is there any way to have a conditional so that a script would run if an object is in a certain room that is not the current room or the inventory.

MaDbRiT
Mman wrote,


I apologize if all these questions I am asking is getting annoying but here I go again.


No need to apologise for asking questions here, that's (basically) what the forums are for!


Is there any way to have a conditional so that a script would run if an object is in a certain room that is not the current room or the inventory.


Yes. :D

Oh, you want to know how I suppose!

You would test for an object's location with something like:

if ($locationof(object)$ = bathroom) then {
put the script here
}


When to actually MAKE the test is more a question of what you are trying to do as a result of it. If you want it tested repeatedly throughout the game, I'd put it in the game's 'afterturn' script.

Hope this helps

Al (MaDbRiT)

Anonymous
Thank you. Not only does that solve my current problem, but I think I am finally starting to understand functions.

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

Support

Forums