I write my urho app on 2 different devices 3 different OSs.
Mainly on ubuntu 14.10. on my tower with windows 7 dual boot. second most on my laptop ubuntu 14.04.
So, I was having some issues last night with the scriptObject, that was fixed by setting the instance to reference my main.as class instead of just the class file itself.
Everything works, both on 14.10 and windows7. I did some extra work after getting it to do what I wanted, all still works.
This morning on the train, on the laptop, tried the same code, and the same urho and it wasnt working. It didnt error, but what I had working was not working.
I redownloaded urho, re downloaded my repo, and nothing was working still.
The code is actually here:
github.com/ghidra/urho_shmup
at the Nov 23, 2014 “faster projctile” commit.
forgive me it’s messy.
In a nut shell:
main.as inits an inputplayer.as class to handle controls.
it also instantiates my character.xml, that has a character.as script object.
character.as extends pawn.as extends actor.as
playerinput is given the node that is spawned that has the character scriptobject.
it then uses that to pass functions to it for controls.
And that is where it doesnt work on the laptop, but does on my desktop.
at this function:
void set_controlnode(Node@ control_node){
Pawn@ pawn = cast<Pawn>(control_node.scriptObject);
//Character@ pawn = cast<Character>(control_node.scriptObject);
//Pawn@ pawn = cast<Pawn>(control_node.GetScriptObject("Character"));
if (pawn !is null){
//Print("we have something to control");
node_ = control_node;
}
}
It doesnt error, because i am doing the null check.
And if I Print numComponents it sees them all, or if I grab the components[1], it knows it’s a scriptObject. But it isnt getting passed the null check.
So, is this a bug, or am i doing someting wrong here? Since it works in 2 different places, but not in 1.
Thanks
EDIT:
I’m also not sure that it isnt some other garbage that is in my code that is causing conflicts, but I’m throwing it out there.