[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/feed.php on line 173: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
[phpBB Debug] PHP Warning: in file [ROOT]/feed.php on line 174: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3906)
Skyline Forums Skyline Game Engine Community Forums 2016-12-16T22:21:36+01:00 https://forum.aurasoft-skyline.co.uk/feed.php?f=14&t=1586 2016-12-16T22:21:36+01:00 2016-12-16T22:21:36+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=9893#p9893 <![CDATA[Re: start using scripts]]>

Statistics: Posted by StarFire — 16 Dec 2016, 22:21


]]>
2016-12-12T20:06:59+01:00 2016-12-12T20:06:59+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=9842#p9842 <![CDATA[Re: start using scripts]]>

Statistics: Posted by planetX — 12 Dec 2016, 20:06


]]>
2016-12-12T20:01:07+01:00 2016-12-12T20:01:07+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=9840#p9840 <![CDATA[Re: start using scripts]]>
In fact, in c++ we automatically make it include the 2 .lua files found in the Data/Scripts folder. 1 for the options screen for players and a quick utility function addition to improve scripting in scene scripts.

It should work fine :)

Statistics: Posted by SolarPortal — 12 Dec 2016, 20:01


]]>
2016-12-12T19:49:11+01:00 2016-12-12T19:49:11+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=9839#p9839 <![CDATA[Re: start using scripts]]> Statistics: Posted by planetX — 12 Dec 2016, 19:49


]]>
2016-12-12T19:41:16+01:00 2016-12-12T19:41:16+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=9837#p9837 <![CDATA[Re: start using scripts]]>
Most of the time you want a scene script to run before most entities, if they are an entity, then they will update in the order of their ids which may lead to incorrect results if you are dependant on one thing happening before the others, so bear that in mind. You could always adjust the scene file manually in XML to put these entities at the top so they are loaded in first, just backup first :)

Statistics: Posted by SolarPortal — 12 Dec 2016, 19:41


]]>
2016-12-12T19:28:15+01:00 2016-12-12T19:28:15+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=9835#p9835 <![CDATA[Re: start using scripts]]>

So to recap:

Scene scripts can only be internal - The intention was for a basic scene setup such as ui and global vars, but small games could also use this as a main game script.

Using an empty node or model with invisible material for an external scene script and not using the object in any way other than to add the external script to the entity list.This is a great way to manage a larger project.
object 1 named scene_ui with external ui.lua script.
object 2 named scene_game with external game.lua script.
object 2 named scene_gameOver with external gameOver.lua script etc etc

NOTE: We have plans to add an extra panel in the script editor showing a clickable list of all scripts in the scene, either includes, external or micro scripts.

To include a *.lua file to any script you can call sky.include("myScript.lua");

Hope this helps. :D

Statistics: Posted by StarFire — 12 Dec 2016, 19:28


]]>
2016-12-12T17:36:50+01:00 2016-12-12T17:36:50+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=9833#p9833 <![CDATA[Re: start using scripts]]>
Let's say I want the Scene Script being external, or having more than one Scene Scripts... is that possible?

I was thinking on adding a cube mesh, make it invisible, and link an External Script to it in order to use it as a Scene Script, where I can manage a bunch of entities, but not being directly linked to any of them. Repeat that process for every External Script I want... Is that ok?

I also was wondering if it's possible to import/include some External Scripts into the Scene Script... that would be great.

To be honest, I don't like the concept of using Microscripts because there is a moment, when the level gets complicated, that I think is gonna be a PITA to check and debug every piece of code if they are flying around inside every object. There's also a risk of losing the code if I delete the object. So I'd like to have all the logic grouped somehow.

Or maybe this idea is stupid... how do you guys manage that?

Statistics: Posted by planetX — 12 Dec 2016, 17:36


]]>
2016-03-28T13:05:21+01:00 2016-03-28T13:05:21+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=8358#p8358 <![CDATA[Re: start using scripts]]>

Statistics: Posted by SolarPortal — 28 Mar 2016, 13:05


]]>
2016-03-28T12:41:12+01:00 2016-03-28T12:41:12+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=8357#p8357 <![CDATA[Re: start using scripts]]> Statistics: Posted by cassius_b — 28 Mar 2016, 12:41


]]>
2016-03-28T12:10:05+01:00 2016-03-28T12:10:05+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=8355#p8355 <![CDATA[Re: start using scripts]]>
You can get started with scripting in several different ways:
- Micro Scripts: These are applied to the entity in the scene which may contain a model, light or camera. They bring in the id of the object they are attached to and are the general way of working. Micro scripts cannot be shared across entities unless you copy / paste the code or use the asset manager to drop a .lua file on and convert to microscript. There is no file with the script as microscripts are saved with the scene and will be the most common script type you use alongside the scene script.

- External Scripts: These are similar to microscripts but all the code in stored in a .lua file and must be added to the resources in order to work. These are great for sharing scripts across many entities that do the same thing. Combined with the Dynamic Properties, you can use 1 script across many entities but change the properties on each entity through the Dynamic Properties Panel and using the Custom property setups.

- Scene Script: This is quite self explanatory. It is a script that is first to run in every scene and there is only ever one of them. This can be accessed by right clicking in the scene and bringing up the context menu. Choose "Lua - Scene Script" at the top of the menu. Use this script to control menus and level loading, but it is also possible to do what you want with it.
Note: The scene script does not contain an ID like the other entities since it is not attached to anything in the scene; its actual id is -9.

Applying a Microscript:
First select the entity you wish to apply the script to and then apply/edit a Microscript by either:
- Right clicking in the scene and bring up the context menu, click on the "Lua - Add Microscript" button.
- Or attach the microscript action using the action editor which can also be found on the right click.
- Edit the script from the right click context menu "Lua - [Edit] Micro Script" or from the entities property panel where you will find the microscript action attached to the entity.

Applying an External Script:
First select the entity you wish to apply the script to and then apply/edit a External Script by:
- Right Cliking in the scene and open the menu "Lua - Add External Script", then choose whether you want to create a new script or open an existing one.
- Since the External Script is not an action, you have to remove the script from that sub menu also.

Note: Selecting the entity and dragging a lua file from the asset manager onto the entity will apply the script either as a microscript or external script of your choice.

I hope this helps you :)

Check out Tatties Video Tutorial: Lua Editing on the second to last row in the middle of this list of videos to see the menu being used to apply the scripts:

Statistics: Posted by SolarPortal — 28 Mar 2016, 12:10


]]>
2016-03-28T11:37:45+01:00 2016-03-28T11:37:45+01:00 https://forum.aurasoft-skyline.co.uk/viewtopic.php?t=1586&p=8354#p8354 <![CDATA[start using scripts]]> I am new to this engine.I have taken a look at scripting and I don't think learning lua will be a problem but how to start IS the problem.
Lets say I want a simple box object to rotate when the player gets near it, do I attach a script to the box somehow or what.
I could use a simple example on this.
Its not syntax I am concerned with, its how to get INTO scripting from the editor I need.

Statistics: Posted by cassius_b — 28 Mar 2016, 11:37


]]>