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

Respawning in a different way...

Recommended Posts

I've designed a set of maps in hub-style fashion... different areas you can traverse freely, kind of like a typical RPG game world. Of course, everything is saved when you teleport between maps, which is great for most things (such as pickups and whatnot), but what would be good is if monsters could respawn at their original locations if you leave the map and come back to it. Any idea how to pull this off? :) I don't want them to respawn in the middle of playing the map, and I don't want them to respawn where they were killed. Is this possible when doing it hub-style? I'm using ACS so if it's something that has to be scripted, then that's fine.

Share this post

Link to post

Gee, can they spawn tagged map spots when they die? If so, maybe all map spots with a tag of 1 could spawn imps where the old imp died, and the spawn script could be activated when you reenter the map.

Share this post

Link to post

The thing is... I don't want them to respawn where they died... I want them to respawn where they were originally placed.

I was thinking about having spawn spots, and having the script spawn all the enemies when it loads. Ran into a minor problem with that though... when an enemy dies, it should execute a script function (Thing Action 80). Originally, I tried setting that in DECORATE... if you set map for 0, it's supposed to just use the current script. That didn't work, however, so I set the Thing Action instead.

Well, I suppose since ACS_Execute(200,0,0,0,0) didn't work in the DECORATE, I guess I could always use inheritance to make variations of the enemies by changing their Death states' ACS_Execute line for the map number they're a part of... that, plus the spawn-on-entry idea might get the job done. And since none of the enemies are leaving corpses, it should work out alright... it'll just be a lot of scripting.

Share this post

Link to post

OK so here's what I did, and so far it's working out alright...

-I created a MapSpot on the map for where I'd like an enemy to appear. Easy enough.
-I created an ENTER script that contains SpawnSpot and Thing_SetSpecial lines to set up the enemies.
-Since this only works once, I copied the function as a RETURN script to make them reappear.
-I set up a script for leaving the map which involves using Thing_Remove to get rid of every spawned enemy.

This works quite well so far. The only thing I noticed is that the monster count increases for each successful spawn. Right now, I just have one spawn. I enter the map and kill it, then leave the map and come back in. The enemy is respawned, but now the total monster count increases. If I enter the map but leave without killing the spawned enemy, coming back does not increment the total monster count. It's not a huge deal, but it would be nice to have that also reset to normal.

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