SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => SimCity 4 General Discussion => General Custom Content Discussion => Topic started by: luoruidong on January 16, 2012, 11:13:50 PM

Title: About package in lua in sc4...?
Post by: luoruidong on January 16, 2012, 11:13:50 PM
That's .... I just want to load some package into the lua environment of sc4. But is strange that the package library seems it don't exist .....

However the require function exists, but how can i set the package.cpath to let it work???

Or how can i load package(dll) in sc4... :bomb:


isit="no"
if require then
isit="yes"
end
package.path = ""
package.cpath="f:\\?.dll"
require("iuplua")
--b = iup.Alarm("IupAlarm Example", "File not saved! Save it now?" ,"Yes" ,"No" ,"Cancel")


'isit' is 'yes' and the error come to

package.path = ""

(I test it by cityplanning window and test the breakpoint by "game.trigger_event(game_events.kTEST1) and also printout test msg in cityplanning window")
and if i add 'package={}' before there
the error come to

require("iuplua")


Of crouse I'm sure these code work well in other lua environment......


Don't mind my Chinglish ;D
Title: Re: About package in lua in sc4...?
Post by: luoruidong on January 17, 2012, 12:40:53 AM
 :-[ Sorry , I notice the lua in sc4 is v5.0 just now
It doesn't has package library at all....
However I set LUA_PATH and it can't work ,too..
Let me have a look then.....

Then...why loadlib() can't work too....