Sharing Variables between objects

Status
Not open for further replies.

MikeTheDigiFloof

Creator of Online+
i'm wanting to create 2 objects, a goggles monitor and blue rings, where the blue rings cant be collected until the goggles monitor is broken, then the player is able to pick up blue rings until they get hit, is there a way that i can create a variable so when the monitor is broken, it becomes true so the blue rings turn visible?
 
You can store a variable in the player, say, "cangetblue", which starts out as false, but breaking open a monitor makes the "cangetblue" variable from the hitting player become true so the player gets to collect the blue rings.

Then you hook onto the blue rings in a way that the player attempting to collect them would need to pass a "cangetblue" check, so if it is true, the player gets to pick up these rings, and doesn't otherwise.

Now, there's the thing when you said the rings would become visible when the monitor is broken; there may be a way to hide these rings for the players who don't have the goggles and show them for goggle users with some HUD tinkering, which I don't exactly know how to achieve.
 
Yes.
It is not advisable to change the flags of the object if you plan on making each player have to get their own goggles though.

But, you can have a TouchSpecial/MobjCollide hook on the blue rings where you check whether the player touching it has this "cangetblue" variable, and have the player collect it if the variable is true, or have them pass through it otherwise.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top