Stingray Forum (Read Only)
Welcome to Autodesk’s Stingray Forums. Share your knowledge, ask questions, and explore popular Stingray topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Intro to Lua & C++ in Stingray

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
MatthewDoyleArt
1686 Views, 4 Replies

Intro to Lua & C++ in Stingray

Hi all,

 

A few weeks back I did a live Twitch stream that covered Lua and C++ in Stingray in considerable detail. This tutorial covers how to talk back and forth between Lua and a C++ DLL as well as Lua and Flow.

 


Matthew Doyle
Technical Marketing Manager

-----------------------------

Area Blog: Game Dev Blog
Watch me on Youtube: Youtube.com/MatthewDoyleArt
Check out some of my work at: MatthewDoyle.com
4 REPLIES 4
Message 2 of 5
cornelh
in reply to: MatthewDoyleArt

Hi Matthew,

 

Thank you for the video, it is greatly appreciated.

 

Cheers.

Message 3 of 5

Thanks for the video Matthew!

 

Just wanted to point out that if you are using Visual Studio on Windows 8 or 10 you can still compile LuaJIT without the Windows 7 SDK.

 

Open the start menu and type:

developer command prompt

 

This will launch a console. You then need to set the environment to 64bit so type:

cd VC

vcvarsall.bat x64

 

Then you're ready to proceed with building LuaJIT 🙂

 

stp1.png

 

stp2.png

 

 


Jerran Schmidt
Principal Engineer
Message 4 of 5

Hi jerran.schmidt,

 

Great auxiliary info! Thanks for the tip.


Matthew Doyle
Technical Marketing Manager

-----------------------------

Area Blog: Game Dev Blog
Watch me on Youtube: Youtube.com/MatthewDoyleArt
Check out some of my work at: MatthewDoyle.com
Message 5 of 5
Anonymous
in reply to: MatthewDoyleArt

Hello Matt I was going over your Intro to Lua for Stingray and I have a question.

 

I have a question about this:

 

local level = SimpleProject.level or nil                                     
local level_name = SimpleProject.level_name or nil
local Trig_Event = stingray.Level.trigger_event                         

 

function Project.on_level_load_pre_flow()
     local MyObject = AbeClass()   --getting a reference to my class
    MyObject:Foo("Hello Mate")
    MyObject:Bar(3,15)                                                            
   Trig_Event(level,"explode")  

end                                                            

 

 In the code above level returns nil and Trig_Event works fine even though the are both declared as local when I try and get references to SimpleProject and stingray.Level.trigger_event.    The code above only works if I don't make the variable level local. Why is that?  

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report