Hello,
I want to use Lua with Urho3DPlayer only (just scripting).
I’m using Arch Linux 64 bits, with pre-compilated Urho3D shared libs.
I’ve written a minimal program for this, but i’ve some questions about the output of Urho3DPlayer command execution.
Let’s see the script for beginning
function Start()
graphics.windowTitle = "hello world"
SubscribeToEvent(“KeyUp”,exit_test)
end
function exit_test(eventType,eventData)
local key = eventData[“Key”]:GetInt()
--eventType and eventData are userdata
if key == KEY_ESCAPE then
engine:Exit();
end
end
So it’s just a black window with a title, waiting for ESC key to be pressed.
I launch it this way:
Urho3DPlayer helloworld.lua -w -p .
the “-p .” parameter is for avoiding using the Data and CoreData from the sample directory.
So i’m on my own, no data, no resources, just the script.
[Wed Sep 20 15:52:33 2017] INFO: Opened log file /home/zakk/.local/share/urho3d/logs/helloworld.lua.log
[Wed Sep 20 15:52:33 2017] INFO: Created 3 worker threads
[Wed Sep 20 15:52:33 2017] INFO: Added resource path /home/zakk/sources/Urho3D-1.7-Linux-64bit-SHARED/usr/local/bin/
[Wed Sep 20 15:52:33 2017] INFO: Added resource path /home/zakk/sources/Urho3D-1.7-Linux-64bit-SHARED/usr/local/bin/…/share/Urho3D/Resources/Autoload/LargeData/
[Wed Sep 20 15:52:33 2017] INFO: Set screen mode 1024x768 windowed monitor 0
[Wed Sep 20 15:52:33 2017] INFO: Initialized input
[Wed Sep 20 15:52:33 2017] INFO: Initialized user interface
[Wed Sep 20 15:52:33 2017] ERROR: Could not find resource Textures/Ramp.png
[Wed Sep 20 15:52:33 2017] ERROR: Could not find resource Textures/Spot.png
[Wed Sep 20 15:52:33 2017] ERROR: Could not find resource Techniques/NoTexture.xml
[Wed Sep 20 15:52:33 2017] ERROR: Could not find resource RenderPaths/Forward.xml
[Wed Sep 20 15:52:33 2017] INFO: Initialized renderer
[Wed Sep 20 15:52:33 2017] ERROR: Could not initialize audio output
[Wed Sep 20 15:52:33 2017] INFO: Initialized engine
[Wed Sep 20 15:52:34 2017] INFO: Loaded Lua script helloworld.lua
[Wed Sep 20 15:52:34 2017] INFO: Executed Lua script helloworld.lua
But with only this little script, i have a lot of questions !
-
what are those Added resource path , i’ve specified “-p .” for avoiding this
-
Urho3DPlayer tries to load Textures, a Technique and a RenderPath.
I’ve looked at Urho3DPlayer.cpp sourcefile, and i guess it comes from the Urho3D engine itself.
What if those files are not present ? Can i put code in the script for avoiding their loading ?
For what i see, it doesn’t seem to block script execution, which wait for ESC key press as it should do.
- What is the error could not initialize audio output ? I don’t see it when i run the Lua samples (but couldn’t find in the sample where were the sound init).
I think it’s all for the moment, but quite a lot for a beginning!
Thank you for reading
Zakk.