This is where fixed bugs can be seen. Please do not post new bugs into this forum, it is purely to see what has been fixed and most topics will be locked.

Action Editor Order

Action Editor Order

Postby Shando » 02 May 2015, 00:55

Hi All,

I've noticed that the order that you add "Actions" in the Action Editor affects the way things should work.

For Example, if I add:

AI Sensor
Micro Script
Simple Character Controller

in this order, then I an animation created in the Micro Script "onInit" will not play.

However, if I change the order to:

AI Sensor
Simple Character Controller
Micro Script

then all works as expected.

Is there any way that you can build something into the background of Skyline that ensures that, no matter what order Actions are added, then they will always be called in the correct order? If not, can you please let me have some sort of matrix that shows what order Actions should be added??

Regards

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength http://www.lovehopestrength.co.uk
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: Action Editor Order

Postby SolarPortal » 02 May 2015, 10:29

Skyline already has a system for handling this ;) the rule is quite simple.
If you are handling data from actions in a script, then the postInit() should be used:

Code: Select all
function postInit()
end


It is called after all actions have been initialized regardless of order. It is the same for the microscript and the external script.

Since the microscript is an action, the "onInit(objID)" is called in order of action addition, but we too had a problem like this as well, so we created the postInit() routine. :) Since then, we have had no problems initialising code.

The other problem with the simple onInit() is whether one sceneEntity is initialised before another and referencing a script that has not yet been setup. (which is why the sceneScript exists, since it runs first out of all) The postInit routine is called after all sceneEntities have had their onInit() called.

It's also good as you get 2 stages of initialization which in some scripts is required for certain features.

Hope this helps :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
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: Action Editor Order

Postby Shando » 02 May 2015, 10:50

Hi SP,

Cool, I wondered where the postInit() function came from :)

Thanks

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength http://www.lovehopestrength.co.uk
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer


Return to Fixed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests