When using Vexorian's Wc3 Map Optimizer, when does the use of ExecuteFunc bug?
I've not had any problems yet, but I often read that this program will break ExecuteFunc. Does anybody have an answer for this?
ExecuteFunc()
and TriggerRegisterVariableEvent()
. (or so I've heard) The fix is to either not use those functions, or to uncheck "Compress names". (I think)call ExecuteFunc("IA")
call ExecuteFunc("uE")
call ExecuteFunc("EX")
call ExecuteFunc("bO")
call ExecuteFunc("FO")
set Ni[0]="JR"
set Ni[1]="lR"
set Ni[2]="mR"
set Ni[3]="pR"
set Ni[4]="qR"
set Ni[5]="sR"
set Ni[6]="tR"
set Ni[7]="uR"
set Ni[8]="WR"
set Ni[9]="YR"
set Ni[10]="ZR"
set Ni[11]="eI"
set Ni[12]="rI"
set Ni[13]="aI"
set Ni[14]="VI"
set Ni[15]="XI"
set Ni[16]="RI"
function MyF1 // ...
endfunction
function TheCodeInsideItWillBeBreakedByWc3MapOptimizer takes nothing returns nothing
local integer i = 0
call ExecuteFunc("MyF"+"1")
set i = i+1
call ExecuteFunc("MyF" + I2S(i))
endfunction
globals
integer test1
integer test2
string test3
force test4
location test5
real test6
real test7
endglobals
function Init1 takes nothing returns nothing
local integer i
local force f
local real r
set test1 = 0
set test2 = 0
endfunction
function Init2 takes nothing returns nothing
local integer i
local force f
local real r
set test3 = ""
set test4 = CreateForce()
endfunction
function Testfunction takes nothing returns nothing
local integer i
local force f
local real r
set test6 = 0
set test7 = 0
set test5 = Location(test6,test7)
endfunction
function main takes nothing returns nothing
call Init1()
call ExecuteFunc("Init2")
call ExecuteFunc("Testfunctio"+"n")
endfunction
function config takes nothing returns nothing
call main()
endfunction
globals
integer e
integer x
string o
force a
location n
real V
real E
endglobals
function m takes nothing returns nothing
local integer i
local force f
local real r
set o=""
set a=CreateForce()
endfunction
function Testfunction takes nothing returns nothing
local integer i
local force f
local real r
set V=0
set E=0
set n=Location(V,E)
endfunction
function main takes nothing returns nothing
local integer i
local force f
local real r
set e=0
set x=0
call ExecuteFunc("m")
call ExecuteFunc("Testfunctio"+"n")
endfunction
function config takes nothing returns nothing
local integer i
local force f
local real r
set e=0
set x=0
call ExecuteFunc("m")
call ExecuteFunc("Testfunctio"+"n")
endfunction
globals
string teststring
endglobals
function Testfunction takes nothing returns nothing
local integer i
local force f
local real r
endfunction
function main takes nothing returns nothing
set s = "Testfunction"
call ExecuteFunc("Testfunctio"+"n")
endfunction
function config takes nothing returns nothing
call main()
endfunction
globals
group n=null
endglobals
function H takes nothing returns nothing
local integer i
local force f
local real r
endfunction
function main takes nothing returns nothing
set s="H"
call ExecuteFunc("Testfunctio"+"n")
endfunction
function config takes nothing returns nothing
set s="H"
call ExecuteFunc("Testfunctio"+"n")
endfunction
globals
string teststring
endglobals
globals
group n=null
endglobals
To bump this old thread because it is relevant, I ran some tests this
morning and can confirm that it is only when concatenation is used that
ExecuteFunc/TriggerRegisterVariableEvent do not work.
Because my first tests showed otherwise, it's that you also have to tick
"optimize strings" and not just "compress names" otherwise it doesn't
work.
I don't get why people keep complaining about optimizer, Vexorian is not here and it is a great tool
(which doesn't like variable events if you tick compress names) no matter what they say.
Actually they can complain about these things of course, but what I don't like is "optimizer is buggy", "don't use it", "it will break your map" etc...