Go Back   the Magicball Network > Forums > LBA Projects > Little Script Adventure
Buy LBA1/Relentless from GOG.com Buy LBA1/Relentless from DotEmu Buy LBA2/Twinsen's Odyssey from DotEmu Buy LBA2/Twinsen's Odyssey from GOG.com Buy Little big Adventure from GOG.com or DotEmu Buy Little big Adventure 2 from DotEmu or GOG.com

Welcome to the Magicball Network.

You are currently viewing our site as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Little Script Adventure An open-source 3D engine with assets and tools for all future LBA fan-games.

Reply
 
Thread Tools
  #1  
Old 2010-09-20, 10:42
Brafil Brafil is offline
Magic Level: Red Ball
 
Join Date: Jun 2010
Posts: 161
Scripting

Alright guys, we should maybe discuss scripting in this thread. So far the language is lua 5.x, embedded in the source.

IMPORTANT: Scripting may do nasty things. File I/O and module loading HAS to be disabled. This is actually easy to do, we won't supply those modules.

Data structures:
For safety, the script doesn't have access to the data structures used by the game. Instead, it knows the objects' IDs, which are fully opaque but enable the scripter to manipulate everything they need.

There are currently four manipulatable data structures:
- Conditions: Delay the execution of actions to a certain point in time
- Objects: Basic, script-driven models
- Characters: Standard characters

High-level data structures:
pos(x, y[, z]): Position at tile x, y, z. Equivalent to [ x = x, y = y, z = z ].
pos(object): Current position of object. *
area(x1, y1, x2, y2): All positions from x1, y1 to x2, y2. Equivalent to [ [ x1, y1 ], [ x2, y2 ] ].

* pos returns the position of the object at the time it's executed. All functions accepting pos also accept object IDs, which calculates the object's position every frame.

High-level functions:
char(filename, pos, rot): Load character with mesh filename at position. Returns a new ID.
object(filename, pos, rot): Loads a basic object, similar to char.
trigger(condition, function[, times])
: function to be called when condition is true (at most times times)

TBC

Last edited by Brafil; 2010-09-20 at 17:51.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:32.




News Feed
Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2016, the Magicball Network