• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Need help for trigger pro pls

Status
Not open for further replies.
Level 9
Joined
May 30, 2008
Messages
430
i use this tutorial "https://www.hiveworkshop.com/forums/f283/creep-respawn-gui-reviewed-purplepoot-65987/"
  • res my unit set
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Respown_Time = 60.00
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Set Temp_Intiger = (Temp_Intiger + 1)
          • Unit - Set the custom value of (Picked unit) to Temp_Intiger
          • Set Nucleus_Point[Temp_Intiger] = (Position of (Picked unit))
  • res my unit set Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to my unit
      • (Custom value of (Triggering unit)) Greater than 0
    • Actions
      • Wait Respown_Time game-time seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Player 1 (Red) at my unit_Point[(Custom value of (Triggering unit))] facing 270.00 degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))

so let's begin with the problem. I was searching for trigger that respown units by type after 1 week i found this one works good until i set the time to more than 20 seconds. Second problem is that i wonna wait time to be around 3-4 minutes ok lets fix it to 4 minutes and the unit to reseruct the problem is that there can be 1 unit die and can be 20 and don't wonna they to reseruct at once every one unit of that type must reseruct 4 minutes after die. Dead units can be to each of the player (units are capturable) that mean every player can go and attack the unit to change the ownership
Virus Infection 0.11 - The Hive Workshop - A Warcraft III Modding Site
this is the map if some one can help with the trigger and please first chek that trigger works with 10-15 units dead and res them after 4 minutes before post or don't post becouse i search for trigger 1 week and all i found is chek this this must work and nothing work properly
i will leave for the weekend and will come back after 2-3 days i hope some one to solve my problem until then becouse i can't solve it from weeks:hohum:
 
the unit dying unit can be owned by any of players on the map and ownership of the unit can be changed by attacking the unit and i think your trigger rivive last dead unit or somthing like this dunno and the dying unit is a building
 
ok i will edit trigger for my map and will test it with 2 minutes and if not work will post edited trigger when chek
  • Creep Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Nucleus
    • Actions
      • Wait 70.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 500.00 of (Position of (Dying unit)) matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True))) Equal to 0 "what to put here"
        • Then - Actions
          • Unit - Create 1 (Unit-type of (Dying unit)) for Player 1 (Red) at (Position of (Triggering unit)) facing (Random angle) degrees
        • Else - Actions
          • Trigger - Run (This trigger) (checking conditions)
at line where i write "what to put here i have problem for what is this line and dying unit can be to any of the players but created unit must be owned by player 1 red
 
As event
  • Unit - A unit Dies
As condition
  • ((Dying unit) is A Hero) Equal True
As Actions
  • Wait 240 seconds
  • Hero - Instantly revive (Dying unit) at center of (Playable map area)) , Show revival graphics
sry for not being able to write it as one trigger but try those thing i wrote in my trigger ( i just wrote there center of playable map area, change it with the region where you want your hero to respawn)
 
ok i will edit trigger for my map and will test it with 2 minutes and if not work will post edited trigger when chek
  • Creep Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Nucleus
    • Actions
      • Wait 70.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 500.00 of (Position of (Dying unit)) matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True))) Equal to 0 "what to put here"
        • Then - Actions
          • Unit - Create 1 (Unit-type of (Dying unit)) for Player 1 (Red) at (Position of (Triggering unit)) facing (Random angle) degrees
        • Else - Actions
          • Trigger - Run (This trigger) (checking conditions)
at line where i write "what to put here i have problem for what is this line and dying unit can be to any of the players but created unit must be owned by player 1 red

remove that line, it was only for my map
 
  • Creep Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Nucleus
    • Actions
      • Wait 120.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Create 1 (Unit-type of (Dying unit)) for Player 1 (Red) at (Position of (Triggering unit)) facing (Random angle) degrees
        • Else - Actions
          • Trigger - Run (This trigger) (checking conditions)
don't work for me and my first trigger who i test was somthing like this and reseruct last dying unit only but this even don't do this
 
trigger1
event: unit dies
condition:your conditions
action: create dummy unit at position of dying unit
turn on trigger 2

event:time passed equal to 180 seconds
action:create your unit at position of dummy unit
remove dummy unit from the game

try it
dummy unit is unit with no model no colision no shadov and without movement speed
 
yep this is the one of 2 variants at who i was thinking when dummy unit expires and to trigger every unit at trigger but for dummy unit is there a event a unit expire? for dummy units becouse that's my problem
edit: wait i will try to set 120 hp and -1 reg to the unit that will work
 
This may be confusing because some of it's in JASS, but I guarantee if you copy it in it's own trigger it will work.

Variables:
LoopCreep - Integer
CreepTypes - Unit-Type Array [1]
CreepPositions - Point Array [1]

First, when you want to revive creeps, you need to store them:

  • Store Creeps
    • Events
    • Conditions
    • Actions
      • Set LoopCreep = 0
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Set Creep_Types[LoopCreep] = (Unit-type of (Picked unit))
          • Set Creep_Positions[LoopCreep] = (Position of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to LoopCreep
          • Set LoopCreep = (LoopCreep + 1)
      • Custom script: call DestroyGroup(bj_lastCreatedGroup)
Next, when they die, you're going to want to spawn the dying creep at the spot where it was originally at (not where it died)

JASS:
function Trig_Revive_Creeps_Actions takes nothing returns nothing
    local integer CUSTOM
    set CUSTOM = GetUnitUserData(GetDyingUnit())
    call TriggerSleepAction( udg_Hostile_Revive_Time )
    call CreateNUnitsAtLoc( 1, udg_Creep_Types[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Positions[CUSTOM], bj_UNIT_FACING )
    call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
endfunction
//===========================================================================
function InitTrig_Revive_Creeps takes nothing returns nothing
    set gg_trg_Revive_Creeps = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Creeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Revive_Creeps, function Trig_Revive_Creeps_Actions )
endfunction
 
Last edited:
AS I SAY in my few posts when wait time is more than 100 seconds trigger don't run in your trigger have wait right? You wonna tell me that your trigger work after more than 100 seconds wait time if that is true tell me simple "this trigger work with any wait time try it" i am sure if i use your trigger for the thigs i need trigger won't work if i am incorec i will say sorry if i am right you will say sorry and no more tolking at this thread
 
Uh, the rub is that 10 times out of 10 when you ask the assistance of someone better than you, they'll be correct.

The apprentice cannot defeat the master, only through becoming the master can he defeat his apprentice.

The reason I say this is because you obviously never tried my trigger. My trigger can "Wait" any time.
 
JASS:
function Trig_Revive_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Revive_Actions takes nothing returns nothing
    local integer DiedUnitType = GetUnitTypeId( GetDyingUnit() )
    local location DiedUnitLocation = GetUnitLoc( GetDyingUnit() )
    call TriggerSleepAction( 20.00 ) //change that to your time
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetDyingUnit()), GetOwningPlayer(GetDyingUnit()), GetUnitLoc(GetDyingUnit()), bj_UNIT_FACING )
    set DiedUnitLocation = null
endfunction

//===========================
function InitTrig_Revive takes nothing returns nothing
    set gg_trg_Revive = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Revive, Condition( function Trig_Revive_Conditions ) )
    call TriggerAddAction( gg_trg_Revive, function Trig_Revive_Actions )
endfunction
Have fun..
 
Status
Not open for further replies.
Back
Top