Help Using Flags Wanted!

SetObjectFlagOn (chair, "broken")

When I started making a Quest game, I used this line to add a flag to a "chair" object which existed to have the "chair" object turn invisible and also make a hitherto invisible "broken chair" object located in the same room visible.

When the chair is broken (read: when a flag named "broken" is set on the "chair" object) it still remains in the room, and the "broken chair" object is still invisible.

It used to work. For some reason this will no longer work and I have no idea why. Any ideas?


Check the code which is supposed to make the chair invisible and the broken chair visible.
A flag only sets a value that you can look at to see if something has happened; I suspect the problem is in the code that handles the other stuff.

Does the code look something like:

SetObjectFlagOn (chair, "broken")
SetObjectFlagOff (chair, "visible")
SetObjectFlagOn (broken chair, "visible")

because that's what I would expect to see for the results you describe.


                msg ("Pain jolts through your arms and back when you land heavily upon the floor, the back of the chair completely snapping off. After a moment, you manage to wriggle out of the poorly tied knots.")
                DecreaseHealth (2)
                msg ("You are free.")
                SetObjectFlagOn (chair, "unbound")
                SetObjectFlagOn (chair, "broken")
                if (GetBoolean(chair, "broken")) {
                  MakeObjectInvisible (chair)
                  MakeObjectVisible (broken chair)

^ This worked! Thanks for making me look at everything once more, I found the error. It was small and simple, as it often is.


Log in to post a reply.

Support

Forums