spawn randomly? yes... you probably don't need a script for that, it could be handled by eventing.
help the player? .... yesssssss? ish?
I have a system in place, but it involves modifying the add_actor() function, and some other functions from the battle system, and also requires a specific cast of NPC-only actors, which must be managed separately.
and, it still needs polishing.
this is what I sketched, but then I doubled back and negated it because it didn't work as planned.
Spoiler
Code:
def add_actor(actor_id)
#### FIX THIS CRAP #######
#actor_data = $data_actors[actor_id].note.scan(/^summon/i)[0]
#if actor_data
# max_summon = GTBS.get_summon_instance_count(actor_id)
#end
#if self.summoned.collect{|a| a.id}.include?(actor_id)
# added = self.summoned.collect{|a| a.id == actor_id}.size
# @summoned.push(Game_Actor.new(actor_id).clone) if actor_data && (added <= (max_summon || 1))
#else
unless @actors[0,max_battle_members].include?(actor_id)
if @actors.size >= max_battle_members
@actors.insert(max_battle_members-1, actor_id).uniq!
else
@actors.push(actor_id)
end
end
#p @actors
#end
$game_player.refresh
$game_map.need_refresh = true
end
another attempt, with plain eventing, which didn't quite work either
this considers a number of actors which are *actors*, but *AI controlled*, so it has it's own separate system.
basically, if you want to limit the control over those NPCs, you'll have to come up with that limitation based on your battle system (mine, is AI)
around that, you create your cast of NPCs which you then call from the events of the map (which are simple sprites... the actual *actor* is only relevant during the battle), and include them in the battle before the battle actually begins (and, remove them afterwards, and update the map event based on the result of the battle)
if you will have control over those NPCs, you'll have to modify the add_actor function accordingly depending on how much control you want to give to the player. (as I tried initially, "summons" would be player-controlled as regular actors, but the enemy would also have summons of their own, so I had to improve that definition)