WAR3 Editor, need help with triggers

titusthefox

New Member
Reaction score
0
Hey all,

I am playing around with making maps and a campaign and i've hit a snag. I am sure the answer to it is very easy, but for some reason it has eluded me with ease :p

Here's the thing:
I want a trigger that spawns creatures for me when the player has built 1 town hall and 6 farms.

Any suggestions? And please, if you can - do it step by step for me :p

Thanks for any respons :)

-Titus
 

LightChaosma

New Member
Reaction score
60
Code:
Untitled Trigger 002
    Events
        Unit - A unit Finishes construction
    Conditions
        ((Unit-type of (Constructed structure)) Equal to Town Hall) or ((Unit-type of (Constructed structure)) Equal to Farm)
        (Number of units in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Farm) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Equal to 6
        (Number of units in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Town Hall) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Equal to 1
    Actions
        Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees

hope this is what you'r looking for
 

titusthefox

New Member
Reaction score
0
Aye

Aye, it sure is :) But I am having problems finding each different code, could you maybe tell me where to go for each code? :p Sorry for my lack of skills :D
 

Komaqtion

You can change this now in User CP.
Reaction score
469
first 1 is for the first and or condition, and also a boolean condition i think
second and third is both integer conditions, sorry but don't have time explain more :(
 

titusthefox

New Member
Reaction score
0
Alliance reinforcement
Events
Unit - A unit owned by Player 10 (Light Blue) Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Farm
(Unit-type of (Constructed structure)) Equal to Town Hall
Actions
Unit - Create 1 Squire Kalahn for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))
Unit - Create 11 Footman for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))

This is what I have so far. Not sure how you got the "Or" in the first condition, do I need it or does it work like I've set it up thus far?

And then there's those two other conditions, those I can't find :D
 

Komaqtion

You can change this now in User CP.
Reaction score
469
you use or when you want the condition to be either 1 or the other, and conditions means that both have got to be true. you can find or bu clicking "o" when you have up the condition menu then there will be two red texts "Condition 1" and "Condition 2" click 1 and put 1 of your unit type conditions there and then put the other condition in the other text.
for the Number of units condition you will press "i" when in the condition menu, then you will come to the integers, it will already say this: (Number of units in (Units in (Playable map area)) of just cjange the Units in to Units owned by Player 10 blue of type and then put your building there

EDIT: Sorry for the long post and sorry if you still don't get it, im not that good at explaining =(
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
ok.
Open your Trigger Editor (F4) -> Make a new Condition (Ctrl + D) -> Scroll down to Or (one of the last possibilitys) -> If you click it you can enter 2 other conditions (You did them already, i think you ll get it)

Next one:
Create a condition (Ctrl + D) -> Scroll down to Integer Comparison -> Change the left value to Unit - Count units in unit group (I think it is even standart in integer comparison) -> Now change Units in rect to Units in rect matching condition -> set the condition of the unit to Unit-type of (matching Unit) equal to Farm

And for the townhall, repeat the second condition with unit type townhall instead of farm and a value of 1 exept 6.
 

LightChaosma

New Member
Reaction score
60
the or command is one of th last condition options, with that option you can just enter the 2 condtions you have(these are correct).
the other 2 conditions (the counters) are integer coditions, just change what he needs to count to unit in region matching.....

P.S. the and condition used in the integer conditions is also located in the last few conditions (bottom of the list)
 

titusthefox

New Member
Reaction score
0
Ugh, I have to be honest with you and admit I don't understand you :p I'm sorry, but english is not one of my native languages so I can't interpeid different variations of it very well :| Thanks for trying though :)

(Number of units in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Farm) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Equal to 6
(Number of units in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Town Hall) and ((Owner of (Matching unit)) Equal to (Triggering player))))) Equal to 1

Those are the two conditions I need to know how to make :p
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
Off topic: better don't double post, use the edit function instead.
 

titusthefox

New Member
Reaction score
0
Arg, no units appeared :| pretty sure I got it right.

Alliance reinforcement
Events
Unit - A unit owned by Player 10 (Light Blue) Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Farm
(Unit-type of (Constructed structure)) Equal to Town Hall
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Triggering unit)) Equal to Town Hall))) Equal to 1
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Triggering unit)) Equal to Farm))) Equal to 6
Actions
Unit - Create 1 Squire Kalahn for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))
Unit - Create 11 Footman for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))


Still, no units appeared, any ideas?
 

LightChaosma

New Member
Reaction score
60
Arg, no units appeared :| pretty sure I got it right.

Alliance reinforcement
Events
Unit - A unit owned by Player 10 (Light Blue) Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Farm
(Unit-type of (Constructed structure)) Equal to Town Hall
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Triggering unit)) Equal to Town Hall))) Equal to 1
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Triggering unit)) Equal to Farm))) Equal to 6
Actions
Unit - Create 1 Squire Kalahn for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))
Unit - Create 11 Footman for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))


Still, no units appeared, any ideas?

you forgot tyhe or command:)
(Unit-type of (Constructed structure)) Equal to Farm
(Unit-type of (Constructed structure)) Equal to Town Hall
needs to be
(Unit-type of (Constructed structure)) Equal to Farm or(Unit-type of (Constructed structure)) Equal to Town Hall
 

titusthefox

New Member
Reaction score
0
Alliance reinforcement
Events
Unit - A unit owned by Player 10 (Light Blue) Finishes construction
Conditions
((Unit-type of (Triggering unit)) Equal to Farm) or ((Unit-type of (Triggering unit)) Equal to Town Hall)
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Triggering unit)) Equal to Town Hall))) Equal to 1
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Triggering unit)) Equal to Farm))) Equal to 6
Actions
Unit - Create 1 Squire Kalahn for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))
Unit - Create 11 Footman for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))

Did I get it right this time? :p
 

LightChaosma

New Member
Reaction score
60
nope, i overlooked a few things i'll make the changes fat:

Code:
Alliance reinforcement
    Events
        Unit - A unit owned by Player 10 (Light Blue) Finishes construction
    Conditions
        ((Unit-type of [U]([B]constructed unit[/B])) [/U]Equal to Farm) or ((Unit-type of ([U][B]constructed unit[/B])) [/U]Equal to Town Hall)
        (Number of units in (Units in Build farms1 <gen> matching ((Unit-type of[U] ([B]matching unit[/B])) [/U]Equal to Town Hall))) Equal to 1
        (Number of units in (Units in Build farms1 <gen> matching ((Unit-type of [U]([B]matching unit[/B]))[/U] Equal to Farm))) Equal to 6
    Actions
        Unit - Create 1 Squire Kalahn for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))
        Unit - Create 11 Footman for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))

sry for any misspelling, english is not my native language either

P.S. if you want to check wether the fault it in the actions or in the conditions, add an action in the begin of you trigger to display some text, maybe usefull for some more complex triggers in the future ;)
 

titusthefox

New Member
Reaction score
0
((Unit-type of (constructed unit)) Equal to Farm) or ((Unit-type of (constructed unit)) Equal to Town Hall)

I can't fint (constructed unit)) , is it maybe supposed to be constructed structure?


...Yay, page 2 ftw :)
 

titusthefox

New Member
Reaction score
0
Okey, I got them to spawn, but here's a new problem :p They spawned x3 times :p

My triggers thus far:

Alliance reinforcement
Events
Unit - A unit owned by Player 10 (Light Blue) Finishes construction
Conditions
((Unit-type of (Constructed structure)) Equal to Farm) or ((Unit-type of (Constructed structure)) Equal to Town Hall)
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Matching unit)) Equal to Town Hall))) Equal to 1
(Number of units in (Units in Build farms1 <gen> matching ((Unit-type of (Matching unit)) Equal to Farm))) Equal to 6
Actions
Unit - Create 1 Squire Kalahn for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))
Unit - Create 11 Footman for Player 10 (Light Blue) at (Center of Alliance reinforcement <gen>) facing (Random point in (Playable map area))

I'm thinking they maybe spawned once for each condition?
 

LightChaosma

New Member
Reaction score
60
that would mean the trigger fires 3 times for some reason, wich is strange, since you only have he event once...A solution would be, dont get me wrong, this is probalbly the lamest way to fix the problem, is to add an action at the end of the trigger to destroy this trigger or so...

but i son't see any faults in the code, don't you have the same trigger running or so?

EDIT:
Code:
Trigger - Turn off (This trigger)
 

titusthefox

New Member
Reaction score
0
The end trigger did the job :)

It seems though that it didn't require the town hall to be completed to trigger itself - the units spawned as soon as the 6 farms where done and the town hall wasn't even finished yet :p maybe it should be "and" instead of "or" if thats even possible? :p anyhu, I can live with this :)

Thanks for all the support and help! Awesome community :)
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top