Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Not sure what to title this actually!
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#1
Not sure what to title this actually!

I'm not sure how to do this, I don't know how simple it is, but I don't know how to go about it at all, so... here I am.

The player arrives at a hub map and discovers they need to do quite a few things in order to progress. For instance, the area is flooded, and in order to progress to explore other area's, they need to go to another map to fiddle with some stuff, then when they come back into the hub, the water is gone.

Is there a way to do this in script? Or am I going to have to make the place where they fiddle with stuff to make the water drain part of the hub map?

Thanks guys, I know I post a lot of questions but script and me don't get a long, hahah.

03-06-2014, 01:53 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Not sure what to title this actually!

Use global variables. It's quite easy actually.

When you have successfully accomplished the drainage in the other level, use SetGlobalVarInt("Drain", 1); in your script.

When you enter the hub again, within OnEnter() do something like this:

if(GetGlobalVarInt("Drain") == 1) {
    DrainWater(); //Basically whatever effect you want to happen to indicate this or just change the water.
    SetGlobalVarInt("Drain", 0); //Just so this event does not happen if you re-enter again.
}

03-06-2014, 02:06 AM
Find
MsHannerBananer Offline
Member

Posts: 218
Threads: 34
Joined: Sep 2013
Reputation: 10
#3
RE: Not sure what to title this actually!

(03-06-2014, 02:06 AM)Mudbill Wrote: Use global variables. It's quite easy actually.

When you have successfully accomplished the drainage in the other level, use SetGlobalVarInt("Drain", 1); in your script.

When you enter the hub again, within OnEnter() do something like this:

if(GetGlobalVarInt("Drain") == 1) {
    DrainWater(); //Basically whatever effect you want to happen to indicate this or just change the water.
    SetGlobalVarInt("Drain", 0); //Just so this event does not happen if you re-enter again.
}

Lifesaver as always, Mudbill. Big Grin

03-06-2014, 04:29 AM
Find




Users browsing this thread: 1 Guest(s)