Respawn Problem.

lummerlars

Member
Reaction score
2
Ok im doing a Respawn Trigger.
My Respawn Trigger does a Action: Wait 60 seconds. But thats not what i want to do:
I want the respawn trigger to respawn every creeps equal to player 12, when the boss in the dungeon dies.
Like if the boss dies, then respawn every creeps equal to player 12. Not before.
It would be nice if some one could get up some ideas for the trigger:D
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
You can not revive a creep, what I would do is set the creeps to a unit type and point array as the they die.

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set Count = (Count + 1)
      • Set Unit_Type[Count] = (Unit-type of (Triggering unit))
      • Set Point[Count] = (Position of (Triggering unit))


Then do this.

Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - No unit Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Count, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Unit_Type[Count] for Player 12 (Brown) at Point[Count] facing Default building facing degrees
 

jackall

You can change this now in User CP.
Reaction score
37
why cant you revive creeps?
JASS:
function create takes nothing returns nothing
  local unit tU = GetTriggerUnit()
  local location dP = GetUnitLoc(tU)
  local location array cP
  local unit tcU
  local real rA = GetRandomReal(0, 360)
  local integer id = GetUnitTypeId(tU)
  local integer cV = GetUnitUserData(tU)
  if IsUnitType(tU,UNIT_TYPE_SUMMONED) != true and GetOwningPlayer(tU) == Player(12) then
    set cP[GetUnitUserData(tU)] = PolarProjectionBJ(dP,rA,rA)
    call TriggerSleepAction(10)
    set tcU = CreateUnit(Player(12),id,GetLocationX(cP[cV]),GetLocationY(cP[cV]),rA)
    call SetUnitUserData(tcU,cV)
//    call PanCameraToLocForPlayer(GetLocalPlayer(),cP[cV])
    call RemoveLocation(dP)
    call RemoveLocation(cP[cV])
  endif
endfunction

function InitTrig_Respawn takes nothing returns nothing
    set gg_trg_Respawn = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Respawn, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Respawn, function create )
endfunction

this is the trigger i use to respawn creeps
you could make a trigger that detects when the boss dies, sets the creeps' custom values to some value and then turn on this trigger for units inside the dungeon
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Cause you can only revive hero's. If a creeo dies it needs to be replaced with another creep of the same type, but the creep that died can never be revived.

Your trigger replaces the creep with another one of the same type.

Also the triggers I posted will work fine for him, and what is the point of posting almost the same trigger as I did in jass?
 

lummerlars

Member
Reaction score
2
Hey guys, im doing a Threat to get some help....
The thing is i want, Yearh to respawn Creeps, but anyone got an idea how to do the Dungeon Respawn System?
 

jomik

New Member
Reaction score
17
You can not revive a creep, what I would do is set the creeps to a unit type and point array as the they die.

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set Count = (Count + 1)
      • Set Unit_Type[Count] = (Unit-type of (Triggering unit))
      • Set Point[Count] = (Position of (Triggering unit))


Then do this.

Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - No unit Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Count, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Unit_Type[Count] for Player 12 (Brown) at Point[Count] facing Default building facing degrees

Dude, your code fails, you never clear the count, so at second run it'd spawn multiple of each :p
 

lummerlars

Member
Reaction score
2
Dude, your code fails, you never clear the count, so at second run it'd spawn multiple of each :p

Yearh your right, have just tested it, it doesn't work.
Jomik or anyone else, can you answer my question please?
How do i make a Dungeon like respawn system. It goes like this:
When the boss dies then revive all creeps in the Dungeon Area?
BTW: Would be nice, in GUI
rep+
 

jomik

New Member
Reaction score
17
Try something like, put the dungeon in a region, and when a unit in that region dies, add it to a hashtable or something, under the bosses key, and then revive all units in that hashtable when he dies? - Dunno if it can work like that? You can do arrays too. Make sure to clear it out though.
 

lummerlars

Member
Reaction score
2
Ok i have tried, And i cant make it work. Do you have any other guess? I think that there might be a problem in the Hashtable, maybe.
If you have any other ideas, please tell me:)
 

jomik

New Member
Reaction score
17
Show me what you tried :D

- send mig en pm med din msn hvis du vil, det er besværgeligt at hjælpe folk ordentligt her. Medmindre man skal debugge en trigger...
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Dude, your code fails, you never clear the count, so at second run it'd spawn multiple of each :p

The guy said he wants it ran when his boss dies, so I assumed it would run only once, then again I should have added in a condition where it dosen't record the boss dieing lol.

Ps the trigger does work, I tested it before I posted it and it revives all the creeps, if he wants it to run multiple times it is simple enought to add a set varible into the 2nd trigger.
 

LightChaosma

New Member
Reaction score
60
why not use dameon's trigger? it is fine as it is... just a small mistake...

Trigger:
  • Untitled Trigger 001
    • Events
    • Unit - A unit Dies
    • Conditions
    • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
    • Set Count = (Count + 1)
    • Set Unit_Type[Count] = (Unit-type of (Triggering unit))
    • Set Point[Count] = (Position of (Triggering unit))


is correct

Trigger:
  • Untitled Trigger 002
    • Events
    • Unit - No unit Dies
    • Conditions
    • Actions
    • For each (Integer A) from 1 to Count, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Unit_Type[(Integer A)] for Player 12 (Brown) at Point[(Integer A)] facing Default building facing degrees
      • set Unit_Type[(Integer A)] = no unit
      • Custom Script : call RemoveLocation (udg_Point[<something to call integer a wich i dont know >])
    • set count = 0


the main issue was that for each A he had count as index for his arrays, so it would creat count amount of unit_type[count] at point[count] ;)
 

lummerlars

Member
Reaction score
2
Ok you guys got some nice ideas.
I actually want to make it multiple. Like everytime your joining the dungeon, then theres some new creeps in there. Like it respawns the creeps everytime. And it should still be, when you kill the boss, then respawn every creeps
 

LightChaosma

New Member
Reaction score
60
i dont quitte get what you mean... so if a hero enters your dungeon, you want another few mobs to spawn?

or every mob simply revives after X seconds?
 

lummerlars

Member
Reaction score
2
i dont quitte get what you mean... so if a hero enters your dungeon, you want another few mobs to spawn?

or every mob simply revives after X seconds?

The idea is: There's a boss in the Dungeon. And also in the begining of the dungeon theres alot of creeps. When your done killing the Creeps, then you can head for the boss. When you kill the boss, it teleportes you to a award area. But at the time you get teleported, i want to make a trigger that, respawns the creeps you just killed, in the Dungeon.
Then when you rejoin the dungeon, the creeps are respawned.
 

LightChaosma

New Member
Reaction score
60
i get the part of, you getting teleported once you killed the boss, and the creeps respawning at that moment... (that is the triggers above)

but if you go back to the dungeon, they also need to be respawned? whats the use of that, the mobs are already there...
 

lummerlars

Member
Reaction score
2
Sorry you misunderstand me:D
I mean when you get into the Dungeon again, Then they are respawned already, not dead. I dont mean; When you enter Then respawn.
Its just to tell you, that i want it to be like: Everytime you enter, the creeps are living:D
But do you know how to make the trigger: When you kill the boss, then respawn every creeps in the dungeon?
 

LightChaosma

New Member
Reaction score
60
Trigger:
  • Untitled Trigger 001
    • Events
    • Unit - A unit Dies
    • Conditions
    • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
    • Set Count = (Count + 1)
    • Set Unit_Type[Count] = (Unit-type of (Triggering unit))
    • Set Point[Count] = (Position of (Triggering unit))


is correct

Trigger:
  • Untitled Trigger 002
    • Events
    • Unit - <enter your boss unit here> Dies
    • Conditions
    • Actions
    • For each (Integer A) from 1 to Count, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Unit_Type[(Integer A)] for Player 12 (Brown) at Point[(Integer A)] facing Default building facing degrees
      • set Unit_Type[(Integer A)] = no unit
      • Custom Script : call RemoveLocation (udg_Point[<something to call integer a wich i dont know >])
    • set count = 0

these should work. as soon as the boss dies, the unts are respawned.. i only dont know how to call integer A in the custom script...
 

lummerlars

Member
Reaction score
2
Ok, thanks for the help, i think it might works. I will test it soon:) But thanks alot for the help:)
rep+
 

jomik

New Member
Reaction score
17
Duuude, that's what I told you to do through msn <.<
bj_forLoopAIndex - Integer A :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top