Hi guys,
I'm using this system to make creeps respawn : Creep Respawn (GUI) and this one to make them wander : Wander everything works fine except respawned creeps don't wander, i searched for hours a way to do this but failed. I'm fairly new to JASS and Warcraft III mapping so i'm sorry if this is dumb.
Here is the code i use to make creeps wander at map init, as i said it works fine with pre-placed creeps but don't work anymore when they respawn
and the ones i use to make creeps respawn (Timber Wolf id is "n006")
I'm using this system to make creeps respawn : Creep Respawn (GUI) and this one to make them wander : Wander everything works fine except respawned creeps don't wander, i searched for hours a way to do this but failed. I'm fairly new to JASS and Warcraft III mapping so i'm sorry if this is dumb.
Here is the code i use to make creeps wander at map init, as i said it works fine with pre-placed creeps but don't work anymore when they respawn
JASS:
scope Demo initializer Init
private function Hostiles takes nothing returns boolean
local Wander wander = Wander.create(GetFilterUnit(), 300, 7.)
set wander.random = 3
set wander.order = "attack"
return false
endfunction
private function Init takes nothing returns nothing
call GroupEnumUnitsOfType(bj_lastCreatedGroup, UnitId2String('n006'), Filter(function Hostiles))
endfunction
endscope
and the ones i use to make creeps respawn (Timber Wolf id is "n006")
-
MRS init
-
Events
- Map initialization
- Conditions
-
Actions
- Set VariableSet MRS_Time = 90.00
-
Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
-
Loop - Actions
- Set VariableSet MRS_Integer = (MRS_Integer + 1)
- Unit - Set the custom value of (Picked unit) to MRS_Integer
- Set VariableSet MRS_Facing[MRS_Integer] = (Facing of (Picked unit))
- Set VariableSet MRS_Point[MRS_Integer] = (Position of (Picked unit))
-
Loop - Actions
-
Events
-
MRS update
-
Events
- Unit - A unit enters (Playable map area)
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Timber Wolf
- (Owner of (Triggering unit)) Equal to Neutral Hostile
-
Actions
- Set VariableSet MRS_Integer = (MRS_Integer + 1)
- Unit - Set the custom value of (Triggering unit) to MRS_Integer
- Set VariableSet MRS_Facing[MRS_Integer] = (Facing of (Triggering unit))
- Set VariableSet MRS_Point[MRS_Integer] = (Position of (Triggering unit))
-
Events
-
MRS update 2
-
Events
- Unit - A unit Dies
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Timber Wolf
- (Owner of (Triggering unit)) Equal to Neutral Hostile
- (Custom value of (Triggering unit)) Greater than 0
-
Actions
- Wait MRS_Time seconds
- Unit - Create 1 Timber Wolf for Neutral Hostile at MRS_Point[(Custom value of (Triggering unit))] facing MRS_Facing[(Custom value of (Triggering unit))] degrees
- Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
-
Events
Last edited: