Warcraft III resources & community, 2003–2006 · archived

Help!! My trigger isnt working and i need to know why!?

5 posts
#1

Help!! My trigger isnt working and i need to know why!?

Here is my trigger. Well actually it is a set of three triggers:

Trigger 1, Make footmen:
Events:
Every five secs of game time
Conditions:
Actions:
create 1 footman for player 1 red at position of dark barracks facing default building facing degress

This trigger works by itself fine.

Trigger 2, enable making of knights:
Events:
a unit finishes an upgrade
Conditions:
researched tech type equal to "make knights"
Actions:
turn off "make footmen"
turn on "make knights"

I think this is where im having the problem because when i research the upgrade it keeps making footmen (doesnt turn "make footmen" off) and doesnt make make knights (doesnt turn on "make knights).

Trigger 3, Make knights
Events:
every five secs of game time
Conditions:
Actions:
create 1 knight for player red at position of Dark Barracks facing default building facing degrees

This trigger works by itself when there are no other triggers of the three running. When all three are put together i uncheck the initially on box so it wont make the knights until the "make knights" is researched. But it doesnt work.

Please help me i really need this trigger to work for my footmen wars map. I would really appreciate the help and will credit you in my map if you help me. Thx alot--AlphaChicken
#2
How did you manage that trigger 3 doesn't work at beginning? Did you deactivate it (red X over the symbol)?
#3
Actually, Disabling it (the red X) will make it not compile, and it's never able to be run in the game. If you turn off "Initially On" (so that it becomes grayed out) it should behave like that, DarkShadow.

Although I have had problems with that, so I manually "Turn Off" triggers that I need Off during Map Init.

I think your problem is here:
a unit finishes an upgrade

The event that you actually want is:
Unit - A unit Finishes research

By the way, you can right-click on any part of a trigger and select "Copy as Text" to get that section of the trigger, and you can paste it into the forum easily. If you do it inside the code tags, it will be correctly formatted.

Okay, if you make that change, your trigger should work, but I'd like to suggest a slightly less intense alternative, that's easier to keep track of.

Here's three triggers. One is map initialization, one is the spawner, and one is the upgrader. The variable unittypeSpawn is a unit type variable.
Map Init
    Events
        Map initialization
    Conditions
    Actions
        Set unittypeSpawn = Footman

Spawner
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Unit - Create 1 unittypeSpawn for Player 1 (Red) at (Random point in (Playable map area)) facing (Center of (Playable map area))

Unit Upgrade
    Events
        Unit - A unit Finishes research
    Conditions
        (Researched tech-type) Equal to Storm Hammers
    Actions
        Set unittypeSpawn = Knight
This way you're only actually running one intermittent trigger and one trigger that fires once, and it's a scalable system, meaning that you could make any number of different upgrades and set the same variable to make the one spawner trigger spew the right upgraded unit.

Anyway, except for that one thing, I don't see anything else wrong with your triggers right now.
#4
LOL, I know how this works, simply wanted to ask him, was aiming for a fast answer.
#5
thank you very much
ill credit you guys in my map
i hope its good will you critique it for me when im done? if so then tell me and ill send it to you when im done. Thx again --AlphaChicken