Gandi Posted April 22, 2012 Posted April 22, 2012 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? Quote
macklebee Posted April 22, 2012 Posted April 22, 2012 are you using: require("scripts/linkedlist") that is needed for the iterate() function... and its the reason why it doesn't occur when you place a road node, as it uses the linkedlist.lua script Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Gandi Posted April 22, 2012 Author Posted April 22, 2012 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) Quote
Daimour Posted April 23, 2012 Posted April 23, 2012 (edited) It looks like something wrong with including "linkedlist". Try to copy/paste this line from road_node.lua: require("Scripts/linkedlist") And check paths. Edited April 23, 2012 by Daimour Quote
Gandi Posted April 23, 2012 Author Posted April 23, 2012 strange.. it didnt work when i copied it from the forum, but copying it from road_node worked fine... Quote
Recommended Posts
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.