Help with your scripting

entity.spawn()

entity.spawn()

Postby ant0N » 12 Mar 2015, 10:28

when using this function is the delay (approximately 0.1 and 0.5 seconds).
is there a faster way to spawned entity? What if you create once the object, and then to clone it? Will it be faster?
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: entity.spawn()

Postby SolarPortal » 12 Mar 2015, 10:40

yes, it will. However, have you tried running it in the end game/player?
The editor has to load the resources before using it, whereas the end game player already has the resources found. I think moreso the end game than the player as it uses the same as the editor.

Also try using, resource.prepareMesh("meshname");
http://www.chi-ad.com/Skyline/API/Lua/html/classresource.html#a3bfa32a1cdf152a306d9dc7a9d51264a

This should load the mesh into resources first for you, reducing the load on the spawn.
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: entity.spawn()

Postby ant0N » 12 Mar 2015, 10:58

Thank you! I think that is what I need.. I will check it today. :)
Sorry for my English. :)
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