Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Zom-B

Dynamically placing enemies

Recommended Posts

I'm trying to write a script to dynamically place hundreds of enemies, where the types and counts of enemies are predetermined by the designer, me. The level consists of a giant arena and a starting area. In the starting area, the user selects which battle to fight. The arena consists of a couple thousand map spots, all with a unique tag.

The problems come with the script. I made a large array of about 300 Int values (about 10% of what I planned to put there), but as I continued coding, at a certain point the acc.exe compiler crashed, and/or generated weird unjustified error messages. I traced the problem to a possible buffer overflow problem inside acc.exe, as, when I take the still working code, and place a long comment line somewhere, it starts behaving weird. This is strange as I've seen far larger scripts that still compile.

For my second try, I placed groups of template enemies on the map outside the sectors, and wanted to make the script scan each of the enemies (by id) and spawn a similar one in the arena. This didn't work as the only suitable ACS function, CheckActorClass, can find type of monster of a thing only by tag, not by id. (the groups of template enemies have no tags)

Does anyone know of an alternative way of generating groups of enemies on command, where the type and counts of monsters is predetermined (ie. not calculated on the fly) ?

Share this post


Link to post

Third try, I split the code into two files using libraries, and this makes acc.exe hang with 100% cpu. Removing more code from the main script makes acc crash again, so this actually made it worse.

Share this post


Link to post

Ok, I found the reason my first try didn't work. I made a programming error, an error the compiler didn't catch. I debugged the source code of acc.exe and found and fixed the bug.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×