• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] House IN & OUT for multi-player

Status
Not open for further replies.
Level 4
Joined
Aug 3, 2011
Messages
222
i make a house in & out for 8 player with 3 trigger but it's bugged

Maybe in the trigger "In House"'s "If,Then.Else"'s condition is not true because he unit won't moved and Typing won't be come out but the Camera is locked on the unit correctly. but i can't find out what's wrong!

  • In House
    • Events
      • Unit - A unit enters Player 1 In <gen>
      • Unit - A unit enters Player 2 In <gen>
      • Unit - A unit enters Player 3 In <gen>
      • Unit - A unit enters Player 4 In <gen>
      • Unit - A unit enters Player 5 In <gen>
      • Unit - A unit enters Player 6 In <gen>
      • Unit - A unit enters Player 7 In <gen>
      • Unit - A unit enters Player 8 In <gen>
    • Conditions
      • (Custom value of (Entering unit)) Equal to 0
      • (Owner of (Triggering unit)) Not equal to Neutral Passive
    • Actions
      • Unit - Set the custom value of (Entering unit) to 1
      • Cinematic - Clear the screen of text messages for (Player group((Owner of (Triggering unit))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 1 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 1 (Red)) + 's house.|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 2 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 2 (Blue)) + 's house.|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 3 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 3 (Teal)) + 's house.|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 4 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 4 (Purple)) + 's house.|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 5 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 5 (Yellow)) + 's house.|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 6 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 6 (Orange)) + 's house.|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 7 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 7 (Green)) + 's house.|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 In <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 8 Out <gen>)
          • Quest - Display to (Player group((Owner of (Triggering unit)))) the Quest Update message: (|cff00ff00You're in + ((Name of Player 8 (Pink)) + 's house.|r))
        • Else - Actions
      • Camera - Lock camera target for (Owner of (Triggering unit)) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
  • Out House
    • Events
      • Unit - A unit enters Player 1 Out <gen>
      • Unit - A unit enters Player 2 Out <gen>
      • Unit - A unit enters Player 3 Out <gen>
      • Unit - A unit enters Player 4 Out <gen>
      • Unit - A unit enters Player 5 Out <gen>
      • Unit - A unit enters Player 6 Out <gen>
      • Unit - A unit enters Player 7 Out <gen>
      • Unit - A unit enters Player 8 Out <gen>
    • Conditions
      • (Custom value of (Entering unit)) Equal to 0
      • (Owner of (Triggering unit)) Not equal to Neutral Passive
    • Actions
      • Unit - Set the custom value of (Entering unit) to 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 1 In <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 2 In <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 3 In <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 4 In <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 5 In <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 6 In <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 7 In <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 Out <gen> contains (Entering unit)) Equal to True
        • Then - Actions
          • Unit - Move (Entering unit) instantly to (Center of Player 8 In <gen>)
        • Else - Actions
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.00 seconds
  • Leave Region
    • Events
      • Unit - A unit leaves Player 1 In <gen>
      • Unit - A unit leaves Player 1 Out <gen>
      • Unit - A unit leaves Player 2 In <gen>
      • Unit - A unit leaves Player 2 Out <gen>
      • Unit - A unit leaves Player 3 In <gen>
      • Unit - A unit leaves Player 3 Out <gen>
      • Unit - A unit leaves Player 4 In <gen>
      • Unit - A unit leaves Player 4 Out <gen>
      • Unit - A unit leaves Player 5 In <gen>
      • Unit - A unit leaves Player 5 Out <gen>
      • Unit - A unit leaves Player 6 In <gen>
      • Unit - A unit leaves Player 6 Out <gen>
      • Unit - A unit leaves Player 7 In <gen>
      • Unit - A unit leaves Player 7 Out <gen>
      • Unit - A unit leaves Player 8 In <gen>
      • Unit - A unit leaves Player 8 Out <gen>
    • Conditions
      • (Owner of (Triggering unit)) Not equal to Neutral Passive
      • (Custom value of (Leaving unit)) Equal to 1
    • Actions
      • Unit - Set the custom value of (Entering unit) to 0
Region Player 1/2/4/5/6/7/8 Out is in the house and Player 1/2/3... is the outdoor of the house.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well... I don't like to say these kinds of stuff, but you would just need 1 trigger and 1 hashtable for this.

So, if you stand in #Out you're moved Inmediatly to #In. What's not working? The unit is not being moved?

Why do you need to manipulate the unit custom value?

You also have plenty of location leaks. Whenever you're using a Point (Position of.. CEnter of...) use a Variable to declare it, use it, then use this as a custom scrip to clear the varialble when you no longer need it, or you need another value in it. Avoid waits in between the creation and clearing of the variable.
JASS:
call RemoveLocation(udg_YourPointVariableName)
 
Level 4
Joined
Aug 3, 2011
Messages
222
Well... I don't like to say these kinds of stuff, but you would just need 1 trigger and 1 hashtable for this.

So, if you stand in #Out you're moved Inmediatly to #In. What's not working? The unit is not being moved?

Why do you need to manipulate the unit custom value?

You also have plenty of location leaks. Whenever you're using a Point (Position of.. CEnter of...) use a Variable to declare it, use it, then use this as a custom scrip to clear the varialble when you no longer need it, or you need another value in it. Avoid waits in between the creation and clearing of the variable.
JASS:
call RemoveLocation(udg_YourPointVariableName)

Region [In] will move unit to Region [Out] and Region [Out] move unit back to Region [In], then region [In]............................ so i need the custom value..
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I would susggest the following.

On the beginning of your trigger, the first action, use this custom script
JASS:
local unit u = GetTriggerUnit()
AT THE END of the trigger, as the last action, use this custom script
JASS:
set u = null

In the world editor, you'll se some numbers in the bot left corner that change whenever you move the mouse in the terrain. These are the X/Y coordenates. Depending on the region your unit is entering at, check the position where the unit should be moved by placing your cursor there, and taking note of the numbers, and use this

JASS:
call SetUnitX(u, Your X Coordenates)
call SetUnitY(u, Your Y Coordenates)
// Example
call SetUnitX(u, 1382)
call SetUnitY(u, 551)
// End Example

So, you can choose a point outside the "Out" region and outside the "In" region to move the unit, so you avoid using the custom value (wich you may find usefull for something else). You also get rid of creating a location (wich is created using the same x/y coordenates, and you also get rid of the Point variable, and get rid of the call RemoveLocation(location) script. So, it's a lot better to do it this way.
 
you dont need a hashtable nor adjust the custom value for this, just make a checking condition (boolean) with an array of the ID of the triggering player...
the trigger is pretty damn long, put the regions in an array variable like;
  • set Region[1] = Center of Player 1 In <gen>
  • set Region[2] = Center of Player 2 In <gen>
  • etc...
if you'll post the map, I'll give you what I mean...
 
Status
Not open for further replies.
Top