HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Text Teleporting question...

07-07-2003, 09:35 PM#1
Nikolae
Okay, I'm trying to make a trigger that will do the following:
Teleport all selected units owned by the player to a set location, and subtract 25 gold per unit from the player.

I've fiddled with this forever and it won't work, so here's the trigger, and if you can see why it doesn't work, PLEASE tell me, and explain how to fix it.

EVENTS:
Player - Player 1 (Red) types a chat message containing (tel + home) as An exact match

ACTIONS:
Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions)
Loop - Actions
Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - ((Number of units in (Units currently selected by (Triggering player))) x 25))
Unit - Move (Picked unit) instantly to (Center of Home TR <gen>)

Could someone PLEASE tell me why this doesn't work?

Thanks,
~Nik
07-09-2003, 03:55 AM#2
Guest
What part of this trigger isn't working the movement of the gold?

I got the movement to work jut fine heres my script:
-------------
Player - Player 1 (Red) types a chat message containing boo as An exact match
----------
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - ((Number of units in (Units in (Playable map area))) x 25))
Unit - Move (Picked unit) instantly to (Center of (Playable map area))

------------
--------------

As for the gold you really need to set a condition to check to make sure there's enough gold there first.
07-09-2003, 03:59 AM#3
Dinadan87
For starters thats not charging 25 gold per unit, that's charging 25 gold per unit SQUARED (3 units will cost 3 times more than it should, because it's running the loop 3 time and charging you for 3 units each time it runs).

As for the rest of it, I don't know why it works. Add in a text message and try again to see if the trigger even goes off. That'll tell you whether the problem is in your events or in your actions.
07-09-2003, 04:05 AM#4
Guest
I didn't try to even look at the math because he didn't mention that part but i know my trigger moves the units and subtracts the gold that you told me to subtract.