Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,395

Change Map Example Added


Josh

4,965 views

 Share

A new map called "09-Change Map.map" has been added to the example game. This demonstrates how to use the new TriggerChangeMap.lua script to make your player progress from one level to the next.

 

In order to use this script, you must update your project with the new executables. Select the File > Project Manager menu to open the Project Manager, then press the "Update" button to update your project.

 

A new chunk of code has been added to App.lua to handle map changes. This code will be found in the main loop of the new App.lua script:

 --Handle map change

if changemapname~=nil then

 

--Clear all entities

self.world:Clear()

 

--Load the next map

Time:Pause()

if Map:Load("Maps/"..changemapname..".map")==false then return false end

collectgarbage()

Time:Resume()

 

changemapname = nil

end

 

Using the TriggerChangeMap script is easy. Just attach it to a CSG brush and set the name of the next map you want to load, without the path or file extension. For example, to load the map "Maps/09-Change Map.map" you just type in "09-Change Map" in the "Map Name" field. When the player collides with the brush, the new map will be loaded. You can make the brush a panel on the floor, or an invisible trigger field.

 

You must opt into the beta branch on Steam to get these changes.

  • Upvote 5
 Share

13 Comments


Recommended Comments

I just updated the beta branch so it will automatically copy the new files into your "MyGame" project.

Link to comment

after I updated leadwerks did not works as before.. texture didint load etc..

the autopistol bug was not solved at all...if I shoot on a dynamic entity or character th crash appear the same..

 

so i uninstalled all, clean registry and now reinstalled all..

 

Leadwerks come to work right but in Mygame folder there isnt the 09-changlevel map an the autopistol bug is here again...

 

I tried to update my project from project manager but it says that project is up to date

Link to comment

Right-click on Leadwerks in your steam library and chose properties the last tab has a dropdown that lets you opt-in. After this it should update Leadwerks automagically.

Link to comment

ok thanks Guppy... beta installed and now all works fine...autopistol ok and map change script ok..

 

thnanks...

 

thanks to you too josh

Link to comment

i get an StackHash_5861 error when trying to use it any ideas

 

You must opt into the beta branch on Steam to get these changes.
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...