HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hi! Need some trigger help... Again :D

06-22-2003, 09:41 AM#1
Markus3832
Sry but i really can't do triggers... But i need help... How do i make so that you get victory if you have built let's say... 1 barrack and 6 farms?? I tried but it's so complicated...
06-22-2003, 10:08 AM#2
Earth-Fury
ull need 2 variables: complete[boolen][array] farms[intiger]
unti enters regon [playable map] of type barracks set complete[1]=true

unti enters playable map area of type farm do set farms = farms + 1

farms becoms equil to or greater then 6 do set boolen complete[2] = true

every 3 sec do if complete[1] = true and cmplete[2]=true do declare victory for player[1]
06-22-2003, 10:21 AM#3
Markus3832
That was very confusing... I made the two variables just as you said then i made a trigger with the event "A unit enters (region)" but what do you mean with "of type barracks" nothing shows after a unit enters region...
06-22-2003, 10:28 AM#4
Earth-Fury
lo lsorry, i wrote that quicly, its a conditon. use ifs.like:
event: unti enters regon
cond.:none
actions:
if unit type oif entering unti = baracks do set complere[1] = true
if unit type oif entering unti = farm do set farms = ([farms] + 1)

then you have another trigger:
events: every 3 seconts
cond.:complete[1] = true
actions:
if [farms] =< 6 do declare victory for player [1]
06-22-2003, 11:08 AM#5
Markus3832
I still can't get it to work... I post the map and then someone who has the time and wants to help me can help me... :ggani:

Cause if i know myself (wich i do) the chances of that i have made something wrong somewhere is 99,99999%
06-22-2003, 03:11 PM#6
Markus3832
I see a few has dled the map and i have also noticed this thread goes fastly downwards... Of you who dled it can't you help me? This isn't really something big either... I'm just trying out importing and exporting models but then i wanted it to be as in the first orcish campaign from warcraft 1 but i am not capable of doing triggers... I SUCK... So thats why i'm asking for help... If someone wants to help me and have some time over... You can try help me come up with a way so that you only can build next to the road cause im out of ideas... and i don't have the skills to do it myself either...

Plz Help me!
/Mackan
06-22-2003, 03:17 PM#7
Earth-Fury
look at the tutorial orc campaing. extrat it with win mpq. there wil lbe all ull need.
06-22-2003, 03:21 PM#8
Dead-Inside
Hehe, I was going to do it... Then I forgot about it... I'll do it quickly when I'm done with reading the forums...

Edit: Sorry, changed my mind... Didn't have enough time to go around it...
06-22-2003, 03:23 PM#9
Markus3832
i did look at the orcish campaigns... But that was 90 X more complicating than what you told me...
06-22-2003, 04:15 PM#10
Norbo
Here's a simple way.
-----
Event:
Unit finishes construction (I'm fairly sure that's an event..)

Condition:

(Int comparison: number of units in unit group(units of type (farm)) is greater than or equal to 1) AND (Int comparison: number of units in unit group(units of type(barracks) is greater than or equal to 6)

Action:
Game - victory for player(x)
------
For a multi-player game, it'd be a little different.

You could also use a periodic event.

Or use that condition as an if/then in actions within a loop, if you had multiple players.
06-22-2003, 06:08 PM#11
Markus3832
that didn't work for me either... It's easier if someone does it and post it back here...
06-23-2003, 01:25 AM#12
Hivemind
Event-

Unit owned by player 1 (Red) Finishes contsruction

Condition-

(Number of units in(Units owned by Player 1 (Red) of type Barracks)) Greater than 0

(Number of units in(Units owned by Player 1 (Red) of type Farm)) Greater than 5

Actions-

Game - Victory Player 1 (Red) (Show dialogs, Show Scores)


This is a over simplified way to do it. It has the problem that if the player starts consruction but does not complete it that building will still count as a structure. He would only need to complete the last one.

To fix that do this....

Create 2 intiger variables called farms and barracks. Set thier starting value to 0 and or set the value to 0 in the init trigger. You could use 1 array instead but this is easier to understand.

Event-

Unit owned by player 1 (Red) Finishes contsruction

Condition-

None

Actions-

If ((Unit type of (Constructed structure) Equil to Barracks) then do (Set Barracks = (Barracks + 1) elce do (Do nothing)

If ((Unit type of (Constructed structure) Equil to Farm) then do (Set Farms = (Farms + 1) elce do (Do nothing)

If ((Barracks Greater than 0) and (Farms Greater than 5)) then do Game - Victory Player 1 (Red) (Show dialogs, Show Scores)


You will find the conditions in the if than statements under intiger. Make sure you use (Constructed structure) and not (Constructing structure) or it wont work. Most triggers use basic logic. Read through all the triggers and trigger funtions. Find out what conditions can be used in which situations. This is enough to get you started. Trial and error should get you most of the rest of the way. If you get realy stuck ask. But please make a solid effort before you do.
06-23-2003, 05:02 PM#13
Markus3832
That worked! Thank you! But i still need to find out just how to make it so you only can build next to the road..
06-23-2003, 06:39 PM#14
Markus3832
If i have 3 regions and i only wan't so i can build inside the regions... how would i do that?
06-23-2003, 08:31 PM#15
Dead-Inside
A unit begins construction
Unit not in region XXX or XXX or XXX (There is "OR" conditions)
Do cancel construction.