Quote: "That would only tell you if the current page number is a multiple of 50. Not particularly relevant"
Not sure if trolling or being serious...
@Dar13
@Dar13
@Dar13
@Dar13
@Dar13
You don't seem to be online so I'll leave this here. I hope you can help me with this issue I'm having in Urho3D.
I've added a LuaScriptInstance to a node in my scene in the editor:
The Lua script contains the following code:
CharacterController = ScriptObject()
print("Hello!")
function CharacterController:Update(timeStep)
print("Update")
end
Next, in my App, I make sure to create the LuaScript subsystem:
void App::Setup()
{
context_->RegisterSubsystem(new LuaScript(context_));
}
I load the scene with the following code:
void App::CreateScene()
{
ResourceCache* cache = GetSubsystem<ResourceCache>();
scene_ = new Scene(context_);
XMLFile* sceneXML = cache->GetResource<XMLFile>("Scenes/TestScene.xml");
scene_->LoadXML(sceneXML->GetRoot());
// set up camera
cameraNode_ = scene_->CreateChild("Camera");
Camera* camera = cameraNode_->CreateComponent<Camera>();
camera->SetFarClip(300.0f);
cameraNode_->SetPosition(Vector3(0.0f, 5.0f, -20.0f));
}
void App::SetupViewports()
{
Renderer* renderer = GetSubsystem<Renderer>();
Camera* camera = cameraNode_->GetComponent<Camera>();
Viewport* viewport = new Viewport(context_, scene_, camera);
renderer->SetViewport(0, viewport);
}
When I compile and run my Application, I see the output "Hello!" but I never see "Update":
[Sun Sep 6 14:48:15 2015] INFO: Opened log file Urho3D.log
[Sun Sep 6 14:48:15 2015] INFO: Created 1 worker thread
[Sun Sep 6 14:48:15 2015] INFO: Added resource path /home/thecomet/documents/programming/cpp/primal-equestria/bin/Data/
[Sun Sep 6 14:48:15 2015] INFO: Added resource path /home/thecomet/documents/programming/cpp/primal-equestria/bin/CoreData/
[Sun Sep 6 14:48:15 2015] INFO: Set screen mode 1024x768 windowed
[Sun Sep 6 14:48:15 2015] INFO: Initialized input
[Sun Sep 6 14:48:15 2015] INFO: Initialized user interface
[Sun Sep 6 14:48:15 2015] INFO: Initialized renderer
[Sun Sep 6 14:48:15 2015] INFO: Set audio mode 44100 Hz stereo interpolated
[Sun Sep 6 14:48:15 2015] INFO: Initialized engine
[Sun Sep 6 14:48:15 2015] INFO: Loaded Lua script Scripts/CharacterController.lua
Hello!
[Sun Sep 6 14:48:15 2015] INFO: Executed Lua script Scripts/CharacterController.lua
*** Exited normally ***
What's going on? Why isn't Update() being called? I tried some other built in methods like Start() or FixedUpdate() but they're also never called...
I spent seven hours vividly hallucinating then I woke up and ate the meat of other animals for energy, now I'm going to do something I don’t want to for eight hours for pieces of paper.