SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 07-28-2018   #1
Lion Sora
SRB2 Freeplay Owner
 
Lion Sora's Avatar
Default Sharing Variables between objects

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?
__________________
Creator of SRB2 FreePlay, the SRB2 server for anyone and everyone
Mod is being publicly tested
Lion Sora is offline   Reply With Quote
Old 07-28-2018   #2
Rapidgame7
Rookie modder
 
Rapidgame7's Avatar
Default

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.
__________________
Ever tried to start a project until you find out it's too complicated then you abandon it
Rapidgame7 is offline   Reply With Quote
Old 07-29-2018   #3
Lion Sora
SRB2 Freeplay Owner
 
Lion Sora's Avatar
Default

the one question is, can i change the ring's state when "cangetblue" is false, and its flags so it cannot be picked up
__________________
Creator of SRB2 FreePlay, the SRB2 server for anyone and everyone
Mod is being publicly tested
Lion Sora is offline   Reply With Quote
Old 07-29-2018   #4
Rapidgame7
Rookie modder
 
Rapidgame7's Avatar
Default

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.
__________________
Ever tried to start a project until you find out it's too complicated then you abandon it
Rapidgame7 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.