Jump to content

managing waves of enemies


Deleted800173User

Recommended Posts

I'm looking to create a script to handle the spawning of waves of enemies but I have a few issues I want to handle before I start. They are as follows:

 

1 - need to find a syntax to spawn new characters (solved)

(I'm considering using something like this

newEnemy = enemyReference.PlaceAtMe(Form akFormToPlace, int aiCount)

Is there a better way to do this?)

 

2 - need to have a good system for deleting the newly spawned monsters(solved)

(Currently I think I will simply mark enemies for delete after they die.)

 

3 - need to disable enemies upon death.(solved)

(I think I will simply have a periodic check every 5 seconds and if an enemy is dead, disable it and mark it for delete)

 

4 - need to have newly spawned enemies immediately engage the player (or his/her companion) in combat. (This is my current issue)

(not sure what syntax to use for this)

 

Any advice or ideas on how to manage large waves of enemies would be very much appreciated!

 

(Please scroll to my last post to see where I'm at.)

Edited by Guest
Link to comment
Share on other sites

Hey guys, just an update/bump. I'v been able to spawn multiple enemies now and manage waves of them. The script works really well and even deletes all spawned npcs to prevent save bloating. My only current issue is that the spawns don't want to continue combat with the player if he/she is too far away. I've checked the navmeshing and I can get the npcs to follow the player into the center of the room, as long as I go near them to have them follow me.

 

Is there a way I can either: (A) have npcs continue combat and walk over to the player to fight him/her. or (B) give the npcs patrol routes using the script so that they are likely to run into the player while he/she is fighting off other waves?

Edited by Guest
Link to comment
Share on other sites

Still looking for advice from anyone who has some.

Currently I'v noticed that default draugr(the npcs im using) have an AI package that allows them to patrol if they have a linked reference to a patrol point. My theory then is to find some syntax to give a spawned draugr a linked reference using code, and then have the spawn evaluate its package again using "spawnRef.evaluatePackage()"

Does anyone know how to give a npc a linked reference using code?

Link to comment
Share on other sites

Korodic I've already tried that. I went ahead and double checked and the enemies will drop from combat if they cannot see the player. I've even tried to periodically place them back in combat but that doesn't work either. They will just sort of walk around a bit closer to the player and then drop combat every few seconds.
Link to comment
Share on other sites

im using draugr and are they not automatically set to aggressive? The area I'm using is fairly wide and it takes the spawns a while to get to the player, and the draugr usually drop combat before reaching the player.

 

P.S. I've further refined the navmeshing and retested but with no luck. It could be the fact that I'm using a more organic cave setting and thus moving through cave floors is difficult?

Edited by Guest
Link to comment
Share on other sites

That would require to give them a package which means I would have to alter the vanilla object or make a new one of that monster. I am hoping to avoid both of those to make my mod work well with other mods.

 

However there IS a package that's already on the draugr for patrol routes. In theory I could have it patrol over to the player, or even just patrol the room. The problem is that this package does not evaluate unless the draugr has a linked ref (AKA a patrol point). This is simple to do in the creation kit, but to give them a linked ref in game requires script (if it's possible)

Edited by Guest
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...