[SOLVED] logic_player_branch
[SOLVED] logic_player_branch
I searched and checked the wiki and could not find any information on this entity. Can somebody explain it's usage to me.
I'm making a player_movement_constraint and a game_text appear when there is only one player present in the server. Reason is to delay the game starting until there is more then 1 player (its a co-op game so yea...). If there are 2 players or more I want the player_movement_constraint and game_text to kill so that the players can then move and the fun begins.
I was guessing logic_player_branch could do this for me but it isn't. So what is logic_player_branch, and if it can't do what I need it to, what can?
I'm making a player_movement_constraint and a game_text appear when there is only one player present in the server. Reason is to delay the game starting until there is more then 1 player (its a co-op game so yea...). If there are 2 players or more I want the player_movement_constraint and game_text to kill so that the players can then move and the fun begins.
I was guessing logic_player_branch could do this for me but it isn't. So what is logic_player_branch, and if it can't do what I need it to, what can?
Last edited by shiftey on Fri Sep 18, 2009 1:34 am, edited 1 time in total.
I never used that ent, but another way of counting players would be a trigger_multiple and math_counter.
Set the maxvalue of the math_counter to 2 and the trigger to only recognize clients and add these outputs:
onstarttouch | math_countername | add | 1
onendtouch | math_countername | subtract | 1
now to math_counter:
onhitmax | whatever_triggers_your_mapstart | trigger
Done.
Set the maxvalue of the math_counter to 2 and the trigger to only recognize clients and add these outputs:
onstarttouch | math_countername | add | 1
onendtouch | math_countername | subtract | 1
now to math_counter:
onhitmax | whatever_triggers_your_mapstart | trigger
Done.
Ok that'll work even if it does require many entities (the way my spawns are setup). Now I have the problem of keeping the players constrained. I can't use a view controller because I want them to be able to move their mouse (rotate xz), but I want them to not be able to use their wasd keys (move xy). point_playermoveconstraint set to 0 doesn't do anything at all.
Can you not box them in with some sort of clip or func_brush, yeah player move constraint is not much help.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.
fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
'She has zero tolerance for idiots'.
fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
Damn. I'm kind of embarrassed I didn't think of that fug. Whats even funnier is I have him boxed into a non-solid box that flickers black to make it seem like the lights are flickering without the cost of naming any lights. And I couldn't think of just making it solid....
Works great now. Thanks you two!
Works great now. Thanks you two!
logic_player_branch is for testing player counts.
From the fgd
From the fgd
All you need to do is set 'Test Value' to the number of players you want to check for. Then input 'Test' and it will output 'OnTrue' or 'OnFalse' depending if the player count is equal to or greater than your 'Test Value'. This is a great ent for testing player counts without using math counters and stuff. Press the Help button in the hammer ent properties for more information on this ent.On Test, compares the value to the current player count. Returns true if the player count is equal to or larger than the value. If 'Strict Equal To' is set to true, will only output true if the value is exactly equal to the number of players.
-
- npc_combinegunship
- Posts: 782
- Joined: Tue Nov 07, 2006 12:03 am
- Location: Parent's Basement
- Contact:
Holy crap! I didn't even know this worked! OK, this entity is going into my current project!!
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
It doesn't work. I set up a simple test. I created a logic_player_branch with a test value of 1. I had 2 doors, one with an input of onFalse Open and the other onTrue Open.
When I ran the map neither door opened. Maybe the logic_player_branch needs to be triggered?
EDIT: Yes it works!! It has to be triggered. A simple OnPlayerSpawn --> Test I/O did the trick. Ok wait...it doesn't exactly work right. I set it to test value 1 and it returned false when 1 player was present. It might be test when x>n instead of test when x>n. I'll check.
EDIT: Ok it works fine. When the number of players is equal to or more than the testvalue, the logic_player_branch will return true. If it is less than the test value, the logic_player_branch will return false. When StrictEqualTo is checked, it will only return true if the number of players is equal to the testvalue.
When I ran the map neither door opened. Maybe the logic_player_branch needs to be triggered?
EDIT: Yes it works!! It has to be triggered. A simple OnPlayerSpawn --> Test I/O did the trick. Ok wait...it doesn't exactly work right. I set it to test value 1 and it returned false when 1 player was present. It might be test when x>n instead of test when x>n. I'll check.
EDIT: Ok it works fine. When the number of players is equal to or more than the testvalue, the logic_player_branch will return true. If it is less than the test value, the logic_player_branch will return false. When StrictEqualTo is checked, it will only return true if the number of players is equal to the testvalue.