HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creep Respawn System

01-16-2006, 03:27 PM#1
johnfn
Does exactly what it says, it isn't too complicated or anything. I might add a few more things at a later date but for now it's simple and gets the job done.


Hope it helps someone
Attached Images
File type: jpgcreep respawn img.JPG (8.7 KB)
Attached Files
File type: w3mCreep Respawning.w3m (16.7 KB)
01-16-2006, 04:00 PM#2
Whitehorn
So, it does nothing?
01-16-2006, 04:24 PM#3
johnfn
No, it respawns dead creeps in their original position and is flexible enough to deal with all creeps that appear on the map when the map begins (that is, up to 8192 of them)

It's also very short and very easy to implement.
01-16-2006, 04:45 PM#4
Whitehorn
It was a hint to say that in your first post :)
01-16-2006, 04:53 PM#5
Blade.dk
I checked your system:

It has memory leaks, that you will need to fix:

In the JASS trigger, you need to set the p and g local variables to null at the end of the function, to prevent those simple leaks.

Trigger:
For each (Integer A) from 1 to (Number of units in (Units owned by Neutral Hostile)), do (Actions)

Units owned by neutral hostile returns a unit group that will leak each time, the trigger executes. Please fix.

Also, most likely it will cause problems if you have too many units (and this can happen with just about 500 units or something like this) because of thread crashes. I would suggest you to use the units custom values to save their numbers, that way you could avoid having a limit at all, and prevent thread crashes.

This is, like you said, very simple, and would thefore fit the samples section better than systems, but if it shall be there, it needs very detailed commenting, so it can be used, not only as a system, but also to learn from.

Last thing: Please level up the Hero in another trigger that is not a part of the actual system, some people might not know how to remove that line and will thereby get problems when implementing.
01-16-2006, 05:30 PM#6
emjlr3
there is an easier way of doing this, and better may I add, check the dota template
01-17-2006, 01:23 AM#7
johnfn
Whitehorn: I said what it did in the title, then later realized that I probably didn't make it clear enough but before I could update the post you posted ;)

Blade.dk : Whoa. Thanks a lot. That custom value thing is genuis... I'll get right on it :D

emjlr3: Hm. Im surprised it could be easier since this isn't more then 5 lines (well maybe a little more) but I'll check it out.
01-17-2006, 08:44 PM#8
Jacek
What this stuff does?
01-17-2006, 10:09 PM#9
johnfn
It respawns creeps simply and easily.

By the way, here's the upgraded creep system with Blade.dk's suggestions, it's much nicer now (not much difference will be noticed when you use it, except there should be no memory leaks and that it can deal with as many units as WC3's graphic engine can handle )

By the way, thanks for all the suggestions and stuff so far.
01-18-2006, 09:29 AM#10
Blade.dk
Thanks for fixing it, approved (I also updated the attachment in the first post so the new one is there, to make things easier).

By the way

Collapse JASS:
    set eachUnit = 0 //gets rid of memory leaks, don't need to set p to null because it already is null
                //I THINK this gets rid of the leak but wouldn't guarentee it, I can't set it to null because I get a bug so I did the next best thing

You don't have to said that to null at all, and it isn't possible as you said. Integers doesn't need to be set to null, they doesn't leak.

The group variable leaks though, the group itself is destroyed, but better add this line "set g = null", to fix that leak, even though it is small :).
01-19-2006, 04:21 PM#11
Jacek
I prefer to revive creeps with Reincarnation.
01-22-2006, 08:09 AM#12
Das Jank
Reincarnation is worthless though becuase if the creep chases after someone then it will respawn where it dies, johnfn's script makes it so that the creep respawns at the original place you put it on the map, not to mention you wont have to add reincarnation to every creep you want to place on the map.

Huge props Johnfn, im sure ill be using this is the future.
02-06-2006, 10:42 PM#13
Murder1833
I tried implamenting it, but when I save, it disables the triggers due to "Expected a variable name"

Line 257
and
Line 258
02-07-2006, 08:55 PM#14
Freakazoid
I'll post my system from SoV,..
02-08-2006, 12:59 AM#15
Linera
Nice, I'd use it but my RPG can't use it due to the way its made.

In my RPG each mob is a hero, and each mob has a different respawn time.
Plus when it respawns it randomly picks a level between 2 numbers for that mob, like one mob maybe between lvls 1-5 while another is 50-60.