Difference between revisions of "Loading Level Objects When Level Starts"

Jump to navigation Jump to search
m
no edit summary
(basic explanation, and mostly-done WIP example script)
 
m
Line 427: Line 427:




Create/define tables of level objects inside the Mod.LevelObjects... tables that are created by the main script.
Create/assign tables of level objects inside the Mod.LevelObjects... tables that are created by the main script.


*"Add" object constructors will create new, extra objects.
*"Add" object constructors will create new, extra objects.
Line 467: Line 467:


<code>Mod.LevelObjects.X.Y["Z"] = nil</code>
<code>Mod.LevelObjects.X.Y["Z"] = nil</code>


You must format the tables a little differently from what is used in (Object Type)Instances.lua's, since this function uses strings of tables rather than actual tables (the only way I found so far to avoid errors with persistent tables).
You must format the tables a little differently from what is used in (Object Type)Instances.lua's, since this function uses strings of tables rather than actual tables (the only way I found so far to avoid errors with persistent tables).
Line 505: Line 506:


Note that this does not yet work for Hulls or Decoration Meshes. Also, in order to work for Particle Emitters and Sound Emitters, the embedded (thing)EmitterInstances.lua's need to be edited so that they appear like:
Note that this does not yet work for Hulls or Decoration Meshes. Also, in order to work for Particle Emitters and Sound Emitters, the embedded (thing)EmitterInstances.lua's need to be edited so that they appear like:
  <nowiki>
  (thing)EmitterInstances =
(thing)EmitterInstances =
{  
{  
keep this table the way it is  
keep this table the way it is  
}
}
LoadModLevelObjects("(thing)Emitter")
LoadModLevelObjects("(thing)Emitter")</nowiki>
</div></div>
</div></div>


Navigation menu