• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Host detection system

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
527
The thread you linked should work for chat commands, you are probably doing it incorrect. Try adding a "Player types message" event for each player in the game, then checking if the player that typed the message is the host

  • kick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as A substring
      • Player - Player 2 (Blue) types a chat message containing -kick as A substring
      • Player - Player 3 (Teal) types a chat message containing -kick as A substring
      • (Do this for all available player slots)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Host
        • Then - Actions
          • (Do actions)
        • Else - Actions
 
Level 4
Joined
Apr 23, 2011
Messages
42
hi...

Thanks.. but dont work

b5646_22.jpg


It does not check the host and it also runs

Please follow the instructions in a test map for the slave

I'm waiting . Thanks
 
Level 13
Joined
Jul 15, 2007
Messages
763
You want triggering player, not owner of triggering unit... there is no triggering unit in your events.

I think its also worth noting that games that are hosted with bots don't really have a true host; i think systems that detect hosts assume that the first player who loads into the game is the host (which in bot hosted games is not the case).
 
(Triggering Player) is a player that can be selected in a Player Comparison for example. It represents the player who started the trigger to run, so it will be correct in your code.

(Picked Player) is a player that represents the current player in a PlayerGroup loop, so it would be wrong here.

Edit:

No better way? for host detection?
Do you use a bot, or are you hosting yourself?
 
Level 4
Joined
Apr 23, 2011
Messages
42
i dont use bot..i want create map (6v6 --- or ffa) .. just for humans.. no ai or bots

game have 12 slot for players.. (player 1 to 12)

I want everyone to build the server (map host) . Use the codes ..for example : (kick command)
 
You can add a condition to your chat trigger. The condition needs to be of type "Player Comparison".
The Player Comparison will check if "TriggeringPlayer", so the player who let the trigger run, is the same as "Host".
If they're not same, the trigger won't run.

Try it out in your demo, and in case you don't get it to run you can just explain your issue and post the demo.
 
Have a look here for posting triggers: How To Post Your Trigger

You have the same problem as before, because you don't use TriggeringPlayer().

"Owner of (Triggering unit))" is wrong response -> will have default value -> Player(0)
"Host" will not be assigned if you don't run GetHost() -> will have default value -> Player(0)

so both parts are returning un-proper values, thus will result both in default, so it will look like it always works.

You need to run GetHost() in a "Map Initialization" trigger, and to use "TriggeringPlayer()" in the player comparison.
 
Status
Not open for further replies.
Top