• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Creep spawn problem

Status
Not open for further replies.
Level 3
Joined
Nov 7, 2006
Messages
36
I got a small problem, its about a creep respawn.
It looks like this:

Events: Unit - A unit Dies
Conditions: (Owner of (triggering unit)) Equal to Neutral Hostile
Actions: Wait 300.00 seconds
Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral hostile at (position of (Triggering unit)) facing Defualt bulding facing degrees

The problem is that the creeps dont respawn, but if i remove the "wait action" it works!

Can someone tell me what I should do to make it work?
 
Level 8
Joined
Feb 20, 2007
Messages
338
I noted that in earlier work as well. What I did was increase the lifespan of corpses/bones.

I'm uncertain if the computer wipes out the point of a corpse after the corpse decays to zero or not, I assume that this is the case.

What I use is something like this:
  • Creep Respaen
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
    • Actions
      • Wait 60.00 seconds
      • If ((Number of units in (Units within 250.00 of (Center of (Rect centered at (Position of (Dying unit)) with size (20.00, 20.00))) matching (((Matching unit) belongs to an enemy of Neutral Extra) Equal to True))) Equal to 0) then do (Unit - Replace (Dying unit) with a (Random level ((Hero level of (Triggering unit)) + (Random integer number between 1 and 10)) creep unit-type) using The new unit's max life and mana) else do (Do nothing)
      • Point - Remove (Position of (Dying unit))
      • Point - Remove (Position of (Last replaced unit))
The point commands are a product of World Editor Unlimited. Points as you may know create lag if they are not removed. The more points the more lag. There are other methods to remove points discussed elsewhere.

The If ((Number.... command (it is one line in the editor) gives a lot more functionaly. 'The Units within 250 (center of...' part prevents a respawn of creeps around heroes and built units. I used a random unit 1-10 in this instance you can do it with a matching unit.

Note the delay is 60 seconds. I am using pretty much a default 'Gameplay Constants' (Menu/Advanced/Gamplay constants) where the decay of bodies/bones can be set. Default is 88 seconds for bones, 30 seconds for structures.

I bet if you reduced your wait to 87 you will find that it suddenly works.
 
Status
Not open for further replies.
Top