Chaosy
Tutorial Reviewer
- Joined
- Jun 9, 2011
- Messages
- 13,239
I am trying to use AutoCastSystem v1.2 but I get a very annoying bug.
JassHelper says: "ACS is not of a type that allows . syntax"
This is the demo used for the system.
I created a struct on my own and compared the two methods. They are identical.
JassHelper says: "ACS is not of a type that allows . syntax"
JASS:
function onInit() {
Wat t = Wat.create();
ACS x = ACS.register(CreateUnit(Player(0), 'Hpal', 0, 0, 0)); //it does not work with x.register either. In fact it gives the same error.
}
This is the demo used for the system.
JASS:
globals
ACS warden
endglobals
function CastAITestWarden takes unit u returns nothing
set warden = warden.register(u)
call warden.spellTypePointTarget(function CastPointEnemy, 852238) //rain of fire (channel)
call warden.spellTypePointTarget(function CastPointEnemy, 852525) //blink
call warden.spellTypeUnitTarget(function CastChanceTargetEnemy, 852106) //ensnare
call warden.spellTypeUnitTarget(function CastChanceTargetEnemy, 852527) //shadow strike
call warden.spellTypeNoTarget(function CastChanceNoTarget, 852526) //fan of knives
call warden.launch(1.0)
endfunction
I created a struct on my own and compared the two methods. They are identical.
JASS:
//mine
static method create() -> thistype {
thistype this = thistype.allocate();
return this;
}
//ACS
static method register takes unit caster returns thistype
local thistype this
if ...
...
else
set this = allocate()
...
endif
return this
endmethod
Last edited: