• 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.

Constructor requires no arguments

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Yes, about this error massage I have a question. This error massage comes up in this part of my spell:
JASS:
   private function ESCast takes nothing returns boolean
        if GetSpellAbilityId() == SPELL_ID then
            call ElementalSpin.create(GetTriggerUnit())
        endif
        return false
    endfunction
The error comes up, if I add "GetTriggerUnit()"


Now I learned it like this, that this function gives one or more arguments to the create method and my create native is this:
JASS:
static method ESCreate takes unit caster returns thistype

Now, if I delete "GetTriggerUnit()", the error is gone, but I still need this argument, to give it to the create method or not? =O Because when I cast nothing happen, I search for mistakes now (because JassHelper say everything is fine and I was wondering first about this part)
[It's my first time with "thistype", else it returns the name of the spell and then I don't get any error.
Hope someone can help with this

Greetings and Peace
Dr. Boom
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
The constructor method requires to have an identifier called create, if you still insist on using Escreate then use ElementalSpin.EScreate(GetTriggerUnit()) as the default constructor for your struct.
 
Level 16
Joined
May 1, 2008
Messages
1,605
The constructor method requires to have an identifier called create, if you still insist on using Escreate then use ElementalSpin.EScreate(GetTriggerUnit()) as the default constructor for your struct.

vJass is crazy, I always use only .create even if create method has a different name. My spell doesn't work anyway - but this problem is solved xD

Thanks dude
Dr. Boom
 
Status
Not open for further replies.
Top