HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Footmen Wars Spawn trigger

03-22-2005, 04:18 AM#1
andrewandrew
As I was loooking through some triggers and learning about the triggers for Footmen wars, i stumbled upon the spawn trigger which i find simple but do not understand what excatly the "size" means. I will show it to you here:

Events
Time - Every 9.00 seconds of game time
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (((Region centered at ((Picked player) start location) with size (384.00, 384.00)) contains (Random unit from (Units owned by (Picked player) of type Tier Zero (foots)))) Equal to True) then do (Unit - Create 1 Footman for (Picked player) at ((Picked player) start location) facing Default building facing degrees) else do (Do nothing)

What exactly does that mean, becauase in this map, the footmen do not spawn and was wondering if the "tier" size had anything to do with it.
03-22-2005, 04:47 AM#2
Fragmentation
it seems tier zero is a unit group consisting of footmen and tier zero is just the name of the unit group variable

it seems this trigger finds out if a random unit from that unit group which is tier zero is in the region of the picked player and is owned by the picked player and if thats true it created a footman.

I never played footmen wars so the function of the tier zero group is unknown to me, but I believe its a unit group.

If the footmen are not spawning, then either there are no units in that tier zero unit group or maybe there is no initial unit to be checked in the region so basically, if this function is searching for a random unit in a unit group and also if its owned by the player, doesn't there need to be at least 1 initial unit in the region for the trigger to take off?
03-22-2005, 05:44 AM#3
yuripro84
why do u want to do that???make it easy on yourself!!do this!!

EVENT
Time-Periodic Event
-Every XXX sec

CONDITION

ACTION
If/Then/Else
-If ((player 1(red) slot status) equal to is playing) then do
(Unit-create 1footman for player XXX(XXX) at ( position of castle XXX <gen>) facing (XXX degress)
else (do nothing)

This is the easiest in my opinion??other ways r too complicated, at least for me 0_oa
03-22-2005, 07:30 AM#4
Bulletcatcher
Code:
Region centered at ((Picked player) start location) with size (384.00, 384.00)
is used to create a region for use in the trigger without having to place one in the world editor. The size part is simply the dimensions of this region: It's 384 length units high and 384 length units wide.
03-22-2005, 07:42 AM#5
Fragmentation
yuripros example is indeed better IMO, but maybe the map maker wanted the trigger like that for some reason

never know
03-22-2005, 04:29 PM#6
andrewandrew
Thanks guys, as for yuripro, if the trigger were that easy I would have used it that long ago, but if you have played footmen wars, you have mulitple "tiers" therefore at level 4 spawnrates say you spawn chickens, you would still be spawning eggs. Thanks for your input now i must try to fix the spawn problem. I also want you guys to know that I imported ALL custom objects from my old map to this new one and wonder if that changed the triggers/affecting units whatsoever. Because this code worked fine in my old one. Perhaps they do not reconize the "new" start location?
03-22-2005, 07:13 PM#7
Guest
Events
Time - Every 9.00 seconds of game time
Conditions
(Player 1 (Red) slot status) Equal to Is playing
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees

Yuri's way is fine. Just when you upgrade a tier:

Events
Unit - A unit owned by Player 1 (Red) Finishes an upgrade
Conditions
(Researched tech-type) Equal to Tier two
Actions
Trigger - Turn off (spawn footmen)
Trigger - Turn on (spawn riflemen)

And the riflemen trigger is:

Events
Time - Every 9.00 seconds of game time
Actions
Unit - Create 1 Rifleman for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees

Now right click the rifleman trigger and select "Initially on" and make sure thats not checked. and Voila!
In other words, every 9 seconds it'll spawn footies then when you research tier two it will turn off the footman trigger making it stop producing footmen and it will turn on the rifleman trigger so it will produce riflemen. Then just make another trigger for tier three, four, five, ect.

~Piece
03-22-2005, 09:55 PM#8
Raptor--
or even simpler,
Code:
Events
    Time - Every 9.00 seconds of game time
Conditions
    (Player 1 (Red) slot status) Equal to Is playing
Actions
    Unit - Create 1 SpawnUnitType[1] for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees

//And simply update the variable as you upgrade

Events
    Unit - A unit owned by Player 1 (Red) Finishes an upgrade
Conditions
    (Researched tech-type) Equal to Tier two
Actions
    Set SpawnUnitType[1] = Rifleman

and then you could loop that for all players, and use if blocks to combine everything into 2 triggers

personally i hate "blood" maps, they're really basic and anoying to think that people keep making them, but i guess they're good starter maps to learn from
03-22-2005, 10:44 PM#9
Fragmentation
yea, good examples
03-23-2005, 01:10 AM#10
thedevil
Quote:
If (((Region centered at ((Picked player) start location) with size (384.00, 384.00)) contains (Random unit from (Units owned by (Picked player) of type Tier Zero (foots)))) Equal to True) then do (Unit - Create 1 Footman for (Picked player) at ((Picked player) start location) facing Default building facing degrees) else do (Do nothing)

Well my english not good but i can see the trigger it's not so complex,it just say that every [X] seconds if unit in size 384,384 at player start location have [Unit type] then the trigger will work.
If u wanna edit it into ur trigger just change [unit type] into which unit u want this trigger really funny ^_^ that so different from my footman map but i think it's not good cuz u must have multiple trigger for muli type of unit spawn and for me i just need 1 trigger for each player and they can change to every unit spawn they want ^_^
03-23-2005, 04:20 AM#11
andrewandrew
Raptor, i got this trigger working but I need to know what the SpawnUnitType Variable is.
03-23-2005, 04:53 AM#12
Azhag
Quote:
Originally Posted by andrewandrew
Raptor, i got this trigger working but I need to know what the SpawnUnitType Variable is.

It think it might be a unit-type variable.
03-24-2005, 03:34 PM#13
andrewandrew
"(Researched tech-type) Equal to Tier two"

Unfortunately I just figured this "tech-type" was only for unit upgrades and not ACTUAL units being upgrade, these are just armor improvements etc.
03-24-2005, 10:07 PM#14
Raptor--
i believe the original idea was that you'd make a 'dummy upgrade' that costs money and all, but did nothing except run the trigger when it happened
03-25-2005, 01:25 AM#15
Guest
Quote:
Originally Posted by andrewandrew
"(Researched tech-type) Equal to Tier two"

Unfortunately I just figured this "tech-type" was only for unit upgrades and not ACTUAL units being upgrade, these are just armor improvements etc.

Yes, exactly what Raptor said. All it's supposed to do it "trigger" the trigger. A Dummy Upgrade, exactly :D.

Also I think the variable might be "Integer" at least that's what I use.