• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

resetting an instance

Status
Not open for further replies.
Level 8
Joined
Dec 29, 2006
Messages
359
Ok, this map of mine has three differant instances, each of which will be able to be reset (all creeps reset, gates and elevators closed/raised, and all keys replaced) by typing -reset <instance name>. But i cant find a way to

1: make sure the player is outside of the instance when they type it (so they cant just keep resetting to kill the same boss over and over again) and

2: Check to see if the instance has been affected in any way, remove any creeps that have been pulled and not return to their original location because of some unforseen reason, if the instance has had any gates opened or any elevators raised, and if all of these have not happened, then stop the trigger from firing, and have it say something like, "That instance has not been altered, and does not need to be reset!".

Thanks in advance to anyone who replies!
 
Level 11
Joined
Aug 25, 2006
Messages
971
1. To determine if they're in the instance, set a unit group variable to all the player owned (not creep owned) units inside the Region(rect) of the instance. Then do an integer comparison, and find something thats like Count - Count units in group. If that count is equal to zero, then they're not in the instance. If its greater then zero, then obviously someone is still there.

2. This is rather complicated. To make it simpler, drop the part where it doesn't reset the instance. Its too much extra work just for an error message. Instead just reset the instance. Anyway, mainly you need to store the location and type of every unit in a large array. Remove all the creeps, then rebuild them from the array.
 
Level 8
Joined
Dec 29, 2006
Messages
359
Ok, it worked for the most part, but im still running into a problem. Lets say i have 1 hero, and i go into the instance and try to kill a mob, but they overpower me so i run out, perhaps they follow me to a point where a gate closes behind me, making it impossible for them to return to their original position. When the instance is reset, im stuck with an extra mob in the middle of the instance, any ideas on how to fix this?
 
Level 11
Joined
Aug 25, 2006
Messages
971
Personally, in the rpg me and my friends are working on, the instances are self contained. Meaning you teleport into them. Once inside, theres only two ways out, death, or the termination of the final boss.
 
Level 8
Joined
Dec 29, 2006
Messages
359
ok, lets say you die, and head back into the instance? what happens, does it let you continue on from where you died? All pre-killed mobs and bosses stay killed and whatnot? Or does it reset upon re-entry?
 
Level 11
Joined
Aug 25, 2006
Messages
971
ok, lets say you die, and head back into the instance? what happens, does it let you continue on from where you died? All pre-killed mobs and bosses stay killed and whatnot? Or does it reset upon re-entry?
Once the party is dead or has defeated the boss, the dungeon is reset. If say one party member dies, but the others forge on, the dead party member won't be able to revive and re-enter the dungeon. (In other words the teleporter is closed while someone is in the dungeon)

BTW, the above idea is pretty good for your type of dungeon.
 
Level 8
Joined
Dec 29, 2006
Messages
359
ya it works pretty good, and eliminates the hassle of having to make a trigger for the reset command since it resets when you win or die.
Rep for you both!
 
Status
Not open for further replies.
Top