Help with your scripting

object-oriented programming in lua

object-oriented programming in lua

Postby ant0N » 19 May 2013, 14:11

Hello! Wrote a small example of the use of OOP in Lua. ;)
http://yadi.sk/d/v3hvuwu44yS0o
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: object-oriented programming in lua

Postby SolarPortal » 19 May 2013, 19:07

Great Job! antON :D

i copied your script into a skyline microscript and replaced the print functions with sky.lprint and it works; apart from the sky.lprint only prints the first value returned. See the .lua file for the changes

This needs to be placed on the Wiki.
I have also added a copy into the "Asset Library/Scripts/'Example Scripts" and created an "Object Orientated Programming" folder with your script inside.
This will then be redistributed with every copy of skyline, if that is ok with you.

The below .lua file is the updated one that prints in skyline and is also the one placed in the Asset Library Scripts folder.
http://www.chi-ad.com/Skyline/downloads123/Scripts/OOPExample_antON.lua
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: object-oriented programming in lua

Postby ant0N » 20 May 2013, 10:50

Thank you! Only comments with a Russian accent will need to change. :lol:
Later I'll write more articles about LUA, for users SkyLine Engine. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 5 guests

cron