• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

About package in lua in sc4...?

Started by luoruidong, January 16, 2012, 11:13:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

luoruidong

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

luoruidong

#1
 :-[ 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....