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

[vJASS] Instance referal

Status
Not open for further replies.
Level 20
Joined
Jul 6, 2009
Messages
1,885
Thanks. One more thing - how to retrieve an instance's index?
I thought that the actual instance is an integer representing the index, but when i tried, in a method, to do: if this == SomeInteger then it gave an error saying that 2 different values can't be compared.
However, if i make a debug message BJDebugMsg(I2S(InstanceName)) it shows it's index.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
integer(this) == SomeInteger
There's no integer() function :X
if this == structName(SomeInteger)
That would mean comparing 2 struct intances. I want to compare a struct instance's index with an integer.
Good idea, but still it showed the same error.

EDIT: Found a way. Setting an integer variable to 'this' and then comparing the variable and SomeInteger worked.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
integer() is supposed to ask jasshelper consider the instance struct argument as in integer, it's not a jass function, it's a vJass feature.

So that should work, never tried though, maybe the parser doesn't allow it without using an intermediate integer variable like you did, which would be silly because we all know that in vJass a struct instance is an integer.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
integer() is supposed to ask jasshelper consider the instance struct argument as in integer, it's not a jass function, it's a vJass feature.

So that should work, never tried though, maybe the parser doesn't allow it without using an intermediate integer variable like you did, which would be silly because we all know that in vJass a struct instance is an integer.
Oh, it worked ;O
Sry i didn't test it at first.
Thanks.
 
Status
Not open for further replies.
Top