HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I am stumped...

06-30-2004, 06:58 AM#1
Aelita Lyoko
I am working on yet another trigger.

Code:
Mountain Village
    Events
        Unit - Transport Inc. 0018 <gen> Begins casting an ability
    Conditions
        (Ability being cast) Equal to Mountain Village 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Target unit of ability being cast)) Current gold) Less than or equal to 9
            Then - Actions
                Game - Display to (Player group((Owner of (Target unit of ability being cast)))) the text: You do not have the...
                Trigger - Reset (This trigger)
            Else - Actions
                Player - Add -10 to (Owner of (Target unit of ability being cast)) Current gold
                Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
                Wait 3.00 seconds
                Unit - Move (Target unit of ability being cast) instantly to (Center of Mountain Village <gen>)
                Special Effect - Destroy (Last created special effect)

I have gone and tested this, but the move unit action doesn't seem to be working at all.

I have tried changing the conditions, changing the action to other forms of unit movement, and i even tried to use 9 different dummy abilties, but that damned move unit action still will not respond.

Can anyone help me out here?
06-30-2004, 07:39 AM#2
Xinlitik
"Target unit of ability being cast" is not limited to the trigger that it is in, unlike "Triggering unit" etc. It will be replaced every time a unit casts a spell with a target, which means that a wait between its use will usually result in its being replaced. Set a unit variable equal to the target unit of ability being cast. That should make it work.
06-30-2004, 04:39 PM#3
Aelita Lyoko
I have a to set a variable?

Damnit. I hate working with variables.

Well. [pandarean brewmaster]I'll give it a shot[/pandarean brewmaster]
06-30-2004, 07:21 PM#4
Emekun
I'm sorry about this useless post, but i'm curious. How are you planning to avoid variables, working on your open RPG ? :)
07-01-2004, 06:36 AM#5
Aelita Lyoko
You would be surprise how far i have gotten in the way of triggers without a single variable.

However, i will have to use them when i start adding the dialog box for a trigger enhanced spell.

So, no matter what i want to be done, i have to work with them.

ehhh....variables are such a pain in the ass to me.
Probably easy for everyone else though. :-)
07-01-2004, 04:18 PM#6
Aelita Lyoko
I just made the trigger with a variable.

I am gonna be testing to in a minute. Hopefully, it will work.
07-01-2004, 05:15 PM#7
weaaddar
I Really don't know how you people expect to get far without using variables. Your the same guys who boast about having several hundred triggers in your map too. Variables simplify things they don't make it harder turst me. I only don't like global variables because global variables are in union with satan.
07-02-2004, 11:38 AM#8
johnfn
Just think of variables as little boxes that hold numbers and that you can add or subtract, multiply or divide the number in the box and the variable will hold that number. Variables arent really a pain at all, they really come in handy sometimes. Learn how to use em now so when you need em you wont hit a brick wall.
07-02-2004, 12:50 PM#9
Kolibri
Slightly Offtopic:
When naming variables it is often a good idea to pick meaningful names.

I prefer to add a prefix so that similar variables are grouped together.
E.g. all temporary variables (ie. variables that are only temporarily used and risk being overwritten by other triggers) I call tmp_variablename, and all triggers associated with a hero I prefix with an acronym for that hero.

Hope this helps for your road onto using variables. :)