• 🏆 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!

Really weird problem...

Status
Not open for further replies.
Level 8
Joined
Jan 18, 2007
Messages
331
Hi folks, well iv started on an old project and iv finished it up a bit, now to the problem. You see, wen i type a message containing -lets go (thats the start trigger that starts the game) and then wc3 just shuts down... hmmm, well here is the triggers

  • start
    • Events
      • Player - Player 1 (Red) types a chat message containing -lets go as A substring
    • Conditions
    • Actions
      • Trigger - Run lvl1 <gen> (checking conditions)
      • Trigger - Turn off (This trigger)
and

  • lvl1
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Ghoul for Player 12 (Brown) at (Center of Region 000 <gen>) facing Default building facing degrees
      • Set Attacking_forces[1] = (Last created unit)
      • Unit - Create 1 Ghoul for Player 12 (Brown) at (Center of Region 003 <gen>) facing Default building facing degrees
      • Set Attacking_forces[2] = (Last created unit)
      • Unit - Create 1 Ghoul for Player 12 (Brown) at (Center of Region 002 <gen>) facing Default building facing degrees
      • Set Attacking_forces[3] = (Last created unit)
      • Unit - Create 1 Ghoul for Player 12 (Brown) at (Center of Region 001 <gen>) facing Default building facing degrees
      • Set Attacking_forces[4] = (Last created unit)
      • Unit Group - Add all units of (Units owned by Player 12 (Brown) of type Ghoul) to attacking_forces_unit_group[1]
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Unit - Order (Picked unit) to Attack Hero)
      • Trigger - Run lvl 1 to 6 timer <gen> (checking conditions)
and..

  • lvl 1 to 6 timer
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (attacking_forces_unit_group[1] is empty) Equal to True
        • Then - Actions
          • Player - Add 1 to Player 1 (Red) Current lumber
          • Countdown Timer - Start Next_Level as a One-shot timer that will expire in 30.00 seconds
          • Set Next_Level = (Last started timer)
          • Countdown Timer - Create a timer window for Next_Level with title Next lvl in...
          • Set timer[1] = (Last created timer window)
          • Countdown Timer - Show timer[1]
          • Trigger - Turn off (This trigger)
          • Trigger - Run lumber <gen> (checking conditions)
        • Else - Actions
          • Trigger - Run (This trigger) (checking conditions)
well there it is.
 
Level 15
Joined
Jan 31, 2007
Messages
502
Of course it will shut down ^^
when typing "-lets go" you´re adding some units to "attacking_forces_unit_group[1]" will will cause that your condition "(attacking_forces_unit_group[1] is empty) Equal to True" returns FALSE which means it will do the Else action which will repeat the whole trigger
This is a endless loop which begins at the moment "(attacking_forces_unit_group[1] is empty) Equal to True" becomes false
And because off this endleess loop warcraft shuts dowwn :D
 
  • Like
Reactions: Rui
Yes, to prevent this, I think you can change the action to:
Code:
Test Trigger
(Number of units in (attacking_forces_unit_group[1])) Equal to 4
Also, to prevent leaks, I think you would also want to do this as an action to destroy the group:
Code:
Custom Script: call RemoveLocation( udg_attacking_forces_unit_group[1] )
I hope this helps! :grin:
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
PurgeandFire111 said:
Code:
Custom Script: call RemoveLocation( udg_attacking_forces_unit_group[1]
I hope this helps! :grin:

udg_attacking_forces_unit_group[1] is a Unit Group I presumed? I doubt you can remove it with RemoveLocation?


Thanks for the help, (+rep for JonNny).

Sonkan1, may I use your trigger as an example of a crash/shut down? I'm gathering these kind of informations.
 
udg_attacking_forces_unit_group[1] is a Unit Group I presumed? I doubt you can remove it with RemoveLocation?


Thanks for the help, (+rep for JonNny).

Sonkan1, may I use your trigger as an example of a crash/shut down? I'm gathering these kind of informations.


Oh! My bad! I meant this:
  • Test Trigger
  • Events:
  • Conditions:
  • Actions:
  • Custom Script: call DestroyGroup( udg_attacking_forces_unit_group[1] )
Sorry for the confusions, thanx Rui for catching that! :infl_thumbs_up:
 
  • Like
Reactions: Rui
Level 8
Joined
Jan 18, 2007
Messages
331
Yes rui u can, well iv slowed the problem buy making a trigger that checks to things and then its duble effective! well, now it has started to leak=( hmm.... well il make a anti stuck thing=) thnx for the help=)
 
Last edited:
Status
Not open for further replies.
Top