Global interaction (for achievements)
so here is my problem: I will submit a whole
This actually is okay to me, because it gets possible to frustrated players to skip my ridicously hard maps. But:
At the end of the whole thing, I want some kind of achievement chamber, where you walk around and see your achievements on the walls. Basic achievement is "complete all chambers". Other achievemnts would include speedrunning certain levels, or finding all ratman's dens, shooting a minimum of Portals and so on. You know. The classic stuff.
Therefore, what I need, is some kind of global interaction between my maps, which can be packed into .bsp and can be used for my goal. This can include scripts.
Thank you. ![]()
The workshop works differently to of that of a normal map. In fact: the only way in order to save variables from a previous map is with a trigger_transition and and env_global - as used in HL2. The workshop runs each map through the 'map' command and therefore cannot transition and save previous data.
Portal 2 never used these entities because you never had to backtrack or take anything with you between loading screens.
The only way I can see to get round this:
In your description of each map and collection: tell players to download the whole lot and then start at map #1. Then you can use the trigger_transition and env_globals to change your level while still keeping saved achievements.
If I remember clearly, maps uploaded through the portal2publish.exe will keep the relevant map the same when they are played, therefore you could still use a transition on the workshop.
Put in the necessary voting entities needed, but don't activate them otherwise you won't be able to upload it to the workshop - use the transition.
Here's a good post on transitions.
post65289.html?#p65289
Here's an example map of using an env_global
The only other problem I can see faced is if the player leaves and quits portal without saving it (can you even save a game in the workshop? not quicksave) and then starts the relevant map they were up to again through the workshop (i.e. map mapname command). It would reset all global variables and the achievements would be cleared.
I hope this clarifies some things.
Just wanted to write some info on env_global's in portal 2.
- Env_global only has an On or Off state
- Env_globals are only saved when in conjunction with a trigger_changelevel. Otherwise it will not save and keep the state of your globals.
- The counter keyvalue and outputs do not work. Even if the counter does save over to the next map in transition, you cannot grab the value of the counter to use.
FelixGriffin wrote:
Now, does the Global Entity Name stuff work the same way? It's always sounded really useful in theory, but I've never gotten it to work right.
?
http://twhl.info/articulator.php?art=60
I'm gonna try it out. Lets see if Portal 2 will let me.
EDIT: -- Ooooooo... Global entity naming be awesome
Notes on Global Naming
- If you state an object to be Global Named and copy over this entity to the next map in transition, it will copy over the object's behaviours to the next level.
- By giving an entity a Global Name, it will not transition to the next level through a tigger_transition.
- Global Named objects do not have to look the same if they are a brush entity. The shape and texture (although now black) of the entity could be changed but it will still have the same behaviours.
- If an entity doesn't have the Global Entity Name field in it, you can add the keyvalue manually by deselecting Smart Edit and adding the keyvalue globalname name.
Here's an example of how to use env_global, transitions and Global Names
I bet you can do some pretty neat stuff if you could just channel previous entities over from the last map.