FAQ  •  Login

Keeping track of variables between level transitions...

<<

Kenny

User avatar

Warrant Officer 1
Warrant Officer 1

Posts: 1016

Joined: Sun Mar 16, 2008 3:43 am

Post Thu Sep 20, 2012 3:34 am

Keeping track of variables between level transitions...

I've been hard at work on redesigning Five from the ground up to do something radically different from what I'd originally planned.

Anyone here know how I would go about keeping a set of variables in memory between maps? If the player does something in one map, that affects another map, say, three level transitions away, would there be a way to remember that action via a variable that toggles something in a different map? (Doors, prop positions, etc.)

Or would I need a new map?
Image
<<

tyrtill

User avatar

Specialist
Specialist

Posts: 198

Joined: Tue Feb 05, 2008 4:27 pm

Post Thu Sep 20, 2012 6:59 am

Re: Keeping track of variables between level transitions...

Found this quote:
"the trigger_transition
With all this talk of "level transitions", you'd probably think that a trigger_transition was an essential part of every level change. In fact, it's rarely used. Its purpose is to control when and if a trigger_changelevel will function, and what comes through to the new level. To use it, simply set it's Name (targetname) to the same value as the Name of the info_landmark.

The trigger_transition accomplishes two things. Its associated trigger_changelevel will not work unless the player is in the trigger_transition, and when the trigger_changelevel does work, only those entities within the trigger_transition will be taken to the new level.

The trigger_transition is useful, for example, if you have a situation where a player must activate something then go stand in a certain place and wait a few seconds for the level to change. This is the premise for example map #3."
http://twhl.info/articulator.php?art=60&form=old

So to me it sounds like you put a logic_entity in your trigger_transition to pass it through levels. Probably a counter would work like a flag.
<<

Nicadeamas

User avatar

Captain
Captain

Posts: 2606

Joined: Mon Jun 25, 2007 11:38 am

Location: Earth

Post Thu Sep 20, 2012 5:14 pm

Re: Keeping track of variables between level transitions...

.
Then there is also the global entitie name... I'm told it holds secret powers that allow global entities with a name to be saved and transitioned with the player, but I've never toyed with the thing.
Instead what I do is this dumb thing called Gnomes, if the player picks up the healing power up it drops a physics entities (gnome) in a secret box off in the void, however this secret box is bound to the level transition entities via the entities and a vis portal cluster.
Then in the next map automatic I/O work looks in the box to see what physics entities (gnomes) have fallen in, then applies that to the real gnome to make it appear that the gnome keeps it's power ups across level transitions.

Return to Level Design

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.