• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Neutral camp respawn system...

Status
Not open for further replies.
Level 24
Joined
Jun 16, 2008
Messages
1,939
Hi the Hive Community!

I am searching a Neutral camp revival system for my map similar to the one in Dota...

It would be helpful if u could give me a code or a link related to my question
- someone mention Dota template in another thread were he got the Dota Multiboard from
dunno if something like that exists but i would be interested to get a related link to the topic, too!

plz help me!

-Palaslayer
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
the first link gives me this trigger:

  • SpawnSystem Respawn
    • Events
      • Unit - A unit owned by neutral passive dies
    • Conditions
    • Actions
      • Custom script: local unit udg_SystemSpawn_RespawnUnit
      • Custom script: local integer udg_SystemSpawn_RespawnUnitIndex
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (Dying unit) equal to SystemSpawn_SpawnUnit[(Integer A)]
            • 'THEN'-Actions
              • Set SystemSpawn_RespawnUnitIndex = (Integer A)
            • 'ELSE'-Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • SystemSpawn_RespawnUnitIndex greater than 0
        • 'THEN'-Actions
          • Skip remaining actions
        • 'ELSE'-Actions
      • Unit - Create 1 (Unit-type of (Dying unit)) for neutral enemy at ((Center of (Entire map)) offset by (SystemSpawn_SpawnPointX[SystemSpawn_RespawnUnitIndex], SystemSpawn_SpawnPointY[SystemSpawn_RespawnUnitIndex])) facing default for Building-Facing degrees
      • Set SystemSpawn_SpawnUnit[SystemSpawn_RespawnUnitIndex] = (Last created unit)
      • Set SystemSpawn_RespawnUnit = SystemSpawn_SpawnUnit[SystemSpawn_RespawnUnitIndex]
      • Unit - Hide SystemSpawn_RespawnUnit
      • Wait 5.00 seconds
      • Unit - Unhide SystemSpawn_RespawnUnit

not sure if it will work
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
i did something on my own

JASS:
function Trig_Neutral_Respawn_2_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(NEUTRAL), Player(PLAYER_NEUTRAL_AGGRESSIVE), CAMP, bj_UNIT_FACING )
endfunction

function Trig_Func001002003 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) )
endfunction


//===========================================================================
function InitTrig_Neutral_Respawn_2 takes nothing returns nothing
    local unit NEUTRAL
    local group GROUP
    local location CAMP
    set gg_trg_Neutral_Respawn_2 = CreateTrigger(  )
    set GROUP = GetUnitsInRectMatching(GetEntireMapRect(),( Condition( function Trig_Func001002003 ))
    call ForGroupBJ( GROUP, GetEnumUnit() )
    loop
        set NEUTRAL = GetDyingUnit()
        set CAMP = GetUnitLoc( GetDyingUnit() )
    endloop
    call TriggerRegisterTimerEventPeriodic( gg_trg_Neutral_Respawn_2, 120.00 )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Neutral_Respawn_2, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Neutral_Respawn_2, function Trig_Neutral_Respawn_2_Actions )
endfunction

why does this trigger not work???

plz i n help :(
 
Status
Not open for further replies.
Top