HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help With A Spawn Trigger

01-27-2003, 03:38 PM#1
Thunder-Hunter
Can anyone tell me the trigger for say you have Like 5 Blacksmiths In a certain region, I want them to spawn that many footmen... Like 6 Blacksmiths = 6 Footmen. I tried to get a trigger but Cannot find out how to do it.

Any help would be appercaited.+
01-27-2003, 03:52 PM#2
fr0ggE
here's a way you could do it. Set a variable (integer) called NumberOfSmiths, with initial value 0. Create a region X that covers the area where all the smiths *could* be.

Event: Time-Periodic Event-Every X seconds of the game

Actions:
IF: Smith1 is in region X, THEN: set variable NumberOFSMiths to NumberOfSmiths + 1, ELSE: Do nothing

have a similar if clause for each starting Smithy. Then do this

IF: NumberOfSmiths = (max value), THEN: Create (max value) footmen at Center of RegionX, ELSE: do nothing

and then do if clauses like this down in ascending order.

At the end of your trigger make sure to set NumberOfSmiths back to zero


Limitations of this Trigger: It assumes that you start with all the smiths you'll ever had. If you can build smithies in your map then this isn't the right approach.

fr0ggE
01-27-2003, 03:57 PM#3
fr0ggE
In fact, come to think of it, if you can't build new blacksmiths, an ezer way to do the above trigger would just be:

----
Event: Player Owned Unit Event: Unit owned by player X dies

Condition: Unit Type Comparison: triggering unit = blacksmith

Action: Set Value of NumberOfSmiths = NumberOfSmiths - 1.
----

----
Event: Periodic: Every X seconds

Actions: Create (NumberOfSmiths) footmen (wherever you want them)
----

note: in this version of the trigger the initial value of NumberOfSmiths is the max value instead of the min.


fr0ggE
01-28-2003, 04:13 AM#4
Thunder-Hunter
thx:D The limit of smiths will be 10 so.... I dont know if the first way includes being able to build new smiths like im making a map where you can build buildings and for each building up to ten it will spawn a unit... Kinda Like the SC map "Swords and Arrows"
01-28-2003, 04:43 AM#5
Guest
Hehehe so much easier way to do this....

Events:
Every [5] seconds

Actions:
For each interger A from 1 to [all players with slot type [used]] do [For each interger B from [starting number of footmen] to [number of units in [units of type [blacksmith] owned by player [interger A] do [create [how many footmen you want spawned per blacksmith] [footmen] for player [interger A]]

This way you can have unlimited smiths, and its so much less work!
01-28-2003, 06:47 AM#6
fr0ggE
*blinks*

*blinks again*

*shakes his head*

*rereads Specter's Post*

Oooooooooohhhhhhhhhhh, hot shit! Oh, cool Spectre. That does kick the stuffing out of my method, doesn't it. One question:

explain the
For Each integer B from [starting number of footmen] to number of units...

what the hell is that starting number of footmen there? Is that a variable or something? What good is it doing?

the rest of it makes sense tho. At least the idea of it does. Not seeing how it would work with that [starting number of footmen] tho. Is that just a holder for something else. bleh.
02-09-2003, 06:55 AM#7
Thunder-Hunter
Thx Guys:D
02-10-2003, 02:23 AM#8
Thunder-Hunter
Oh can u plz explain the unit (Int B - starting # of footmen) thing?

Or could you just make a map with the trigger in it for me to download?

That would be easyist for me cause I cant get the trigger to work right...
02-10-2003, 04:30 AM#9
Aiursrage2k
Best method, every x seconds, pick all the blacksmiths, determine if there is only smith in the region, then spawn Number of blackssmiths owned by player of picked unit at offset of picked unit facing some angle.
02-10-2003, 05:22 AM#10
Thunder-Hunter
I kinda dont get that but I will try to make the trig and do u have a map with that trig so I can DL it?
02-15-2003, 01:58 AM#11
Thunder-Hunter
bump
06-27-2003, 11:29 PM#12
Thunder-Hunter
yea yea i know this is old, but can some1 still make me the map cause i really suck at this kind if stuff
06-28-2003, 08:13 AM#13
Dead-Inside
Every X seconds of the game

Set TempSpawn(Integer) = (Integer Comparsion) Number of Unit-Type Blacksmiths in region X
Spawn TempSpawn XXX for player X at XX
06-28-2003, 10:51 AM#14
Hivemind
Ok, he is new to this so keep it simple for him. He doesnt need advanced TD style spawning yet. Just that basics will get him going. When his map laggs all to hell he can come back and figure out the more advanced spawn systems.

here u go....

Event-
Periotic - every 30 seconds of game time

Conditions-
None

Actions-
Pick every unit of type blacksmith and do create 1 footman for player x at location of picked unit


And here is the answer to the next question you will ask.....

Event-
Unit enters playable map area

Conditions-
Unit of type footman
Unit owned by player x

Actions-
Order entering unit to attack move to center of (your target region)
06-28-2003, 03:37 PM#15
Thunder-Hunter
Thx all