Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Easily Spawn System
Easily Spawn System
Mar 17 2009, 6:00 am
By: blacklight28  

Mar 17 2009, 6:00 am blacklight28 Post #1



May I have some ideas for some good spawning systems for RPGs? I'm stuck on my RPG with a spawning system.



None.

Mar 17 2009, 8:09 am Vrael Post #2



I bet some people will probably give you something fancier, but I think this is relatively simple. First, it depends on exactly what you want. If you want an area populated with a pretty average number of units, which seems pretty typical for an rpg, what I do is put 1 location over the whole area, call that 'Spawn Area' and 3-4 smaller locations within the area, Spawn1, Spawn2, Spawn3, Spawn4 ect.

If I want to have about 15 critters to fight in the area, I do something like this.

Conditions:
Always
Actions:
Randomize switch1
Randomize switch2
preserve trigger

Conditions:
Computer Player has suffered exactly 0 deaths of Timer
Actions:
Set to 720 for Timer
Preserve trigger

Conditions:
Computer Player has suffered at least 1 deaths of Timer
Actions:
Subtract 1 for Timer
Preserve Trigger

Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is set
Switch 2 is set
Computer Player has suffered exactly 1 deaths of Timer
Actions:
Create 1 Enemy at Spawn 1
Run AI Script at Spawn 1: Junk Yard Dog
preserve trigger

Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is cleared
Switch 2 is set
Computer Player has suffered exactly 1 deaths of Timer
Actions:
Create 1 Enemy at Spawn 2
Run AI Script at Spawn 2: Junk Yard Dog
preserve trigger

Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is set
Switch 2 is cleared
Computer Player has suffered exactly 1 deaths of Timer
Actions:
Create 1 Enemy at Spawn 3
Run AI Script at Spawn 3: Junk Yard Dog
preserve trigger

Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is cleared
Switch 2 is cleared
Computer Player has suffered exactly 1 deaths of Timer
Actions:
Create 1 Enemy at Spawn 4
Run AI Script at Spawn 4: Junk Yard Dog
preserve trigger



This way, there's a 1 minute timer (with hyper triggers) between spawns so the heroes have a chance to clear out the area (make the timer smaller if you don't want that to happen), and they can't just sit on 1 location and farm the things, since they randomly pop out at 4 locations. You can modify this as you like, this is just a basic framework.



None.

Mar 18 2009, 1:22 am payne Post #3

:payne:

Personally, I'd go for one of those two ways:

1) Pre-place burrowed units, have a location centred on your hero permanently. Every time you detect a burrowed unit in the location, you set a switch. Once that switch is setted, you can tell the console to create some units at the location that you would have centred on the burrowed unit.
Anyways, this isn't clear, but I'm doing my best with my dumb-ass friend playing some poor guitar at my left...
2) Create a location over each area and have pre-placed burrowed units. Once a hero enter the huge area's location, you make units spawn at each burrowed unit and run AI JunkYard Dog



None.

Mar 19 2009, 1:57 am blacklight28 Post #4



I'm planning on using a system that doesn't use many locations. I'll go over Vrael's way though. I haven't looked at it properly yet.



None.

Mar 19 2009, 4:52 am Vrael Post #5



Well, you could modify what I did to make it use only 2 locations instead of 4-5.
Instead of doing this four times:
------------------------------------------------------------------------------
Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is set
Switch 2 is set
Computer Player has suffered exactly 1 deaths of Timer
Actions:
Create 1 Enemy at Spawn 1
Run AI Script at Spawn 1: Junk Yard Dog
preserve trigger
------------------------------------------------------------------------------

Place 4 burrowed zerglings for say, player 9 where you would have placed the 4 spawn locations from the prior system.
Then do this:

------------------------------------------------------------------------------
Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is set
Switch 2 is set
Computer Player has suffered exactly 1 deaths of Timer
Actions:
Center Location Spawn 1 on burrowed unit owned by player 9 at 'Spawn Area'
Create 1 Enemy at Spawn 1
Run AI Script at Spawn 1: Junk Yard Dog
preserve trigger

Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is cleared
Switch 2 is set
Computer Player has suffered exactly 1 deaths of Timer
Actions:
give 1 burrowed unit owned by player 9 at 'Spawn Area' to player 10
Center Location Spawn 1 on burrowed unit owned by player 9 at 'Spawn Area'
Create 1 Enemy at Spawn 1
Run AI Script at Spawn 1: Junk Yard Dog
give all burrowed unit owned by player 10 at 'Spawn Area' to player 9
preserve trigger

Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is set
Switch 2 is cleared
Computer Player has suffered exactly 1 deaths of Timer
Actions:
give 2 burrowed unit owned by player 9 at 'Spawn Area' to player 10
Center Location Spawn 1 on burrowed unit owned by player 9 at 'Spawn Area'
Create 1 Enemy at Spawn 1
Run AI Script at Spawn 1: Junk Yard Dog
give all burrowed unit owned by player 10 at 'Spawn Area' to player 9
preserve trigger

Conditions:
Computer Player brings at most 14 Enemies to Spawn Area
Switch 1 is cleared
Switch 2 is cleared
Computer Player has suffered exactly 1 deaths of Timer
Actions:
give 3 burrowed unit owned by player 9 at 'Spawn Area' to player 10
Center Location Spawn 1 on burrowed unit owned by player 9 at 'Spawn Area'
Create 1 Enemy at Spawn 1
Run AI Script at Spawn 1: Junk Yard Dog
give all burrowed unit owned by player 10 at 'Spawn Area' to player 9
preserve trigger
----------------------------------------------------------------------------------------------------

These are just the 4 spawn triggers. Keep all the other triggers too, and it will work with 2 locations instead of 5.



None.

Mar 19 2009, 12:09 pm payne Post #6

:payne:

Giving burrowed units to an other player will make them unburrow, no?



None.

Mar 19 2009, 11:39 pm blacklight28 Post #7



Ok, I thought about this a lot. I decided I want the system to have the units spawn on the heroes themselves. So when they're walking, units will just spawn on them. Trying to make this work...



None.

Mar 20 2009, 6:05 am Riney Post #8

Thigh high affectionado

Quote from blacklight28
I'm planning on using a system that doesn't use many locations. I'll go over Vrael's way though. I haven't looked at it properly yet.

Using a 15x15 or so location constantly centered on a hero, when ever he was to lets say walk up to a "Spawner" building or burrowed unit infront of a cave, units pop out at a location convenently centered on the spawner! And if that building were to lets say blow up at random, no more spawner.

Player locations + 1 Center on spawner location = At most 8



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Mar 21 2009, 11:17 am KilaByte Post #9



If you want random spawns, you could try this:
Have a location that will center on your hero whenever he is not in that location.

Every time your hero walks out of the location:
Use randomized switches to determine if units should spawn or not.
Re-center the location on your hero.
Spawn the units.
Preserve.

That way, every time your hero walks a certain distance (I.E. Walks out of your hero location). You will have a random chance of getting enemies spawned on you.

Not sure if that's what you want, but hope it helps.



None.

Mar 25 2009, 12:54 am blacklight28 Post #10



Quote from KilaByte
If you want random spawns, you could try this:
Have a location that will center on your hero whenever he is not in that location.

Every time your hero walks out of the location:
Use randomized switches to determine if units should spawn or not.
Re-center the location on your hero.
Spawn the units.
Preserve.

That way, every time your hero walks a certain distance (I.E. Walks out of your hero location). You will have a random chance of getting enemies spawned on you.

Not sure if that's what you want, but hope it helps.

About how big should the location be if I want units to spawn, let's say, about 10 seconds apart?



None.

Mar 25 2009, 10:45 am KilaByte Post #11



Quote from blacklight28
Quote from KilaByte
If you want random spawns, you could try this:
Have a location that will center on your hero whenever he is not in that location.

Every time your hero walks out of the location:
Use randomized switches to determine if units should spawn or not.
Re-center the location on your hero.
Spawn the units.
Preserve.

That way, every time your hero walks a certain distance (I.E. Walks out of your hero location). You will have a random chance of getting enemies spawned on you.

Not sure if that's what you want, but hope it helps.

About how big should the location be if I want units to spawn, let's say, about 10 seconds apart?

It's best to play around with location sizes until you find what fits best. You should only need 1 location for this system but more trigger work depending on how you accomplish it.

Units spawning depends on how much/far the hero walks (Like in a typical FF or pokemon game.) So the faster the unit is and the farther the unit walks the more often it is going to run into enemies.

Try something like this.

Center a 10x10 location on your hero. (Location "X")
Hero name is "Hero".


CONDITIONS: (Player who owns the hero)
"Current Player" brings "at most" "0" "hero" to location "X"
ACTIONS:
Set switch "CheckSpawn"
Center Location labeled "X" on "Hero" at location "Anywhere".
Preserve Trigger
--------------------------------------------------------------------------------------
Then you have:
--------------------------------------------------------------------------------------
CONDITIONS:
"CheckSpawn" is set.
ACTIONS:
Create 10 "Bad Guys" at location "X"
clear "CheckSpawn"
Preserve Trigger
------------------------------------------------------------------------------------
With this, every time the hero walks 10 spaces in one direction
it will spawn 10 units on top of him. Note that this only works
if the hero walks 10 spaces in ONE direction and units spawn EVERY
TIME. With some tweaking you can randomize the switches (to change
how often units spawn) and change the location size (to change how far
the unit must walk for "CheckSpawn" to be activated.

Hope this helps.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
Please log in to shout.


Members Online: Ultraviolet, C(a)HeK