• 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.

Creep revival system not working

Status
Not open for further replies.
Level 3
Joined
Aug 20, 2012
Messages
36
Ok, This stopped working after I made my map 480x480. Does anyone have a solution?

  • Creep Revival System
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set NCGroup = (Units in (Playable map area) owned by Neutral Hostile)
      • Unit Group - Pick every unit in NCGroup and do (Actions)
        • Loop - Actions
          • Set Integer = (Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Integer
          • Custom script: set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
          • Custom script: set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
      • Custom script: call DestroyGroup(udg_NCGroup)
  • Reviving Creeps
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    • Actions
      • Wait 40.00 game-time seconds
      • Set CreepRevival[1] = (Center of (Entire map))
      • Set CreepRevival[2] = (CreepRevival[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at CreepRevival[2] facing (Random angle) degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
      • Custom script: call RemoveLocation(udg_CreepRevival[1])
      • Custom script: call RemoveLocation(udg_CreepRevival[2])
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You really don't need 2 locations for this. You can use "Conversion - Convert coordinates to point" and then select Creep_X and Creep_Y there.
That probably won't fix it though :/

Maybe it has something to do with locations, you could try
JASS:
set bj_lastCreatedUnit = CreateUnit( Player(12), GetUnitTypeId( GetTriggerUnit() ), udg_Creep_X[GetUnitUserData( GetTriggerUnit() )], udg_Creep_Y[GetUnitUserData( GetTriggerUnit() )], GetRandomReal( 0., 360. ) )
Remove all actions in the second trigger except for the wait and "Set the custom value of unit (...)" and put that in a custom script right after the wait.
It will do everything you did, but without the use of any locations.

Another thing you can do is check where it went wrong via debug messages (check if the coordinates are correct, check if the coordinates of the points are correct, that kinda stuff).


Edit: I'll just leave this bit of info here: never use arrays if you don't actually need them. It is better to use 3 different location-variables than 1 arrayed variable.
 
Level 3
Joined
Aug 20, 2012
Messages
36
It works now, good theory rulerofiron but the script he sent me made everything work. But I dont see why it says player 12 in the script?
 
Level 3
Joined
Aug 20, 2012
Messages
36
I made a new map (480x480) and tried my old system, it didnt work there either, any ideas what's causing this and how will it affect the making of my map?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It works now, good theory rulerofiron but the script he sent me made everything work. But I dont see why it says player 12 in the script?
Player(12) equals the 13th player in GUI, which is Neutral Hostile. (JASS players start from Player(0), which is red, while GUI starts from Player 1).
You can replace that number with anything that suits your purposes now you know how to change it :).

I made a new map (480x480) and tried my old system, it didnt work there either, any ideas what's causing this and how will it affect the making of my map?
Since Warcraft maps aren't supposed to be of size 480x480, I'm going to assume that this messes up the locations (which could be bound between certain numbers).

My theory is that the coordinates that can be stored in a location should be between -2^14 and 2^14 (which would effectively be a 256x256-sized map).
Anything higher than that could result in errors.
This is only a theory and I did not test this (yet), though I may soon :)
 
Level 9
Joined
Jul 10, 2011
Messages
562
Hey Fralexxelarf :D


because i dont have the time to think whats wrong in your system ill show you mine which is working perfectly ona map with 320 x 192 size (no laggs, no fps drop, no bugs, glitches, whatever ^^). maybe it helps so you can fix yours ;D

  • Creep Save
    • Events
      • Time - Elapsed game time is 0.20 seconds
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Entire map) matching ((Owner of (Matching unit)) (==) Neutral Hostile))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set CreepInteger = (CreepInteger + 1)
          • Unit - Set the custom value of (Picked unit) to CreepInteger
          • Set Creep[CreepInteger] = (Picked unit)
          • Set CreepPosition[CreepInteger] = (Position of (Picked unit))
          • Set CreepUnitType[CreepInteger] = (Unit-type of (Picked unit))
          • Set CreepFacingAngle[CreepInteger] = (Facing of (Picked unit))
  • creep revive
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to CreepInteger, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (Dying unit) (==) Creep[(Integer A)]
            • 'THEN'-Actions
              • Wait 90.00 seconds
              • Unit - Create 1 CreepUnitType[(Custom value of (Triggering unit))] for Neutral Hostile at CreepPosition[(Custom value of (Triggering unit))] facing CreepFacingAngle[(Custom value of (Triggering unit))] degrees
              • Set Creep[(Custom value of (Triggering unit))] = (Last created unit)
              • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
            • 'ELSE'-Actions
 
Status
Not open for further replies.
Top