Kal's Event Spawner Issue with using "<" and ">" in event name

Hey - It's an interesting issue. In Kal's Event spawning script, you need to name your event like this

"<spawn-event nameofevent>"

but my problem is that my event names, due to another script, have these symbols in them "<" and ">" and the event spawning script is giving me an error because it is seeing too many "<" and ">" symbols. So for example, I write "<spawn-event <enemy:31>>" and it returns an error.

Is there any easy way to modify Kal's script so it will recognize these symbols?

Link to his post: http://forums.rpgmakerweb.com/index.php?/topic/6099-eventspawn/

Script itself: https://gist.github.com/kl/1790186
What an epic enemy summoning tool! If it would only work, that is...

You can spawn events by their IDs as well, so you don't have to use the name of the enemies.

The usage instructions are not updated, but it is noted in the update notes.

So, instead of using <spawn-event [name]>, use <spawn-id [id]>. Replace the id in the brackets with the event's ID (and do NOT use the brackets!).

If you want to spawn an event from the Spawn Event Map, you can simply add an X after the ID of the event.

Example:

<spawn-id 22X> - This takes the event from the Spawn Event Map.

<spawn-id 22> - This takes the event from the current map.

But it will not become an enemy automatically, you will need a little patch do make it one.

You can try to add this below the ABS scripts and below this event spawner script:

Spoiler
class Kal::EventSpawn::Spawner def spawn run_common_event set_spawn_pos # set the position the spawned event will have. if name = @options[:event_name] event = event_from_name(name) elsif id = @options[:event_id] event = event_from_id(id) end cloned_event = clone_event(event) cloned_event.life_es_kal = @options[:life] cloned_event.moveto(@x, @y) # move the spawned event to it's position. # Add the spawned event to the Game_Map and the current Spriteset: $game_map.events[cloned_event.id] = cloned_event spriteset = SceneManager.scene.instance_eval { @spriteset } spriteset.instance_eval do @character_sprites << Sprite_Character.new(@viewport1, cloned_event) end # Initializing the ABS enemy variables manually here! cloned_event.init_manual_abs_stuffs # ABS enemy init end! @spawn_count += 1 @should_spawn = false end endclass Game_Event < Game_Character def init_manual_abs_stuffs @awareness = false @inrangeev = nil @being_targeted = false @agroto_f = nil @draw_drop = false @dropped_items = [] @epassive = false @touch_damage = 0 @start_delay = 0 @touch_atkdelay = 0 @killed = false @knockdown_enable = false @deadposee = false @respawn_anim = 0 create_token_arrays register_enemy(@event) end end
I had fun spawning 50 slimes with this within 1 minute, rofl! Didn't test it much, but it seems to work fine after applying the above patch.
Nice catch on the update notes, I totally overlooked it. I agree - what a great tool for us 😛

Thanks for the correction, it works perfectly..
In case you haven't noticed yet, you can't make enemy spawners which only spawn when the player is in range and will stop spawning when they are killed or using a tool.


I played hell of a lot with this spawner script, killed around 12 thousand spawned slimes and bees, and decided to make a little patch with some extras for Falcao's ABS.


You can get it here if you are interested:


http://pastebin.com/HZ9JbfpR


Now I am hooked to make more summoner enemies and bee hives! 😀
We make a good team. I do basically nothing and you make everything happen. What a great team we make.

P.S. love the bee hive idea.

Next we need to work on integrating a move-route script into the ABS to make enemies more interesting.
I already made some basic conditional move route script calls in my Enemy AI script. 😀


But getting a pathfinder script and using some of the options from that would be the best thing to do. The only thing that bothers me in this is the performance loss from the pathfinder script.


I imagine Source's Pathfinder (Invenio, or how it's called) could work. People say it's faster than any other pathfinder.


And no, you actually do something. You show me interesting scripts (like this one) I can play with! 😛
Sure thing. The one I use the most is Galv's Move Route, which I find to be a real work of genius. As you noted, Event Tuning has some pretty serious issues with Falcao's ABS, I fixed one of them myself with my brothers help because I needed the "shake" command for something.

Galv's move route let's us create more interesting enemies, because, let's face it, the ABS is really just hack and slash, not much thought goes into it. So, I can make enemies jump around and activate events and be more interesting in general. He has commands that let you move an event to a specific coordinate, or even jump on the player. One reason I like jumping to the player is that it allows the enemies to do cool, scary moves. So for example, in my game, the last boss will grab a torch and start doing a flamerthrower type attack, and its scary as hell because he just jumps right to the player after sound effect is played* and starts breathing fire. Well, this brings me to my original comment. The Move Route script wasn't intended as an add-on for Falcao, obviously... so the move route script has the event jump on the tile that the player is on, which creates an issue, that is, players and enemy attacks won't affect squares they are on. So the makeshift fix is that you add in a "1 step backward" and "turn toward player" right before the attack and it looks pretty decent. But if we had an integrated move route script we could tell the event to jump 1 tile away from the player (provided that tile is a valid place for the event to be in the first place, i.e., not a "blocked" tile, or maybe some other designation.) This is just one example of how an integrated move route script would help us create more interesting enemies.

Another way to make more interesting enemies would be to give the enemies actual AI, so they will guard automatically when the player attacks them, etc.. stuff like that, but that's a ways away, I think. Tell me what you think, and what else I can add. I have tons of ideas, pages written down, regarding this, but this is not the place, I suppose.

*I use sound effects right before attacks to let the player know whats going to happen, so for example, before an enemy uses a bow attack, I play the "bow winding up" sound effect from the RTP to let them know that they should be ready to block, but it's fast too, so not too easy..
@Sixth I was messing with the spawners and I notice, no matter what, after a minute or so, the FPS drops massively. Is there some threshold I should know about? I had no spawn events, each making a skeleton every 5 seconds or so, and after a minute (I was killing the spawns as they came out) the FPS dropped to 22fps. Do the bodies 'pile up' so to speak?

Ahh yes, if the player doesn't have a spawn life setup, it will cause major lag. Any way to make it so when the event dies it gets disposed?
Yeah, the more events are spawned, the more performance it will cost.


Getting rid of the events entirely can cause more issues too, although I never tested it.


One thing will surely be impossible, and that is to revive the killed events.


I am setting up my spawners so the more they spawn, the more time needs to pass for the next spawn. This way, sooner or later (depends on the length of delay), the spawning will slow down to a point where no sane player will wait for the next one, and will move on to some other areas. 😀


I will see if I can manage to get rid of the events permanently, although I have no idea when will I get to it.
Well, getting rid of them permanently is already in the script, right? That's the <spawnlife x> tag?

That's interestingm how did you set yours up to increase their life like that? Or is it a secret? 😛
It's a built in function. You can manipulate your spawner events with comments.

Here is what I used for a bee hive:

Spoiler
<spawn-id 22X><spawn-timer 60><spawn-pos random:2><spawn-sswitch B><spawn-max 5> <spawn-anim 214><spawn-type loop> <spawn-common-event 3>
This will let the event only spawn 5 events at max. The starting spawn delay is 1 second.

At every spawning, it will call common event 3. That common event will add the extra delay time after each spawn.

The common event looks like this:

Spoiler
Show Animation >> [Spawner], [Animation] # Just an animation which will be player on the spawner each time it spawns.Script >> @fiber.spawner.options[:timer] += 20 # This will add 20 frames to the spawn delay after each spawning. Cumulative effect!
So, after the first spawn, it will need 80 frames until it can spawn again, after the 2nd spawn, it will need 100 frames to spawn again, and so on.

And you can control many other things within these common events for the spawners.

Information about these spawner specific script calls can be found in Kal's script.

The spawnlife tag erases the event, but that is not complete deletion. It is still on the map, just inactive.

But there may be another reason why you get that much FPS drop. By default, the enemy sensor self-switches are still working, even if the enemy is dead.

So, it will keep on with switching them on and off if you are in range/out of range of the enemy. And each time it toggles a switch, the map is refreshed.

I changed this, so only alive enemies can toggle their self-switches, dead ones can't. Will search for the code to do this, I forgot where I edited the ABS for this.
As usual, thank you^^

Original thread: https://forums.rpgmakerweb.com/threads/kals-event-spawner-issue-with-using-and-in-event-name.44371/