• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Basic GUI questions

Status
Not open for further replies.
Level 10
Joined
Apr 13, 2005
Messages
630
Hey Guys I have alot of questions about stupid stuff as i forgot alot of things over the years of inactiveness. but if you could answer my stupid nooby stuff that be great.

So I'm triggering a dungion right now and spawning all these creeps makes mega lag. Currently I'm using a code like this
  • Wait 0.01 seconds
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in Lokf_heroGroup) Greater than or equal to 1
    • Then - Actions
      • Set LeakPoint[311] = (Center of Skeleton mage 3 <gen>)
      • Unit - Create 1 Prison Mage for Player 12 (Brown) at LeakPoint[311] facing LeakPoint[311]
      • Custom script: call RemoveLocation(udg_LeakPoint[311])
    • Else - Actions
Then repeating the same action over and over again til every unit in the dungion is spawn. I don't know if there is a better way of spawning creeps but I sure think this lagging way isnt helpful.


Currently my triggers are as a Unit dies, if then else - if unitgroup of heros = 0 then remove all units. If then else - if unitgroup of heros < 1 then subtract one.

Maybe its me or this system sucks due to the fact it leaks whenever i try it would work 50% of the time


I would post the code but it is in JASS and this is GUI question. My question is... is there a way to have a boss start casting an ability at 50% hp and keep going adding in new spells as his hp goes down


I'm trying to make a system where units only spawn when entering a creep area and has a range of 1100 of spawning then walks around the area like tkok orpg. Also to prevent farming a shut off if a unit either patrolls or sits afk for 5 mins.


I do have more questions and prob will post more later
 
Heh, you're kinda ancient here :)

  • Wait 0.01 seconds
This is not needed, nor it is accurate.

You can use a loop to spawn many creeps:
  • For each (IntegerA) from 1 to NumberOfCreeps, do (Actions)
    • Loop - Actions
      • Set Point1 = (Random point in Skeleton Spawn <gen>)
      • Unit - Create 1 Prison Mage for Player 12 (Brown) facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_Point1)
Leaks means "memory loss", they have nothing to do with the functionality of a code.
I am not sure how you triggered the resetting of the dungeon, I might need triggers for that, but you might want to change the condition "unitgroup of heros < 1" to "> 1".

The main event for the hp level is the event "Unit - A unit's life becomes equal to X".
Now, you can either use Weep's Damage Detection System or Bribe's (check Spells section) for those or you can register for every hp level you wish the abilities to be added.

Not sure if what you ask is this, concerning the creep respawn, but you can use a boolean variable that is initially off (They always are), and, use an event Unit - A unit enters Creep Area <gen> (region). If (Triggering player) Equal to Player 12 (Brown), then set the boolean to true; finally, reset it everytime the new round of creeps is supposed to occur. In the main system, make a check if the boolean is true; if it is, spawn the new creeps.
 
Level 10
Joined
Apr 13, 2005
Messages
630
lol thanks pharaoh for commenting back so dang quick. Yes I've been around since the last website R.I.P. D: but anyway

~Prob with the trigger of spawning is its specific regions so random point cant work sorry i didnt explain. I still remember what leaks are but not always so sure of the exact leaks. I know of unit groups, special effects, regions, FLoating text, Player groups, Sounds and prob more but idk.

~if you want me to post the jass version of the script which was just converted from GUI i can post if you wish.

~Sweet ill check out their systems thanks alot

~if you ever played TKOK orpg their creep respawn system is what i want. Where creeps dont spawn to far ahead of you. no regions need. I was thinking of a LOOP trigger of Unit enters region turn on lOOP. LOOP trigger will spawn a unit in a random spot random num from 500-900 degrees all around the hero without going into a tree, mountain, river, etc. Idk if there is such a system??
 
1) For leaks you can have a look at this: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
2) Yes, you may need to post it, because I don't really get your problem.
3) Ah, you mean you want to respawn creeps, only if a hero is standing in the area?
You can still use regions, by dividing the map into hunting zones. Then, when a unit enters a region, check if the (Triggering unit) is a Hero (boolean comparison) and then turn the loop trigger on. You will need a hashtable for this (although I am not sure how familiar you are with it), that stores the unit-types that spawn in each region, to the region itself.
 
Level 10
Joined
Apr 13, 2005
Messages
630
K heres the code for reset Also I'm not sure about hashtables at all ive heard of them as ive dl Egui and shizz like that

  • Check prob Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Triggering unit) is in ShamanicAuraGroup) Equal to False
    • Actions
      • -------- //////////Destro////////// --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Lokf_heroGroup) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Lokf_heroGroup is empty) Equal to True
            • Then - Actions
              • Set Activation[8] = False
              • Destructible - Pick every destructible in Lokf Instance <gen> and do (Destructible - Close (Picked destructible))
              • Set LeakGroup[48] = (Units in Lokf Instance <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[48] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[48])
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • -------- //////////ORC////////// --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in OrcHeroGroup) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (OrcHeroGroup is empty) Equal to True
            • Then - Actions
              • Set Activation[5] = False
              • Set Activation[4] = False
              • Trigger - Turn off OrcBoss Lava <gen>
              • Destructible - Pick every destructible in Orchen Dungeon <gen> and do (Destructible - Close (Picked destructible))
              • Set LeakGroup[49] = (Units in Orchen Dungeon <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[49] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[49])
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • -------- //////////NAGA////////// --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in NagaHeroGroup) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (NagaHeroGroup is empty) Equal to True
            • Then - Actions
              • Set LeakGroup[50] = (Units in Naga Instance Weather <gen> owned by Player 12 (Brown))
              • Destructible - Pick every destructible in Naga Instance Weather <gen> and do (Destructible - Close (Picked destructible))
              • Unit Group - Pick every unit in LeakGroup[50] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[50])
              • Set LeakGroup[51] = (Units in Naga Boss Region <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[51] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Destructible - Pick every destructible in Naga Boss Region <gen> and do (Destructible - Close (Picked destructible))
              • Custom script: call DestroyGroup(udg_LeakGroup[51])
              • Destructible - Pick every destructible in Naga First Door <gen> and do (Destructible - Close (Picked destructible))
              • Destructible - Pick every destructible in Naga Second Door <gen> and do (Destructible - Close (Picked destructible))
              • Destructible - Pick every destructible in Naga Third Door <gen> and do (Destructible - Close (Picked destructible))
              • Set Activation[1] = False
              • Set Activation[2] = False
              • Set Activation[3] = False
              • Trigger - Turn on Naga Doors 1 leave <gen>
              • Trigger - Turn on Naga Doors 2 leave <gen>
              • Trigger - Turn on Naga Doors 3 leave <gen>
              • Trigger - Turn on Naga Bosses <gen>
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • -------- //////////SATYR////////// --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Satyr_heroGroup) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Satyr_heroGroup is empty) Equal to True
            • Then - Actions
              • Set Activation[10] = False
              • Set SentinelBool = False
              • Destructible - Pick every destructible in Satyr Instance <gen> and do (Destructible - Close (Picked destructible))
              • Set LeakGroup[52] = (Units in Satyr Instance <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[52] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Set LeakGroup[53] = (Units in Satyr Boss Region <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[53] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[53])
              • Set LeakGroup[53] = (Units in Satyr Instance <gen> owned by Neutral Passive)
              • Unit Group - Pick every unit in LeakGroup[53] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[53])
              • Custom script: call DestroyGroup(udg_LeakGroup[52])
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • -------- //////////GRUKK////////// --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Grukk_Herogroup) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Grukk_Herogroup is empty) Equal to True
            • Then - Actions
              • Set Activation[6] = False
              • Set Activation[7] = False
              • Set LeakGroup[54] = (Units in Grukk Control Area <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[54] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Destructible - Pick every destructible in Grukk Control Area <gen> and do (Destructible - Close (Picked destructible))
              • Custom script: call DestroyGroup(udg_LeakGroup[54])
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • -------- //////////LICH/ZYKEN////////// --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in LichHerogroup) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (LichHerogroup is empty) Equal to True
            • Then - Actions
              • Visibility - Disable LichRoomvis
              • Set LeakGroup[55] = (Units in Remove Lich units 1 <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[55] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Destructible - Pick every destructible in Remove Lich units 1 <gen> and do (Destructible - Close (Picked destructible))
              • Custom script: call DestroyGroup(udg_LeakGroup[55])
              • Set LeakGroup[56] = (Units in Remove Lich units 2 <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[56] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Destructible - Pick every destructible in Remove Lich units 2 <gen> and do (Destructible - Close (Picked destructible))
              • Custom script: call DestroyGroup(udg_LeakGroup[56])
              • Set LeakGroup[57] = (Units in Remove Lich units 3 <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[57] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Destructible - Pick every destructible in Remove Lich units 3 <gen> and do (Destructible - Close (Picked destructible))
              • Custom script: call DestroyGroup(udg_LeakGroup[57])
              • Set LeakGroup[58] = (Units in Remove Lich units 4 <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[58] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Destructible - Pick every destructible in Remove Lich units 4 <gen> and do (Destructible - Close (Picked destructible))
              • Custom script: call DestroyGroup(udg_LeakGroup[58])
              • Set LeakGroup[59] = (Units in Remove Lich units 5 <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[59] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Destructible - Pick every destructible in Remove Lich units 5 <gen> and do (Destructible - Close (Picked destructible))
              • Custom script: call DestroyGroup(udg_LeakGroup[59])
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • -------- //////////Volcano////////// --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Volcano_HeroGroup) Equal to True
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Volcano_HeroGroup is empty) Equal to True
            • Then - Actions
              • Set Activation[12] = False
              • Set Activation[11] = False
              • Set LeakGroup[60] = (Units in Red Volcano Smoke <gen> owned by Player 12 (Brown))
              • Unit Group - Pick every unit in LeakGroup[60] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[60])
              • Set LeakGroup[60] = (Units owned by Player 12 (Brown) of type Boomer)
              • Unit Group - Pick every unit in LeakGroup[60] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[60])
              • Set LeakGroup[61] = (Units owned by Player 12 (Brown) of type Volcano Summoner)
              • Unit Group - Pick every unit in LeakGroup[61] and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_LeakGroup[61])
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
idk if there is a different between the two but sometimes it works sometimes it doesnt D:

JASS:
//TESH.scrollpos=29
//TESH.alwaysfold=0
function Trig_Volcano_Complete_Conditions takes nothing returns boolean
    return 'o00J' == GetUnitTypeId(GetDyingUnit())
endfunction

function Trig_Volcano_Complete_N01R takes nothing returns boolean
    return 'n01R' == GetUnitTypeId(GetFilterUnit())
endfunction

function Trig_Volcano_Complete_o00J takes nothing returns boolean
    return 'o00J' == GetUnitTypeId(GetFilterUnit())
endfunction

function Trig_Volcano_Complete_FilterPlayerFilter takes nothing returns boolean
    return GetOwningPlayer(GetFilterUnit()) == Player(11)
endfunction

function Trig_Volcano_Complete_Func005A takes nothing returns nothing
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Volcano_Complete_Func021A takes nothing returns nothing
    local location L = Location(GetRectCenterX(udg_HeroItemLoc[GetPlayerId(GetOwningPlayer(GetEnumUnit()))]), GetRectCenterY(udg_HeroItemLoc[GetPlayerId(GetOwningPlayer(GetEnumUnit()))]))
    call SetUnitPositionLoc(GetEnumUnit(), L)
    call SetUnitFacing(GetEnumUnit(), GetPlayerId(GetOwningPlayer(GetEnumUnit())) * 180.00 )
    //call PanCameraToTimed(GetLocationX(L), GetLocationY(L), 0.00)
    call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetTriggerUnit()), L, 0 )
    call SelectUnit( GetEnumUnit() , true)
    call IssueImmediateOrder( GetEnumUnit(), "stop" )
    call GroupRemoveUnit(udg_Grukk_Herogroup , GetEnumUnit())
    call RemoveLocation(L)
endfunction

function volcano_boomers_kill takes nothing returns nothing
    call RemoveUnit(GetEnumUnit())
endfunction

function Trig_Volcano_Complete_Actions takes nothing returns nothing
    local group G = CreateGroup()
    local group D = CreateGroup()
    call TriggerSleepAction( 1.00 )
    set udg_Activation[12] = false
    set udg_Activation[11] = false
    call GroupEnumUnitsOfPlayer(G, Player(11), Condition(function Trig_Volcano_Complete_N01R))
    call ForGroup( G, function Trig_Volcano_Complete_Func005A )
    set G = null
    call GroupEnumUnitsOfPlayer(D, Player(11), Condition(function Trig_Volcano_Complete_o00J))
    call ForGroup( D, function Trig_Volcano_Complete_Func005A )
    set D = null
    call DestroyGroup(D)
    call TriggerSleepAction( 0.01 )
    call ForGroup( udg_Volcano_HeroGroup, function Trig_Volcano_Complete_Func021A )
    call GroupClear( udg_Volcano_HeroGroup )
    call GroupEnumUnitsInRect(G, gg_rct_Red_Volcano_Smoke, Condition(function Trig_Volcano_Complete_FilterPlayerFilter))
    call ForGroup( G, function Trig_Volcano_Complete_Func005A )
    set G = null
    call DestroyGroup(G)
    call ForGroup(udg_volcano_boomers, function volcano_boomers_kill)
endfunction

//===========================================================================
function InitTrig_Volcano_Complete takes nothing returns nothing
    set gg_trg_Volcano_Complete = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Volcano_Complete, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Volcano_Complete, Condition( function Trig_Volcano_Complete_Conditions ) )
    call TriggerAddAction( gg_trg_Volcano_Complete, function Trig_Volcano_Complete_Actions )
endfunction
 
Status
Not open for further replies.
Top