Creep Revival Trigger Issues.

Dridien

New Member
Reaction score
0
Alright, im trying to get a respawn trigger for an AoS that will respawn any pre-placed units where they were originally. it also has to be able to last longer than the decay time (edited to 30 seconds. respawn needs to be ~10-15 minutes) and spawn them for their original owner, not just neutral hostile.

After hours of trying it for myself and searching through tutorials and such, ive got it working... mostly.

The first few times the unit dies it works perfectly, but than just stops working for no explainable reason.

Here's what I've got so far.

This is run on Map Initiation with my, well, Initiation trigger.
Trigger:
  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Triggering unit) is A structure) Equal to (==) False) and (((Triggering unit) is A Hero) Equal to (==) False))) and do (Actions)
    • Loop - Actions
      • Set Revive_Int = (Revive_Int + 1)
      • Unit - Set the custom value of (Picked unit) to Revive_Int
      • Set Revive_Unit[Revive_Int] = (Picked unit)
      • Set Revive_Player[Revive_Int] = (Owner of Revive_Unit[Revive_Int])
      • Custom script: set udg_Revive_X[udg_Revive_Int] = GetUnitX(GetEnumUnit())
      • Custom script: set udg_Revive_Y[udg_Revive_Int] = GetUnitY(GetEnumUnit())


Than for the actual revive trigger i have

JASS:
function Trig_Creep_Revive_Copy_Conditions takes nothing returns boolean
    if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Creep_Revive_Copy_Actions takes nothing returns nothing
    local integer Revive_Custom
    set Revive_Custom = GetUnitUserData(GetTriggerUnit())
    call TriggerSleepAction( 10.00 )
    set udg_TempPoint1 = GetRectCenter(GetEntireMapRect())
    set udg_TempPoint2 = OffsetLocation(udg_TempPoint1, udg_Revive_X[Revive_Custom], udg_Revive_Y[Revive_Custom])
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(udg_Revive_Unit[Revive_Custom]), udg_Revive_Player[Revive_Custom], udg_TempPoint2, GetRandomReal(0, 360.00) )
    call SetUnitUserData( GetLastCreatedUnit(), Revive_Custom )
    call RemoveLocation (udg_TempPoint1)
    call RemoveLocation (udg_TempPoint2)
endfunction

//===========================================================================
function InitTrig_Creep_Revive_Copy takes nothing returns nothing
    set gg_trg_Creep_Revive_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Creep_Revive_Copy, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Creep_Revive_Copy, Condition( function Trig_Creep_Revive_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Creep_Revive_Copy, function Trig_Creep_Revive_Copy_Actions )
endfunction


I know almost nothing of jass, so the above trigger is 98% done in GUI than just converted. i than just made Revive_Custom a local.

Heres the GUI version of that
Trigger:
  • Creep Revive
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Custom value of (Dying unit)) Greater than (>) 0
    • Actions
      • Set Revive_Custom = (Custom value of (Triggering unit))
      • Wait 10.00 seconds
      • Set TempPoint1 = (Center of (Entire map))
      • Set TempPoint2 = (TempPoint1 offset by (Revive_X[Revive_Custom], Revive_Y[Revive_Custom]))
      • Unit - Create 1 (Unit-type of Revive_Unit[Revive_Custom]) for Revive_Player[Revive_Custom] at TempPoint2 facing (Random real number between 0.00 and 360.00) degrees
      • Unit - Set the custom value of (Last created unit) to Revive_Custom
      • Custom script: call RemoveLocation (udg_TempPoint1)
      • Custom script: call RemoveLocation (udg_TempPoint2)


I have no idea whats wrong with it, to me it all seems perfect... but it just stops reviving certain units after a few deaths. also the 10 second respawn is only set like that for testing... cuz im not waiting 10-15 mins each test to see if it works :p
 
Code:
Creep Revive
    Events
        Unit - A unit Dies
    Conditions
        (Custom value of (Dying unit)) Greater than (>) 0
    Actions
        Wait 10.00 seconds
        [B]Set Revive_Custom = (Custom value of (Triggering unit))[/B]
        Set TempPoint1 = (Center of (Entire map))
        Set TempPoint2 = (TempPoint1 offset by (Revive_X[Revive_Custom], Revive_Y[Revive_Custom]))
        Unit - Create 1 (Unit-type of Revive_Unit[Revive_Custom]) for Revive_Player[Revive_Custom] at TempPoint2 facing (Random real number between 0.00 and 360.00) degrees
        Unit - Set the custom value of (Last created unit) to Revive_Custom
        Custom script:   call RemoveLocation (udg_TempPoint1)
        Custom script:   call RemoveLocation (udg_TempPoint2)

Just change the above. Retain the use of GUI. It's still MUI. (Your JASS version has something wrong regarding your local integer. There should be a udg_ prefix for the variable) Anyway, remove the JASS code and use the GUI instead.
 
Thank you for pointing out that it works in GUI form, but the same thing seems to happen even with the GUI trigger... i just understand what I'm doing a little more since its not Jass anymore :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top