- 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:
*And yes whoever helps me first with an actual solution will get +Rep. Guess im not really used to crashes
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 !!
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
-
Events
-
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)
-
Loop - Actions
- 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)
-
For each (Integer B) from 1 to 200, do (Actions)
-
Loop - Actions
- Set str_RefreshHp = str_HpBar[1]
- Trigger - Turn on HpBarUpdate <gen>
-
Events
-
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
-
If - Conditions
- Floating Text - Change text of HpBar[HpBar_CustomInteger] to str_HpBar[HpBar_CustomInteger] using font size 7.00
-
Loop - Actions
-
For each (Integer HpBar_CustomInteger) from 1 to HPBar_UnitAmount, do (Actions)
-
Events
*And yes whoever helps me first with an actual solution will get +Rep. Guess im not really used to crashes
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: