HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why does this trigger cause a server split?

01-12-2006, 06:35 PM#1
wantok
And how can I change it so that it doesnt?

I'm assuming that it is the selection actions that are causing the split since the trigger was fine before I added them.

The reason I added those actions is that occassionally when I have a group of units selected and issue them an order, one of them freezes and I have to deselect the group, select another unit and then select the frozen unit to make it follow orders again. I'm thinking maybe this trigger and a couple of other triggers that similarly create unitgroups from the player's selected units may be to blame for this unit freezing behavior. Of course this trigger may have nothing to do with that problem. I'm mainly curious why this causes a split and how to fix it.

Trigger:
Clone Inventory
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Clone Inventory
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Triggering unit)) Equal to (Player((Integer A)))
Collapse Then - Actions
Set GroupArray[(Integer A)] = (Units currently selected by (Owner of (Triggering unit)))
Collapse Unit Group - Pick every unit in GroupArray[(Integer A)] and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to (Unit-type of (Casting unit))
(Picked unit) Not equal to (Casting unit)
Collapse Then - Actions
Hero - Drop the item from slot 1 of (Picked unit)
Item - Remove (Last dropped item)
Hero - Drop the item from slot 2 of (Picked unit)
Item - Remove (Last dropped item)
Hero - Create (Item-type of (Item carried by (Casting unit) in slot 1)) and give it to (Picked unit)
Hero - Create (Item-type of (Item carried by (Casting unit) in slot 2)) and give it to (Picked unit)
Else - Actions
Selection - Clear selection for (Player((Integer A)))
Selection - Select GroupArray[(Integer A)] for (Player((Integer A)))
Custom script: call DestroyGroup( udg_GroupArray[GetForLoopIndexA()])
Else - Actions
01-12-2006, 06:49 PM#2
Extrarius
Who knows, but you should _REALLY_ use 'owning player' instead of looping through every one to find which one owns the unit. In Jass, that trigger (properly coded) would be something like 5 lines of code.
01-12-2006, 06:55 PM#3
wantok
Thanks for the advice. Unfortunately I don't know Jass, and don't have the time to learn it right now.
01-12-2006, 07:27 PM#4
johnfn
I'd say it was the selection things, I remember somewhere that selections should only be used with one player - although that may be in Events. Server splits are elusive beasts, until/unless someone can definitively figure out what about the selection is giving you problems I say you should just take it out.
01-12-2006, 07:41 PM#5
qwertyui
Well nothing else there, except the selection is known to cause splits.
Try removing the selection and see if splits still happen.