env_global
somewhere in the second map, with the switch. Make the switch trigger it, and give it a Global State to Set. Trigger Mode determines what the global does when it is triggered. Dead is for monsters, while Toggle allows the global to be triggered on and off, starting with whatever is set as the Initial State. If the Set Initial State flag is enabled, the global becomes the Initial State at startup, without having to be activated first.multisource
entities can read globals, but trigger_auto
can as well. We will be using both in this tutorial.
multisource
. Create one, and set its Global State Master to the same value as the Global State to Set attribute of the env_global. Also give it a name, so that our door can reference it. Then the door needs its Master set to the name of the multisource
. The multisource
basically acts as an intermediate between the global variable that's floating around, and the door. Globals can't act as masters to doors directly. Check out the multisource tutorial for more in-depth explanation of the multisource
and what it can be used for. This is all we need for our level though - you will find that if you walk up to the door after pulling the lever in the second map, it will open, and you will be presented with a shotgun... and Barney (tradition).
trigger_auto
will do fine for the example, since it can read the global state. This time the property is called Global State to Read, for no particular reason, it seems, because it acts like a master to the trigger_auto
, just as with the multisource
.trigger_auto
use a Toggle Trigger State won't work either, because then the light will turn on and off every time the map is re-entered while the global is on. So for this example the switch in room two stays pressed. Notice the small Delay before trigger value - that's to make sure the light entity has actually been spawned before it is triggered by the trigger_auto, which prepares to trigger its target the moment the map loads. Below is a simple representation of what happens in the example.
Global Entity Name
to the same name.trigger_transition
, both entities must be visible to the landmark used by the trigger_changelevel
entity used to move between levels. Entities are visible to the landmark if they are in the landmark's Potentially Visible Set (PVS)
, but as a rule you should make sure you can draw a line from the landmark's origin to the center of the entity you intend to carry over, with no world brushes obstructing the line.trigger_transition
the entities in both maps must be covered by the transition entity to carry over their global state.map1
to map2
, map2
to map3
, map3
to map1
) because global entity state is only carried over when the entity itself is transitioned to the next map. An entity that is only transitioned between map1
and map2
and not between map2
and map3
will not appear when going from map3
to map1
.
env_globals
allows you to target and trigger entities across multiple maps. This is useful if multiple maps are used to complete a single task, much like the "Blast Pit" chapter of Half-Life. Let's say you want to do something like this to add depth to your mod or map series. This is the simplest way to do it.
trigger_auto
: Automatically Targets an entity by its Name when the map is loaded or certain parameters are met.multisource
: Once all entities that target the same Multisource are in the ON position, this entity then Targets a new entity to be triggered.func_button
: This allows the player to USE the button, which then Targets another entity.func_button
is, make an env_global
entity. func_button
, set the name of your env_global
as its target. The game engine should than store the targeted Global state to set and its Trigger Mode, which travels with you from between maps. To use this in the other maps, make a trigger_auto
and assign the Global state to read parameter to be the exact name of the Global state to set. Set the Trigger Mode to Toggle for now. Now, the env_global
acts like a Master to the trigger_auto
. From here, you then use the target parameter to target the entity you want triggered by the func_button
you set on the other map.
env_globals
to affect an entity, have the trigger_auto
for each env_global
to target a multisource
. As an example, this is how the Blast Pit scenario was done. env_global
and a name and state is saved. When you return to the control room, a trigger_auto
reads the state and turns on the oxygen. Yet you can't fire the engine yet because the env_global
targetted a trigger_auto
, which is targetting a multisource
, which the fuel, power, and test-fire switches are also targetting. Once all the switches are turned on, then the multisource
starts the engine. It's like a chain reaction of triggers.
You must log in to post a comment. You can login or register a new account.
anyway, this helped me out a lot. great tutorial!