| 07-08-2003, 01:46 AM | #1 |
Okay, I'm trying to make a trigger that will do the following: Teleport all selected units to a set location when the user types in a command and charges 25 gold per teleported unit. Here's the trigger I have that does NOT work: EVENTS: Player - Player 1 (Red) types a chat message containing -t 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>) RESULT: Nothing. If someone could please tell me what's wrong with this, and give me a trigger that DOES work, I would really appreciate it. Thanks, Nik |
| 07-08-2003, 01:50 AM | #2 |
(edit) Whoops I read it wrong... I have no idea why it doesn't work but for one thing your gold trigger is messed up... It's subtracted 25 gold per unit EACH time it runs through the pick unit command. So it costs 100 gold for 2 units... 225 for 3 units.. etc. the price is actually 25 X (units squared). |
| 07-08-2003, 01:54 AM | #3 |
Um... that didn't help because you told me to do exactly what I already have there... ~Nik |
| 07-08-2003, 01:56 AM | #4 | |
Quote:
Yeah sorry that's because I read it wrong and you replied before I was done editting... |
| 07-08-2003, 11:53 AM | #5 |
Here is my way to do it: E: Player 1 red types -t as a substring C: (Triggering player) has <1 units selected <-- Not needed A: Pick all units currently selected by (Triggering player) and do add (Picked unit) to UnitGroupV Now... You need to check how many there are in the group and add it to GroupInteger If (Enteredchatstring(Substring(4,7))) equal to home then do Move units in UnitGroupV instantly to Home TP <gen> Here you add all other teleportlocations Set (Triggering player) current gold = (Triggering player) current gold - GroupInteger * 25 Regards Dead-Inside |
| 07-08-2003, 03:45 PM | #6 | |
Quote:
If you do it that way the player will be charged even if he doesn't type home or misspells it... If you only doing teleports to go home then don't do that enteredchat substring and make it part of the event. |
