first timer problem

jackall

You can change this now in User CP.
Reaction score
37
Since this is the first struct I've ever made, I've had a few problems with it but one keeps reappearing...
JASS:

struct Paladin
        unit Hero
        integer Type = 'Hpal'
        method GetHP takes nothing returns real
            return GetUnitState(.Hero,UNIT_STATE_LIFE)
        endmethod
        method GetMP takes nothing returns real
            return GetUnitState(.Hero,UNIT_STATE_MANA)
        endmethod
        method RestoreHP takes real howMuch returns nothing
            call SetUnitState(.Hero,UNIT_STATE_LIFE,.GetHP+howMuch)
        endmethod
        method RestoreMP takes real howMuch returns nothing
            call SetUnitState(.Hero,UNIT_STATE_MANA,.GetMP+howMuch)
        endmethod
endstruct

Can someone explain to me why the compiler screams at me when I try to save a map that has that struct?
Meaning: how can I use the "GetHP" method inside the "RestoreHP" one?
It may seem so very simple to you but I'm still at the beginning of learning vJASS so I'm :confused:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top