[SOLVED] logic_player_branch

Need Help? The Day isnt going so well on the Mapping front?
Post Reply
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

[SOLVED] logic_player_branch

Post by shiftey »

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?
Last edited by shiftey on Fri Sep 18, 2009 1:34 am, edited 1 time in total.
User avatar
Shana
Lead Developer
Lead Developer
Posts: 2971
Joined: Tue Aug 29, 2006 8:12 pm
Location: Germany
Contact:

Post by Shana »

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.
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

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.
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

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
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

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!
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

logic_player_branch is for testing player counts.
From the fgd
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.
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.
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

hmm...I did that and it wasn't working. Has anybody actually used it before and knows it works?
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post by DaMaN »

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/
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

If you can get it to work let me know. I would say this is most useful entity if I could get it to work right.
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

Well if its not working let me know. Ill fix it before 1.34.
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

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.
Post Reply