• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] xemissle own create method

Status
Not open for further replies.
Level 3
Joined
Jun 9, 2012
Messages
25
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:
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:
Status
Not open for further replies.
Top