Intro to Lua & C++ in Stingray

Intro to Lua & C++ in Stingray

MatthewDoyleArt
Alumni Alumni
1,806 Views
4 Replies
Message 1 of 5

Intro to Lua & C++ in Stingray

MatthewDoyleArt
Alumni
Alumni

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
Reply
Reply
Accepted solutions (1)
1,807 Views
4 Replies
Replies (4)
Message 2 of 5

cornelh
Alumni
Alumni
Accepted solution

Hi Matthew,

 

Thank you for the video, it is greatly appreciated.

 

Cheers.

Reply
Reply
0 Likes
Message 3 of 5

jerran.schmidt
Alumni
Alumni

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
Reply
Reply
Message 4 of 5

MatthewDoyleArt
Alumni
Alumni

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
Reply
Reply
0 Likes
Message 5 of 5

Anonymous
Not applicable

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?  

Reply
Reply
0 Likes