• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

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

Status
Not open for further replies.
Level 5
Joined
Jun 18, 2004
Messages
136
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
 
Level 8
Joined
Apr 3, 2004
Messages
507
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.
Code:
Map Init
    Events
        Map initialization
    Conditions
    Actions
        Set unittypeSpawn = Footman
Code:
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))
Code:
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.
 
Level 5
Joined
Jun 18, 2004
Messages
136
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
 
Status
Not open for further replies.
Top