Help: Spawning system

Frozen King

Member!
Joined
Oct 9, 2003
Messages
52
Reaction score
0
Location
Norway
Website
Visit site
Iam making an rpg and i don't know any good ways to spawn units. I want to have a simular spawning system like the bonus campaign in TFT has, where each unit spawn the same place as it was created after a specfic amount of time.

Any good ideas?
 

IceDevil9

BattleForums Senior Member
Joined
Feb 19, 2003
Messages
3,418
Reaction score
3
Location
CA
Website
www.rcthaven.com
You could always use my TD Tutorial for one way how to spawn.

Find it here.

After a certain time that's simple. First create your regions.

Then run:

Events
Time - Periodic Event - Every 15 seconds

Conditions
None

Actions
Unit - Create - Create 1 Your Unit at location Your Location.

-Frank :cool:
 

tassadar920

Member!
Joined
May 18, 2003
Messages
2,048
Reaction score
0
Location
My house
Originally posted by Frozen King
Iam making an rpg and i don't know any good ways to spawn units. I want to have a simular spawning system like the bonus campaign in TFT has, where each unit spawn the same place as it was created after a specfic amount of time.

Any good ideas?
My way of spawning in RPG's is this:

When a unit dies, have it wait ## seconds, whatever you want, then have it check if there are any enemies of the dieing units owner in the vicinity (about 1000x1000 area), if not, respawn, if there is, wait 10 seconds and loop the actions.
 

Frozen King

Member!
Joined
Oct 9, 2003
Messages
52
Reaction score
0
Location
Norway
Website
Visit site
Frank: Your spawning system doesent work cause after a while it gets too many units "lying" around.

Tassadar: Can u put up some triggs on how u do ur spawn system?
 

Jimstick

Member!
Joined
Oct 27, 2003
Messages
38
Reaction score
0
Website
Visit site
Im not quite sure what your asking for, do you want the units to just keep respawning even if the origional doesn't die or do you want a unit to spawn only after it dies? From your last post it doesn't seem like you want all of the extra units, so if you want it to respawn units after they die then tassadar920's trigger would work. I'd make the trigger look something like this:

Event
---generic unit event - a unit is killed

Condition
---dying unit belongs to player "whatever player the enemy is"

Action
---Wait "however long you want the respawn to take"
---unit - create 1 unit-type of dying unit for "whatever player the enemy is" at position of dying unit

This should work :)
 

Frozen King

Member!
Joined
Oct 9, 2003
Messages
52
Reaction score
0
Location
Norway
Website
Visit site
Originally posted by Jimstick
Im not quite sure what your asking for, do you want the units to just keep respawning even if the origional doesn't die or do you want a unit to spawn only after it dies? From your last post it doesn't seem like you want all of the extra units, so if you want it to respawn units after they die then tassadar920's trigger would work. I'd make the trigger look something like this:

Event
---generic unit event - a unit is killed

Condition
---dying unit belongs to player "whatever player the enemy is"

Action
---Wait "however long you want the respawn to take"
---unit - create 1 unit-type of dying unit for "whatever player the enemy is" at position of dying unit

This should work :)
Thats about what i thought of yeah, however it was too much work to create 1 trigger per unit to spawn(since i was going to have at least 300 units or so...). So i made my spawning system like this (if anyone wondered):

Events:
Time - Every 5.00 seconds of game time

Conditions:
(Number of units in (Units in Region 001 <gen> owned by Neutral Hostile)) Less than or equal to 20

Actions:
Set RANDOM_unit = (Random integer number between 1 and 10)

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RANDOM_unit Less than or equal to 4
Then - Actions
Unit - Create 1 Gnoll for Neutral Hostile at (Random point in Region 001 <gen>) facing Default building facing degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RANDOM_unit Less than or equal to 8
Then - Actions
Unit - Create 1 Gnoll Poacher for Neutral Hostile at (Random point in Region 001 <gen>) facing Default building facing degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
RANDOM_unit Less than or equal to 10
Then - Actions
Unit - Create 1 Gnoll Brute for Neutral Hostile at (Random point in Region 001 <gen>) facing Default building facing degrees
Else - Actions
Do nothing


Ty for help :)
 

NewPosts

New threads

Top