Is there a way to manually change typeid?

Bribe

vJass errors are legion
Reaction score
67
[ljass]this.typeid[/ljass] is a native vJass utility that retrieves the struct instance from whence it was allocated. I'd just like to know if there's a way to set that value after the allocation method, because I want a parent struct to call a child struct's methods even though the child struct was not the one who did the original allocation.

It is not as simple as destroy/re-creating for the child, because there are massive data quantities assigned to the original instance.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I can't test it because i don't have JNGP or even jasshelper anymore, and don't want it anyway, but here is maybe a dirty solution.
Check the resulted jass code and see how Jasshelper names the variable typeid depends the interface and struct name, then try to use this variable directly.
However this may be forbidden by jasshelper, or if it's not a variable you are fucked.
 

Bribe

vJass errors are legion
Reaction score
67
It compiles to some kind of s__type_f array, I'll try referencing it by its exact name...
 

Bribe

vJass errors are legion
Reaction score
67
Actually, I've figured it out! I can safely run the "allocate" method from the child struct and it automatically re-writes the type id without destroying anything. All that needs to be done is to tell the parent struct to sometimes return an already existing value, and the overwrite is done without leaks (from what I can tell). This correctly assigned the child struct's method to replace the parent struct's method.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top