Please or Register to create posts and topics.

Changing Coop spawnlocation, how?

Page 1 of 2Next

Okay...
Some of u maybe know my portal 2 single player map, sp_damagepy_01.
Since I have pretty good ideas how can I transform the puzzles into hard coop ones, and its easier to reuse the solid map and just remake the rooms / addign new buttons surfaces toys etc, I'm planning to make the co-op version of it as mp_coop_damagepy_01.

But the problem is I dont know much about coop. I placed 2 spawnpoint (plus extras that needed), they work fine, but since its a big map, for example if the players reach the 3rd room or exit from the 3rd to the 4th, or finally exiting from 3rd, and before the last part, I want new spawn locations so they dont start from the first room again if they die.
I tried to make more coop spawn point and using a trigger to disable the first ones and enable/setasactivespawn, it didnt work, did nothing, only partially worked or crashed the game.
So can anyone tell me how can I switch to another spawnpoint? I dont need droppers, and no need to set it up so when both player is present there it only swaps then... just if blue walks thru a triger then its spawnpoint switch to a nearby and the same happens for orange.

If I cant make it work I have to make a single room with player droppers from where a portal opens to the actual spawnarea (I can set the end location of the artifical portal easily, to any location in the map, where just a portal opens on the ceiling/wall somewhere and closes when the player walks thru from the spawnroom. Maybe its even better than making droprooms all over the map, but still, there must be a method to do that spawnswitching, official maps can do that too but I failed to reproduce it successfully.
An example room with a trigger/hurt area (to die) and a trigger that switches respawn to a new player_coop_spawn when activated should be nice... Thx :)

-= Check out my maps: workshop, and their .vmf sources: homepage =-

I would have assumed you just use the enable/disable inputs but considering you tried that, I don't know.
although I would like to know how too.

Why dont you just decompile a coop map that has that feature and find out?

?????????????????????????????TWP Releases | My Workshop

I uploaded an example of a respawn when both players touch a trigger here:
http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=385

I am not at home so i can't even look into that map and i gotta remember things out of my head now so sorry when i say something wrong now. But if you want it to work it with 1 player touching a trigger already just make a trigger_once that has the same outputs that my math_counter in that map has.

If you still have problems i can help you as soon as i am home and can look into it. Out of my mind it's pretty hard for me because portal 2 is the first game where i use the hammer editor and i'm just using it since maybe a week now so i'm pretty new to mapping for portal2.

The old school method would be using a trigger_teleport, but I think you could make a much more elegant solution by using world portals. Have only 1 actual player spawn, have it be the spawn tubes and be about 1 player height. At the bottom make it a world portal, and have the destination of that world portal change as the players progress through the map. The trigger_teleport method is effectively identical to that if you wanted to use that method for some reason.

But yeah, I would decompile one of the coop maps and see which method they use. I would bet money it's one of those two methods.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

I decompiled some, but they are a mess, 20+ logic proxy and relay, including indicators, opening doors and panels, dropper doors, checking if both player is there etc. I tried to ignore the useless calls, but some map use trigger_multiple, some use trigger_playerteam, and as flag some of them have weird properties checked (displayed as ???? in hammer).
When I reproduced them then sometimes the players appeared at the 2nd spot, or only worked for one of the players or when I walked thru a trigger, portal 2 just exited without an error.
But I'll try to look into it, checking more coop map, sometimes they do things differently (different mapmakers) for doors and panels too.

-= Check out my maps: workshop, and their .vmf sources: homepage =-

You don't need to look at the entire map, just look at where the player spawns and see what it's doing. I know at least 1 map changes your spawn location mid-map.

[Important Threads] Forum Rules | Welcome to the new Thinking With Portals
Please do not Private Message me for assistance. Post a thread if you have questions or concerns.
If you need to contact the staff privately, contact the Global Moderators via Discord.

Ok here is the way i made 1 touch to change spawns for both.
Make 2 info_coop_spawn
properties:
Enabled: 0
StartingTeam: 2
targetname: new_orange

the other:
Enabled: 0
StartingTeam: 3
targetname: new_blue

Make a trigger_once with these outputs (check Fire once only (no idea if that's needed):
OnStartTouch
new_blue
Enable

OnStartTouch
new_orange
Enable

OnStartTouch
old_orange (your spawn before needs targetname too.. in the example i call it old_orange)
Disable

OnStartTouch
old_blue (your spawn before needs targetname too.. in the example i call it old_blue)
Disable

Just do it like this if you don't want look at portal 2 maps because they often are confusing (at least for me they are)

I tried exactly the same several times but did not worked.
Btw trigger once cant work since if first player triggers it, it will not set the 2nd's spawn.
Now I start to think it collides with something else on my map. I removed single player starts too.
Ah, and trigger_once dont accept that kind of inputs, only trigger_playerteam (also otherwise it cant determine which player ran into the trigger). I'll start to break my map apart to find out which part causes the errors...

update: seems it doesn't like it when I disable the trigger. When I check if both player is there then everything is fine but if I only check for one and the other walks in, even if the onstarttouch is set to the other player, sometimes it still triggers it, and after its disabled, it still fires the onendtouch (basically if its disabled then it ends touching the player) and because its disabled, maybe thats why it crashes the game.
When I tried it with a trigger that activates only once for each player and it doesnt disable the trigger itself then everything worked fine :)

So the solution was:

LOGIC_RELAY
targetname spawn2_logic_o
spawnflags 1
Output:
ontrigger spawn2_orange, enable, 0.50, yes
ontrigger spawn1_orange, disable, 0.50, yes
ontrigger spawn2_orange, SetAsActiveSpawn, 0.60, yes

LOGIC_RELAY
targetname spawn2_logic_b
spawnflags 1
Output:
ontrigger spawn2_blue, enable, 0.50, yes
ontrigger spawn1_blue, disable, 0.50, yes
ontrigger spawn2_blue, SetAsActiveSpawn, 0.60, yes

TRIGGER_PLAYERTEAM
spawnflags 1
Output:
onendtouchorangeplayer, spawn2_logic_o, trigger, 0, yes
onendtouchblueplayer, spawn2_logic_b, trigger, 0, yes

spawn1_orange and spawn1_blue are the 2 starting info_coop_spawn, spawn2_orange and spawn2_blue are the 2nd ones, their Enabled = 0

-= Check out my maps: workshop, and their .vmf sources: homepage =-

Oh my mistake. I thought you didn't care when 1 touches the trigger that both spawns change already and that's why i said trigger_once. Guess i just didn't read carefully enough anymore ;) But good that you solved your problem :)

Page 1 of 2Next