• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Would this trigger cause a server split?

Status
Not open for further replies.
Level 4
Joined
Jul 28, 2008
Messages
93
I know this is a fairly badly written trigger, but would it cause a server split?, if so how could i improve the trigger? Any help would be appreciated
(Btw, it's a trigger to order a unit to gather items in a 1000X1000 yd square around the target and to sell those items to it)
  • Autopick up
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Auto Sell
    • Actions
      • Unit - Order (Triggering unit) to Right-Click (Random item in (Region centered at (Position of (Triggering unit)) with size (1000.00, 1000.00)))
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Right-Click (Random item in (Region centered at (Position of (Triggering unit)) with size (1000.00, 1000.00)))
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to Right-Click (Random item in (Region centered at (Position of (Triggering unit)) with size (1000.00, 1000.00)))
      • Wait 1.00 seconds
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 2))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 3))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 4))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 5))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 6))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 7))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 8))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 9))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 10))
      • Wait 0.10 seconds
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 2))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 3))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 4))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 5))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 6))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 7))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 8))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 9))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 2) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 10))
      • Wait 0.10 seconds
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 2))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 3))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 4))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 5))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 6))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 7))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 8))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 9))
      • Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 3) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 10))
      • Wait 0.10 seconds
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 2))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 3))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 4))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 5))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 6))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 7))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 8))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 9))
      • Unit - Order (Triggering unit) to Human Sorceress - Polymorph (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle 10))
 
Level 9
Joined
Oct 7, 2007
Messages
599
You could make the Castles variable one variable array (with 10 slots) and run For Each Integer A from 0-9 and then just run those for each time you want to do the actions past the first three. For the first three, you can do the same and For Each Integer A loop it 3 times (0-2 or 1-3). If you need a better explanation, just ask. If you understand, great.
 
Level 4
Joined
Jul 28, 2008
Messages
93
So would the execution look like this?
  • For each (Integer A) from 1 to 10, do (Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle[0])))
 
Level 9
Joined
Oct 7, 2007
Messages
599
Yes! Exactly, and you just do that for each of the ones you need to do that for. That will cut your trigger size by a bunch (and save the eyesore).

I don't think your trigger causes a server split. And, you shouldn't say yards; it's more like "units." It's 1000 by 1000 WC3 distance units.
 
Level 4
Joined
Jul 28, 2008
Messages
93
Hmm, it didn't seem to work, the real reason i wanted to cut it down was because i'm getting a server split from something...
 
Level 4
Joined
Jul 28, 2008
Messages
93
No, i was just taking a wild guess at what was doing it. And, no it does pick the item up, but it doesn't sell it.
 
Level 4
Joined
Jul 28, 2008
Messages
93
The trigger orginally worked, when i formatted it into what you told me, it didn't.
  • For each (Integer A) from 1 to 10, do (Unit - Order (Triggering unit) to give (Item carried by (Triggering unit) in slot 1) to (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle[0])))
Could it be because i set the array to 0? i wasn't exactly sure what to put for it.
 
Level 9
Joined
Oct 7, 2007
Messages
599
The array has to have the size 10, because that's how many iterations you need.

Understanding what an array helps for this part.

Think of a variable as a box: { }
Normally, you had Castle 1 = { Castle 0001 }

With an array, you can think of it as a string of boxes: { } { } { }
This leads to having Castles = { Castle 0001 } { Castle 0002 } { Castle 0003 } and so on.

You'll have to manually set Castles now as well, reconfiguring it from Castle 1 = { Castle 0001 } into Castles [0] = {Castle 0001}. The array index number will always start from 0, so it is usually 1 less than the intended value.

I hope this helps you understand. When I say Castle 0001, I mean castles of type 0001. So you'll have to set the variable to the correct castles. This will also remove the data leaking of unit groups.
 
Level 4
Joined
Jul 28, 2008
Messages
93
Alrighty, that was my problem i set the first castle type to the array of one rather then zero, thanks.
 
Status
Not open for further replies.
Top