Archive 17/01/2023.

Variant and ScriptObject

rogerdv

Im trying to test Variant and new ScriptObject support, but this code produces an error of No matching siganture for Variant(Test&):

class Test : ScriptObject
{
 void CallScript()
 {
  Variant t = Variant(this);
 }
}

What Im doing wrong here?

Azalrion

Just what sinoid said, requires a handle.

rogerdv

Then the error says this: Scripts/RPG/Entity.as:132,19 No matching signatures to ‘Variant(Entity@&)’

Azalrion

Angelscrips this passes a reference to a handle which isn’t compatible with the function signiture, you’d have to do something like:

MyObj@ obj = @this;
Variant["bla"] = obj;

At the moment.

rogerdv

Entity@ obj = @this; Variant["me"] = obj;

[Mon Jan 5 07:13:46 2015] ERROR: Scripts/RPG/Entity.as:133,12 Expected ']' [Mon Jan 5 07:13:46 2015] ERROR: Scripts/RPG/Entity.as:133,12 Instead found '<string constant>'

But Variant t = Variant(obj); works