Jump to content

Lua change map


YouGroove
 Share

Recommended Posts

I have that code in Main App.lua :

 

function App:Start()

--Set the application title
self.title="test" 

... 
....

--Load a map
local mapfile = System:GetProperty("map","Maps/start.map")
if Map:Load(mapfile)==false then return false end

return true
end


function App:Loop()


if self.window:KeyDown(Key.L) then
   Map:Load("Maps/start2.map")
   Time:Delay(1000)
end

...
...


return true
end

 

The problem is in the app loop calling : Map:Load("Maps/start2.map")

says unknown function ? what did i missed laugh.png ?

Stop toying and make games

Link to comment
Share on other sites

I even tried on start function :

 

--Load a map
local mapfile = System:GetProperty("map","Maps/start.map")

mapfile = System:GetProperty("map","Maps/start2.map")
Map:Load(mapfile)
Time:Delay(1000)

local mapfile = System:GetProperty("map","Maps/start.map")

if Map:Load(mapfile)==false then return false end


return true

 

The debugger says function unknown with "start.map"

I put some delay before loading start.map after loading start2.map.

 

 

--------------

Another annoying thing :

 

I tried also to simply load map "start2.map", but it always load "start.map" because "start.amp" is displayed in LE3 editor i think.

So when launching debugger, LE3 will laucnh the map on the editor it seems and not the one you defined on "App.lua"

Stop toying and make games

Link to comment
Share on other sites

I have that code in Main App.lua :

 

function App:Start()

--Set the application title
self.title="test"

...
....

--Load a map
local mapfile = System:GetProperty("map","Maps/start.map")
if Map:Load(mapfile)==false then return false end

return true
end


function App:Loop()


if self.window:KeyDown(Key.L) then
Map:Load("Maps/start2.map")
Time:Delay(1000)
end

...
...


return true
end

 

The problem is in the app loop calling : Map:Load("Maps/start2.map")

says unknown function ? what did i missed laugh.png ?

I copied and pasted this into the script editor to run it, but since it is not an actual runnable script I am not pursuing my investigation any further at this time.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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.

 Share

×
×
  • Create New...