Help with your scripting

A way to spawn a preset?

A way to spawn a preset?

Postby kfrench1666 » 22 Mar 2013, 13:46

I found the entity.spawn function in the scripting docs online. This would suffice; but, I would have to programmatically add scripts, actions, etc for the object. However, I (so far) have not found a way to spawn a preset. Is this possible?
The idea is I can create an enemy character preset and spawn that on a timer.

I'm a Unity3D user currently (and will be my base reference for testing Skyline since that will be one of your major competitors). They have an Instantiate function which allows you to spawn a prefab (preset equivalent). So, I'm trying to mimic this functionality. And, in case you want to go poke around their docs, it's GameObject.Instantiate. :)


Thanks
kfrench1666
Skyline Novice
 
Posts: 2
Joined: 21 Mar 2013, 18:07

Re: A way to spawn a preset?

Postby StarFire » 22 Mar 2013, 17:53

Thank you for your request kfrench1666 :)

Yes we too have found ourselves needing to spawn a preset. As I have been developing the new NPC controllers the need to spawn a fully set up npc is needed more and more. With this in mind we are looking for an efficient way we can achieve preset spawning.

Hopefully it wont take to long to find a solution, I have added it to the feature request list for you ;)
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: A way to spawn a preset?

Postby Shando » 22 Mar 2013, 21:26

Hi kfrench1666,

I know it's not quite spawning a preset, but you can add scripts at runtime :)

Code: Select all
if ( ddd == 1 )
then
id = entity.spawn ( "Models_squareS_x", xxx, yyy, zzz, 0.32, 0.32, 0.32 )
else
id = entity.spawn ( "Models_octagonS_x", xxx, yyy, zzz, 0.725, 0.725, 0.725 )
end
      
entity.addScript ( id, "/SCC_Spawn.lua" )


Might help until presets can be spawned :?:

Regards

Shando
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 Lua Scripting

Who is online

Users browsing this forum: No registered users and 6 guests

cron