code in structs, +rep for help

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
probably a simple yes or no question

JASS:
struct Example
    code c
endstruct


is this ok and does this work in a struct where it is not a static variable? since you cant have array code variables (which is retarded)
 

luorax

Invasion in Duskwood
Reaction score
67
Since it's compiled to a code array ([ljass]s_Example_c[8190][/ljass]), "No". You must either use boolexpr's (AFAIK you can have boolexpr arrays) or function interfaces.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
is there a way to store codes in an array with some kind of work-around?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
so instead of code i use [ljass]conditionfunc[/ljass] for the variable type then? then can i just do [ljass]call c[/ljass] or do i have to do something like:
JASS:
if c then
endif
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
does this add to your trigger eval count?
id still use it but :(
 

luorax

Invasion in Duskwood
Reaction score
67
Well, unfortunately we can't store codes in hashtables. You can use function interfaces, of course, but since they're based on trigger evaluation, mine is faster.

If you know how many instances your struct would need (and that number is low), you could do something else, although it's a very ugly method (but doesn't use trigger evaluations)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
its a dynamic type of struct, depending on how its used so thats a no
guess ill have to use a trigger eval
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top