| 08-15-2005, 01:25 PM | #1 |
I add this bit of code to my map from WEU because I decided I didn't want to use advanced triggers, but did want to use these few functions. But when I paste it into my custom map script, it tells me I have over 8000 compile errors during my next save, whats the problem? Heres the code: function WaitForSpecificUnitEvent takes unit U, unitevent E, real Time returns nothing local trigger T = CreateTrigger() call TriggerRegisterUnitEvent(T,U,E) loop call PolledWait(Time) exitwhen GetTriggerExecCount(T) > 0 endloop call DestroyTrigger(T) set T = null endfunction function ChangeDamage takes unit U, boolean Increase, integer Zahl returns nothing if not Increase then set Zahl = 0 - Zahl endif call AddBonus(Zahl,U,0) endfunction function AddBonus takes integer amount,unit who,integer t returns boolean return SetBonus((GetBonus(who,t)+amount),who,t) endfunction function StopSpellFromCasting takes unit U returns nothing call DisableTrigger(GetTriggeringTrigger()) call PauseUnitBJ(true,U) call IssueImmediateOrderBJ(U,"stop") call PauseUnitBJ(false,U) call TriggerSleepAction(0.01) call EnableTrigger(GetTriggeringTrigger()) endfunction function ChangeLife takes unit U, boolean Increase, integer Zahl returns nothing if not Increase then set Zahl = 0 - Zahl endif call AddBonus(Zahl,U,2) endfunction function ChangeDamage takes unit U, boolean Increase, integer Zahl returns nothing if not Increase then set Zahl = 0 - Zahl endif call AddBonus(Zahl,U,0) endfunction function SetBonus takes integer amount,unit who,integer t returns boolean local integer bonus=amount local integer array bit local integer i=1 set bit[0]=1 loop set bit[i]=bit[i-1]*2 exitwhen i==11 set i=i+1 endloop call ClearBonus(who,t) loop if (bonus>=bit[i]) then call UnitAddAbilityBJ(udg_zz_BnsBit[Ix(t,i)],who) set bonus=bonus-bit[i] endif exitwhen i==0 set i=i-1 endloop return (amount<=4095 and t<=3 and t>=0 and amount>=0 and who!=null) endfunction function ClearBonus takes unit who,integer t returns nothing local integer i=0 loop call UnitRemoveAbilityBJ(udg_zz_BnsBit[Ix(t,i)],who) exitwhen i==11 set i=i+1 endloop endfunction |
| 08-15-2005, 07:51 PM | #2 |
Anyone have any idea what the problem is? I can't even save my map because WEU crashes, and I'm in serious need of update. |
| 08-15-2005, 10:29 PM | #3 |
Because those functions may use variables or other functions. The editor also tells you about 8690 errors when there is only one error. ChangeDamage calls a function called AddBonus but that function is bellow the ChangeDamage function. My solution: don't use WEU, or Use WEU the way you should and use Optimizer to remove the unused functions and variables |
| 08-15-2005, 11:06 PM | #4 | |
Quote:
Yeah I know that they may use variables, and I'm positive that all of the variables are in the variable editor. Btw I just looked at the part where it calls it yet it is below, but would that cause it to have a script error? As for not using WEU, I'm trying that. I uncheck the box that says "Use advanced triggers" in WEU Enhancer (After removing all advanced triggers from my trigger editor, btw) and then the World Editor crashes the next time I try to save. And the optimizer, is that YOUR optimizer or the one included with WEU? |
| 08-16-2005, 09:20 AM | #5 |
hexenlordx, try moving the function that is called over the calling function. vexorian, do you by any chance know when the code tags are getting back again? :/ |
