• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need a special respawn system...

Status
Not open for further replies.
Level 7
Joined
Apr 7, 2009
Messages
241
I need a respawn system that revives the dead creeps at their spawn point and not like the one I have which creates a new creep of the same type at the spawn point. Why? Because I want the creeps to keep their loot tables after respawn and if I keep creating new creeps of the same type as a respawn-method then the creeps will only drop loot on first kill and then the new creeps wont have a loot table at all.

Would be very grateful if anyone knew a good respawn system :con:
 
Level 7
Joined
Apr 7, 2009
Messages
241
Try using a Unit Recycle system instead. That may work out pretty well. I can't remember which use them, but basically how they work is when the unit dies it's stored in a GameCache and revived when you need it. I think that's how it works, at least.

Sounds cool :)

Would be good if you could post me a link to one, can you?
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
Sure, I'll find one. I know I've seen a few. I'll post a link on this post when I find one. A lot of damage detection systems use them.

EDIT: Anyone able to help me? I know these systems exist, but I can't seem to find them. I've seen them supported in GUI triggers too, there's a Unit - Revive Unit before.

http://www.wc3c.net/showthread.php?t=101600

Found one.
 
Last edited:
Level 7
Joined
Apr 7, 2009
Messages
241
Sure, I'll find one. I know I've seen a few. I'll post a link on this post when I find one. A lot of damage detection systems use them.

EDIT: Anyone able to help me? I know these systems exist, but I can't seem to find them. I've seen them supported in GUI triggers too, there's a Unit - Revive Unit before.

http://www.wc3c.net/showthread.php?t=101600

Found one.

Thanks mate, but this isnt a respawn system or is it? Also it seems the system seems to have kinda negative comments on it.

I tried but failed to get it into my map :p

PS. Is it really that complicated to get the creeps to keep their loot tables? I thought I could just do a simple tweak on my current system or something.
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
"Why is this system convenient?

because the game won't need to allocate memory creating units, instead, they'll be backed up for a later use, which can improve your map performance. This can be very useful in maps where the unit spawning is a very common task (like AoS, footies, etc)."

Unfortunately I've never used this system, but it seems perfect for what you're trying to do. The documentation explains what you need to do to get it to work. If you're use to GUI I'm sure you could use Custom Scripts and get it to work easily.

You're going to want to combine it with a really simple respawn system. Perhaps one you create yourself. It should be pretty simple.

You might be able to set all the units onto the map and assign them a loot table. Then respawn them at the designated spawn point a designated time after they die. I'm afraid I haven't ever made a respawn system like that of an AoS or RPG.
 
Level 7
Joined
Apr 7, 2009
Messages
241
"Why is this system convenient?

because the game won't need to allocate memory creating units, instead, they'll be backed up for a later use, which can improve your map performance. This can be very useful in maps where the unit spawning is a very common task (like AoS, footies, etc)."

Unfortunately I've never used this system, but it seems perfect for what you're trying to do. The documentation explains what you need to do to get it to work. If you're use to GUI I'm sure you could use Custom Scripts and get it to work easily.

You're going to want to combine it with a really simple respawn system. Perhaps one you create yourself. It should be pretty simple.

You might be able to set all the units onto the map and assign them a loot table. Then respawn them at the designated spawn point a designated time after they die. I'm afraid I haven't ever made a respawn system like that of an AoS or RPG.

This is the respawn system I use now:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/creep-respawn-gui-65987/

you think it'll work with that unitrecycler?

Also, I am kinda lost on how to "install" the unitrecycler. I create a trigger, convert it to custom text and then paste everything in "core library" and it dosnt work, just alot of error :p

Sorry if I am a little noobish and thanks for taking your time with me
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
I'm sure it will, but you'll need JNGP to get it to work first.

Seems the easiest way to do it would be to remove this

[GUI]Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at Creep_Point[(Custom value of (Triggering unit))] facing Default building facing (270.0) degrees[/GUI]

And replace it with Custom Script, using the one from the system:

CreateUnitEx(player, unitid, x, y, angle) returns unit

So the unitid is the same one of the triggering unit's UnitID, the Player is Player(13), X and Y will be the X and Y of the Point Array saved in globals. Angle is 270. Easy nuff.

If you don't think you can do it I'll look at the two systems a little more and see if I can't create the custom script for you.
 
Level 7
Joined
Apr 7, 2009
Messages
241
I'm sure it will, but you'll need JNGP to get it to work first.

Seems the easiest way to do it would be to remove this

[GUI]Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at Creep_Point[(Custom value of (Triggering unit))] facing Default building facing (270.0) degrees[/GUI]

And replace it with Custom Script, using the one from the system:

CreateUnitEx(player, unitid, x, y, angle) returns unit

So the unitid is the same one of the triggering unit's UnitID, the Player is Player(13), X and Y will be the X and Y of the Point Array saved in globals. Angle is 270. Easy nuff.

If you don't think you can do it I'll look at the two systems a little more and see if I can't create the custom script for you.

So I am supposed to replace
  • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at Creep_Point[(Custom value of (Triggering unit))] facing Default building facing (270.0) degrees
with
CreateUnitEx(player, unitid, x, y, angle) returns unit

I dont get it, am I to fill in a specific unitid? because it the unitid is ofc different for each creep and the x and y will also always be different for each creep :S

Maybe you should create the script :bored:
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
That seems kind of easier imo. If Unit of Type Dies, then Set RandomInteger = Math - Random Integer(1,100).

If RandomInteger < 5 then create item at position, triggering unit's location.

That would be easier. Especially in the long run. You won't be creating a ton of loot tables, and you won't have to use the recycler. Instad it'll all be programmed for one single unit.

But for your custom script, it's similar to GUI

UnitID is the rawcode of the unit, contained in ' '. However JASS allows you to find the UnitID of the triggering unit with a simple GetUnitTypeId(GetTriggerUnit) Player is Player(12). GetLocationX(udg_Creep_Point[GetUnitPointValue(GetTriggerUnit())]) and GetUnitY(udg_Creep_Point[GetUnitPointValue(GetTriggerUnit())]) will be your X and Y respectively. And facing is of course 270.

The udg_Creep_Point is the global Point Array variable, and the thing contained in the brackets [] is the Custom Value of the Triggering Unit (I think).

Hopefully this helps you.

CreateUnitEx( Player(12), GetUnitTypeId(GetTriggerUnit(), GetLocationX(udg_Creep_Point[GetUnitPointValue(GetTriggerUnit())]), GetUnitY(udg_Creep_Point[GetUnitPointValue(GetTriggerUnit())]), 270.00)

That up there would be your end result. You'll want to set that to a variable though. If you're comfortable with local variables and custom script, do local unit U = CreateUnitEx( etc... )

If you're not, than creae a Unit Global Variable and do set udg_VariablesName = CreateUnitEx( etc... )

Then just either use JASS Code instead of Last Created Unit, and set the value to U for if you do local variables. Otherwise just do the global variable you created.

This is necessary because the CreateUnit in JASS doesn't leave a leaking unit variable for Last Created Unit to refer to.

K good luck! If you need more help just ask.
 
Status
Not open for further replies.
Top