HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Double-Yew-Tee-Eff Mate?

03-11-2007, 11:06 AM#1
Pheonix-IV
Trigger:
Actions
Set Enemy[1] = Player 2 (Blue)
Set Enemy[2] = Player 1 (Red)
Set ComputerAlly[1] = Player 1 (Red)
Set ComputerAlly[2] = Player 2 (Blue)
Set ComputerAlly[3] = Player 1 (Red)
Set ComputerAlly[4] = Player 2 (Blue)
Set ComputerAlly[5] = Player 1 (Red)
Set ComputerAlly[6] = Player 2 (Blue)
Set ComputerAlly[7] = Player 1 (Red)
Set ComputerAlly[8] = Player 2 (Blue)
Set ComputerAlly[9] = Player 1 (Red)
Set ComputerAlly[10] = Player 2 (Blue)
Set ComputerAlly[11] = Player 1 (Red)
Set ComputerAlly[12] = Player 2 (Blue)
Set GoldLevelupAmount[1] = 25
Set GoldLevelupAmount[2] = 50
Set GoldLevelupAmount[3] = 100
Set GoldLevelupAmount[4] = 175
Set GoldLevelupAmount[5] = 250
Set GoldLevelupAmount[6] = 350
Set GoldLevelupAmount[7] = 500
Set GoldLevelupAmount[8] = 750
Set GoldLevelupAmount[9] = 1000
Set GoldLevelupAmount[10] = 2000

Trigger:
Return Gold
Collapse Events
Unit - A unit enters Red Team Base <gen>
Unit - A unit enters Blue Team Base <gen>
Collapse Conditions
(Level of Gold for (Triggering unit)) Greater than or equal to 1
Collapse Actions
Set temppoint = (Position of (Triggering unit))
Special Effect - Create a special effect at temppoint using Abilities\Spells\Other\Transmute\PileofGold.mdl
Special Effect - Destroy (Last created special effect)
Player - Add (Level of Gold for (Triggering unit)) to ComputerAlly[(Player number of (Owner of (Triggering unit)))] Current gold
Floating Text - Create floating text that reads (+ + (String((Level of Gold for (Triggering unit))))) above (Triggering unit) with Z offset 20.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
Unit - Remove Gold from (Triggering unit)
Unit - Add Gold (None) to (Triggering unit)
Custom script: call RemoveLocation( udg_temppoint )

Right, now for some odd reason, when i move my little miner dood back to the base region, the SFX plays, the floating text appears, but Player 1 or 2 do not get the gold. But if i change this line:

ComputerAlly[(Player number of (Owner of (Triggering unit)))]

Into a fixed player (Player 1 or whatever) then they do get the gold. So the problem is my variable... Whaa?

(I was testing as Player 3 and i had debug commands displaying blue and red's gold amounts, which stayed resolutely at 0.
03-11-2007, 11:12 AM#2
Earth-Fury
From your desription of the problem and in my sleepless mind, i cant help but read the topic title 10 times to get it, and think maybe your variable initialization trigger isnt being called?
03-12-2007, 12:09 AM#3
Pheonix-IV
Omg... I forgot to put an event in the variable initialisation trigger...

And this ladies and gentlemen, is why you should never trigger a map at 4 in the morning while using caffine to stay awake. I feel like such an idiot.
03-12-2007, 12:46 AM#4
Earth-Fury
Dont worry. we all do stupid stuff ;) i once asked what the name for the Marine icon was...

....

it was "btnMarine"
03-12-2007, 02:23 AM#5
Pheonix-IV
Here's another one:
Trigger:
Upgrades
Collapse Events
Unit - A unit Finishes an upgrade
Collapse Conditions
((Owner of (Triggering unit)) Equal to Player 1 (Red)) or ((Owner of (Triggering unit)) Equal to Player 2 (Blue))
Collapse Actions
Player Group - Pick every player in Teams[(Player number of (Owner of (Triggering unit)))] and do (Player - Set the current research level of (Researched tech-type) to (Current research level of (Researched tech-type) for (Owner of (Triggering unit))) for (Picked player))

Doesn't work. I research an upgrade for P1 and the other players don't get it.

Here's me variable initialisation trigg, with an event this time:

Trigger:
Initialise Variables
Collapse Events
Map initialization
Conditions
Collapse Actions
Set Enemy[1] = Player 2 (Blue)
Set Enemy[2] = Player 1 (Red)
Set ComputerAlly[1] = Player 1 (Red)
Set ComputerAlly[2] = Player 2 (Blue)
Set ComputerAlly[3] = Player 1 (Red)
Set ComputerAlly[4] = Player 2 (Blue)
Set ComputerAlly[5] = Player 1 (Red)
Set ComputerAlly[6] = Player 2 (Blue)
Set ComputerAlly[7] = Player 1 (Red)
Set ComputerAlly[8] = Player 2 (Blue)
Set ComputerAlly[9] = Player 1 (Red)
Set ComputerAlly[10] = Player 2 (Blue)
Set ComputerAlly[11] = Player 1 (Red)
Set ComputerAlly[12] = Player 2 (Blue)
Set GoldLevelupAmount[1] = 25
Set GoldLevelupAmount[2] = 50
Set GoldLevelupAmount[3] = 100
Set GoldLevelupAmount[4] = 175
Set GoldLevelupAmount[5] = 250
Set GoldLevelupAmount[6] = 350
Set GoldLevelupAmount[7] = 500
Set GoldLevelupAmount[8] = 750
Set GoldLevelupAmount[9] = 1000
Set GoldLevelupAmount[10] = 2000
Collapse For each (Integer A) from 3 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
ComputerAlly[(Integer A)] Equal to Player 1 (Red)
Collapse Then - Actions
Player Group - Add (Player((Integer A))) to Teams[1]
Collapse Else - Actions
Player Group - Add (Player((Integer A))) to Teams[2]

I assume that for some reason the integer A loop isn't workping properly and thus isn't adding the players to the correct player group. But i'm nto sure.
03-12-2007, 02:41 AM#6
Earth-Fury
You sure (Triggering Unit) works with "Unit - A unit Finishes an upgrade" ? add a text message to that trigger to see.

you sure the tech advancement is beign registerd before the trigger fires? (so it actually increases the teck level for players, instead of setting it to the last level of the teck)

I can see nothing wrong with that loop. Exept, why use a loop? its the same ammount of calls to adding players to groups, it much dirtyer, and needs a variable. (or not, considering its odd and even players being added to each group)
03-12-2007, 07:04 AM#7
Pheonix-IV
Meh, lazyness, it's faster to code integer loops for that stuff.

I tried changing it to Researching Unit, still zip. And to check if what you said might be the case i researched a tech with 5 levels, zip.

--EDIT--

The problem of course would be that i was using Unit - A unit finishes an upgrade, not Unit - A unit finishes research. The first, of course, referring to the unit itself upgrading, and the second referring to the unit researching an upgrade.

I hate Warcraft.
03-12-2007, 07:28 AM#8
Earth-Fury
... dope. i really should have caught that....
see? we all do stupid things sometimes! xD