Discussion Modules do not inherit parent constructs.

Bribe

vJass errors are legion
Reaction score
67
Once again, Jesus4Lyf proves to be a smart cookie.

Solved!

This is beginning to ruin everything I've been striving to accomplish.

JASS:
module bull
    method guy takes nothing returns nothing
        call BJDebugMsg("guy")
    endmethod
endmodule

interface console
    method guy takes nothing returns nothing defaults nothing
endinterface

struct parent extends console
    static method onInit takes nothing returns nothing
        call thistype(0).guy()
    endmethod
endstruct

struct child extends parent
    implement bull
endstruct


Here's what's happening: struct parent doesn't have any business with calling the "guy" method. Only a child struct wants that method. Problem is that importing a module into the child struct, even though that module contains "guy", nothing happens. The message "guy" never gets displayed.

• By putting the module in the parent struct, "guy" gets displayed.
• By putting guy into the child struct directly, "guy" gets displayed.
• By omitting "defaults nothing" from the interface, a compile-error says "guy" does not exist.
• By viewing this in the war3map.j file, the trigger arrays which are supposed to launch "guy" are never assigned to a trigger.

JassHelper doesn't recognize the module at any point in the compile process as an actual part of the child struct.

I'm going to switch to a textmacro now, see if that works, but I'm helping the community be aware of this glitch.]
 

Jesus4Lyf

Good Idea™
Reaction score
397
• By putting guy into the child struct directly, "guy" gets displayed.
I don't believe you without seeing it myself..
And if it does work, it is probably an error due to on calling the method on an unused struct id ([LJASS]0[/LJASS]).

What are you trying to achieve?
 

tooltiperror

Super Moderator
Reaction score
231
Isn't [LJASS]thistype(0)[/LJASS] always [LJASS]null[/LJASS]?
 

Bribe

vJass errors are legion
Reaction score
67
You are smarter than I'd like to admit sometimes, Jesus4Lyf, thanks for the fresh perspective!

The test fails, just like you said, "0" is never instanciated by the child struct.

I've figured out why my system is failing as well - the create method is being done by the parent struct (duh?).

Wow, thank you, sir. Once again, my wild ideas have been put in their place. I'm going to have to stop jumping to conclusions.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top