Please or Register to create posts and topics.

Coop experiments.

I really enjoy making new mechanics for single player chambers. Recently, I've been wanting to try to make some nice mechanics for coop, but there is something important that I don't understand. How do you specify which client is effected by game_uis, point_clients, and other similar entities that effect the client. I've looked around to try to figure it out myself, but so far, I haven't been able to.

I don't have much experience with these kind of entities and such, but they might be dependent on whichever player triggers them? I don't know if there is a way to specify, but I have a feeling there has to be some way - I'm sure one of the more experienced people like ChickenMobile or FelixGriffin will step in at some point and offer some advice.

ImageImage

Thanks. I've actually been doing some more testing since asking this question. It looks like your guess is right. At least with the game_ui. the fact that hammer/source/portal 2 can track who triggered it is really cool. But I am also having a problem with the fact that I don't know how to reference each player as a target to parrent things to, or reference. Like in singleplayer, I can set the target of something to !player. I don't know how to do that in coop. I thought I remembered that the players were referenced by !blue and !red, however while testing with those names, its not working. Does anyone know what they are called? I'm looking around myself and experimenting myself, and If I find the answer before I get a reply, Ill post on here. But so far I havn't been able to find it.

Ok, apearanty my problem was that instead of using !red and !blue, it is just red and blue, no '!' I didn't expect to get this far with just experimenting. thanks for the help, and if there is any information on this subject that would be useful that I haven't thought about yet, any pointers would be much appreciated.

srs bsnss wrote:
...they might be dependent on whichever player triggers them...

Exactly correct. This is for both game_ui and point_clientcommand where if you specify a command from a trigger, button etc. - it will execute it for the player or entity that activated it.

E.g. OnStartTouch -> point_clientcommand -> Command -> <command>

The entity that activates an object is called the !caller while the entity that first activated an output to another entity is called the !activator. In the case of a point_clientcommand the player would be the !activator as they touched the trigger before the point_clientcommand was activated.

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

ok, thanks, but I tried parenting something to the !activator on start_touch for a trigger multiple, and it wouldn't work. Does portal 2 recognize "!activator"? because I'm getting the impression from my experiments that it does not.

It should, it is inside every source game.

OnStartTouch -> entityname -> setparent -> !activator

What are you trying to parent?

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

I'm trying to parent a brush to the player, and I am trying to set the measure target to the player for a Logic_measure_movement. When I set them both as blue/red/!player, it works, but when I use !activator on each of those, I don't get any results. Pretty much, to get warmed up to making coop chambers and mechanics, I'm starting by making the paintgun I made a few months ago work in coop.

Well there are something called trigger_playerteam. You could reference which team you would want to parent.

e.g.
OnStartTouchBluePlayer -> Brushname -> Setparent -> blue
OnStartTouchOrangePlayer -> Brushname -> Setparent -> red

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

Thanks, Ill look into this.