• 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.

[Trigger] wc3 crash...

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
Hi guys, im making a system which shows a units hp in bar in floating text form, its working well and all even though im not completely done it yet but it crashes when one unit of mine reaches a INTEGER percent hp of 81/82. First i thought this crash occured since i was using reals mixed with integers so i converted the percentage to an integer. Ok here is what the crash shows:
EDIT: OK guys i think it has something to do with the time, cus at the same time after w/e seconds wc crashes. !!!I think its with color codes and stuff like that maybe, not sure..

This application has encountered a critical error:

FATAL ERROR!


Program: c:\programfiles\warcraft iii\war3.exe
Exception: 0xC000001E(unknown exception) at 001B:00430072


Press OK to terminate the application.

OK now here are my triggers:
  • InitializeVariables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set HPBar_Unts[1] = Footman 0000 <gen>
      • -------- --------
      • Set HPBar_UnitAmount = 1
  • InitializeHpBars
    • Events
      • Time - Elapsed game time is 0.23 seconds
    • Conditions
    • Actions
      • Set str_Green = |c0000ff00
      • Set str_Red = |c00ff0000
      • Set str_End = |r
      • Set str_Bar = |
      • For each (Integer A) from 1 to HPBar_UnitAmount, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 200, do (Actions)
            • Loop - Actions
              • Set str_HpBar[(Integer A)] = (str_HpBar[(Integer A)] + str_Bar)
          • Set str_HpBar[(Integer A)] = (str_Green + (str_HpBar[(Integer A)] + str_End))
          • Floating Text - Create floating text that reads str_HpBar[(Integer A)] above HPBar_Unts[(Integer A)] with Z offset 0.00, using font size 7.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set HpBar[(Integer A)] = (Last created floating text)
      • Set str_RefreshHp = str_HpBar[1]
      • Trigger - Turn on HpBarUpdate <gen>
  • HpBarUpdate
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HpBar_CustomInteger) from 1 to HPBar_UnitAmount, do (Actions)
        • Loop - Actions
          • Floating Text - Change the position of HpBar[HpBar_CustomInteger] to HPBar_Unts[HpBar_CustomInteger] with Z offset 35.00
          • Set GetPercentLife = (Integer((Percentage life of HPBar_Unts[HpBar_CustomInteger])))
          • Game - Display to (All players) the text: (String(GetPercentLife))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (GetPercentLife x 2) Less than 200
            • Then - Actions
              • Set str_HpBar[HpBar_CustomInteger] = ((Substring(str_HpBar[HpBar_CustomInteger], 1, (GetPercentLife x 2))) + (str_End + (str_Red + ((Substring(str_HpBar[HpBar_CustomInteger], ((GetPercentLife x 2) + 1), (Length of str_HpBar[HpBar_CustomInteger]))) + str_End))))
            • Else - Actions
              • Set str_HpBar[HpBar_CustomInteger] = str_RefreshHp
          • Floating Text - Change text of HpBar[HpBar_CustomInteger] to str_HpBar[HpBar_CustomInteger] using font size 7.00
Note: i used the action "Game - Display to (All players) the text: (String(GetPercentLife))" as a debug message, the error still occured before i put it in.

*And yes whoever helps me first with an actual solution will get +Rep. Guess im not really used to crashes :cry:
EDIT: OK guys i think it has something to do with the time, cus at the same time after w/e seconds we crashes. !!!
I think its with color codes and stuff like that maybe, not sure..
FINAL EDIT: WOOHOO I GOT IT TO WORK ;)
i simplified my work and used a colorless substring and it worked ;)
the problem turned out to come from the color codes !!
+REP FOR RAFT_PL FOR LEADING ME TOWARDS FINDING OUT WHERE THE BUG IS !!
 
Last edited:
Level 9
Joined
May 27, 2006
Messages
498
Its 100% something with substring you have used in HpBarUpdate trigger. I had the same problem until i removed the substring line...


And better change the time from 0.03 to 0.06 or something like that, will cause less lagg.
 
Level 10
Joined
Sep 21, 2007
Messages
517
hmm no its not initially on, and the substring is prob not a problem but il check >>
as for the lag il try to use a time that makes it efficient and less laggy ^^
im going to test stuff now >>

EDIT: OK guys i think it has something to do with the time, cus at the same time after w/e seconds we crashes. !!!
I think its with color codes and stuff like that maybe, not sure..
FINAL EDIT: WOOHOO I GOT IT TO WORK ;)
i simplified my work and used a colorless substring and it worked ;)
the problem turned out to come from the color codes !!
+REP FOR RAFT_PL SINCE HE LED ME TOWARDS THE BUG, NOT NECESSARILY TOLD ME WHAT THE BUG IS BUT WITHOUT HIM I WOULD HAVE PROBABLY NEVER EVEN THOUGHT ABOUT COLOR CODES !! So thanks ^^
 
Last edited:
Status
Not open for further replies.
Top