Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSoulSharer

Posted 13 June 2013 - 12:16 PM

Problem #1 - Solution

 

I've got the answer on the first problem, thanks to Andreas, so I will post it here in case someone will face the same thing.

 

When you registered the properties with @ you were actually giving the address of the local pointer to the object. You then changed the object the pointer was referring to when registering the other properties, but you still registered the same address to the pointer with AngelScript. This caused all properties to refer to the same object.

Registering properties with @ should be used if the handle can be reassigned by the script to another object. Without the @ the property cannot be reassigned and will refer to the object you've registered throughout the execution.

 

Now it makes perfect sense.

Still not sure about problem #2 though. If I solved it right or is there another way which I didn't notice?


#3SoulSharer

Posted 13 June 2013 - 12:14 PM

Problem #1 - Solution

 

I've got the answer on the first problem, thanks to Andreas, so I will post it here in case someone will face the same thing.

 

When you registered the properties with @ you were actually giving the address of the local pointer to the object. You then changed the object the pointer was referring to when registering the other properties, but you still registered the same address to the pointer with AngelScript. This caused all properties to refer to the same object.

Registering properties with @ should be used if the handle can be reassigned by the script to another object. Without the @ the property cannot be reassigned and will refer to the object you've registered throughout the execution.

 

Now it makes perfect sense, though I wonder how it worked at all in this case.

Still not sure about problem #2


#2SoulSharer

Posted 13 June 2013 - 12:14 PM

Problem #1 - Solution

 

I've got the answer on the first problem, thanks to Andreas, so I will post it here in case someone will face same thing.

 

When you registered the properties with @ you were actually giving the address of the local pointer to the object. You then changed the object the pointer was referring to when registering the other properties, but you still registered the same address to the pointer with AngelScript. This caused all properties to refer to the same object.

Registering properties with @ should be used if the handle can be reassigned by the script to another object. Without the @ the property cannot be reassigned and will refer to the object you've registered throughout the execution.

 

Now it makes perfect sense, though I wonder how it worked at all in this case.

Still not sure about problem #2


#1SoulSharer

Posted 13 June 2013 - 12:13 PM

Problem #1 - Solution

 

I've got the answer from Andreas over email on the first problem, so I will post it here in case someone will face same thing.

 

When you registered the properties with @ you were actually giving the address of the local pointer to the object. You then changed the object the pointer was referring to when registering the other properties, but you still registered the same address to the pointer with AngelScript. This caused all properties to refer to the same object.

Registering properties with @ should be used if the handle can be reassigned by the script to another object. Without the @ the property cannot be reassigned and will refer to the object you've registered throughout the execution.

 

Now it makes perfect sense, though I wonder how it worked at all in this case.

 

Still not sure about problem #2


PARTNERS