Hi
Im trying to do a condition if some objects are Visible and some are not then do certain things.
Have used this:
if (!o44sc.Visible && !o35sc.Visible && !o22sc.Visible &&o28sc.Visible && o17sc.Visible)
also for multi conditions to apply if above code returns true
Is this legal scripting?
cheers for any help
-barefoot-
UPDATE... This now works ok and answered my question:
function region2_Standing()
{
if (!o44sc.Visible && !o35sc.Visible && !o22sc.Visible &&o28sc.Visible && o17sc.Visible)
Display("The Scales drop just enough to release the door");
if (!o44sc.Visible && !o35sc.Visible && !o22sc.Visible &&o28sc.Visible && o17sc.Visible)
cindy_bones.Say("Yes,Ive done it");
if (!o44sc.Visible && !o35sc.Visible && !o22sc.Visible &&o28sc.Visible && o17sc.Visible)
object[12].Move(425, 293, 4, eBlock, eAnywhere);
if (!o44sc.Visible && !o35sc.Visible && !o22sc.Visible &&o28sc.Visible && o17sc.Visible)
object[0].Move(206, 203, 4, eBlock, eAnywhere);
if (!o44sc.Visible && !o35sc.Visible && !o22sc.Visible &&o28sc.Visible && o17sc.Visible)
cindy_bones.Walk(254, 284, eBlock);
}
As I like to say: sometimes it is a good idea to ask questions, for it makes you find the answer yourself faster ;D
Just one note - I noticed the condition is exactly the same in all 5 cases. Unless this is not a real code but sort of experiment, I'd suggest you optimize it like that:
if (!o44sc.Visible && !o35sc.Visible && !o22sc.Visible &&o28sc.Visible && o17sc.Visible)
{
Display("The Scales drop just enough to release the door");
cindy_bones.Say("Yes,Ive done it");
object[12].Move(425, 293, 4, eBlock, eAnywhere);
object[0].Move(206, 203, 4, eBlock, eAnywhere);
cindy_bones.Walk(254, 284, eBlock);
}
I will certainly use your method Crimson to cut down script size :=
many thanks
-barefoot-