Jump to content

LUA GetTerrain error


Gandi
 Share

Recommended Posts

Hi,

 

In my lua code i use

function class:GetTerrain(world)
local terrain
for terrain in iterate(world.terrains) do
 return terrain
end
end

 

in:

 

function class:CreateObject(model)
local object=self.super:CreateObject(model)
local terrain = class:GetTerrain(model.world)
end

 

But i get the error message:

"attempt to call global 'iterate' (a nil value)" at the for-loop.

 

this error occures after i loaded the map where a object of this type exists, or when im adding a new object to my map (but its gone when i placed a road-node once)

 

can anyone help me get rid of it?

Link to comment
Share on other sites

yes, im using linkedlist..

 

require("Scripts/class")
require("Scripts/Math/math")
require("scripts/linkedlist")

 

the strange thing is, that it also doesnt occur with my object after i placed a road-node.. (also if i deleted the road node again)

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