Difference between revisions of "Loading Level Resources With Lua"

Jump to navigation Jump to search
m
 
Line 14: Line 14:
For example, if you execute this code, then whenever you define swapLevel as an internal level name ("Graveyard","Barrens",etc) the next level's resources will all be replaced with the ones from Level_''swapLevel'':
For example, if you execute this code, then whenever you define swapLevel as an internal level name ("Graveyard","Barrens",etc) the next level's resources will all be replaced with the ones from Level_''swapLevel'':


<div class="toccolours mw-collapsible mw-collapsed">
{{Collapse|1=<pre>
<div style="font-weight:bold;line-height:1.6;">Example code mod for swapping resources between levels</div>
  swapLevel = ""
<div class="mw-collapsible-content">
 
<nowiki>swapLevel = ""
    
    
   function QueueResourcesForLoad( resManager, resTbl, alloc )
   function QueueResourcesForLoad( resManager, resTbl, alloc )
Line 60: Line 57:
   end
   end
   end
   end
  </nowiki>
</pre>|2=Example code mod for swapping resources between levels}}
</div></div>


"Script" resources are Lua files embedded in Journey.exe, but all other resources are loaded from the game folders.
"Script" resources are Lua files embedded in Journey.exe, but all other resources are loaded from the game folders.
Line 72: Line 68:


Here is a sample of the contents of resTbl as it gets passed to QueueResourcesForLoad:
Here is a sample of the contents of resTbl as it gets passed to QueueResourcesForLoad:
<div class="toccolours mw-collapsible mw-collapsed">
 
<div style="font-weight:bold;line-height:1.6;">Format of resource tables loaded when level starts</div>
{{Collapse|1=<pre>
<div class="mw-collapsible-content">
{  
<nowiki>{  
  {
  {
   class = "ScreamBank",
   class = "ScreamBank",
Line 163: Line 158:
   source = "Level_Graveyard/DuneColorShadow.dds"
   source = "Level_Graveyard/DuneColorShadow.dds"
  }  
  }  
}</nowiki></div></div>
}
</pre>|2=Format of resource tables loaded when level starts}}
 
==Adding/Modifying Individual Level Objects ==
==Adding/Modifying Individual Level Objects ==
'''Important things to remember'''
'''Important things to remember'''

Navigation menu