xemissile own create method
Hi,
I'm trying to use Verxorian's xe system but I'm not actually getting how the xemissile works.
It says i have to create an own struct that extends xemissile. I did that and the problem is, that i want it to have an own create method. Now it errors and says that the create method must return the struct though it already returns it.
Here is the struct:
I want an own create method because i'm making a boomeran that returns to the caster.So i have to save the caster in the boomerang.
I would be glad if someone could help me and explain what actually is wrong with the create method.
Hi,
I'm trying to use Verxorian's xe system but I'm not actually getting how the xemissile works.
It says i have to create an own struct that extends xemissile. I did that and the problem is, that i want it to have an own create method. Now it errors and says that the create method must return the struct though it already returns it.
Here is the struct:
JASS:
private struct missile extends xemissile
unit c
real dist
real d
static method create takes unit c,real tx,ty returns missile
local real x = GetUnitX(c)
local real y = GetUnitY(c)
local real dist = SquareRoot((tx-x)*(tx-x)+(ty-y)*(ty-y))
local missile this = missile.allocate(x,y,HEIGHT,tx,ty,HEIGHT)
set .c = c
set .d = dist
set .dist = dist
return this
endmethod
endstruct
I want an own create method because i'm making a boomeran that returns to the caster.So i have to save the caster in the boomerang.
I would be glad if someone could help me and explain what actually is wrong with the create method.
Last edited by a moderator: