• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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