Page 1 of 1
Move files via Lua
Posted: Fri Feb 20, 2015 9:31 am
by Anakin
Hi,
does someone know how to move files via lua??
Re: Move files via Lua
Posted: Fri Feb 20, 2015 11:48 am
by Teancum
I doubt you can. As it would be an easy way to break someone's game programmers usually don't allow for things like this.
Re: Move files via Lua
Posted: Fri Feb 20, 2015 1:00 pm
by Maveritchell
Teancum wrote:I doubt you can. As it would be an easy way to break someone's game programmers usually don't allow for things like this.
More specifically, you can move/edit files with
Lua, you just can't with SWBF2's lua scripts. Most of the file I/O and OS libraries are disabled in SWBF2's mission scripts, in my experience.
Re: Move files via Lua
Posted: Fri Feb 20, 2015 1:05 pm
by Anakin
it's a shame. I don't wanted to break someones work, i wanted to install my galactic conquest on the first start.
Code: Select all
if ScriptCB_IsFileExist("..\\..\\addon\\RCM\\data\\_LVL_PC\\custom_gc_5.lvl") == 1 then
if ScriptCB_IsFileExist("custom_gc_5.lvl") == 1 then
print("RCM: WARNING - custom_gc_5.lvl already exists.")
else
print("RCM: custom_gc_5.lvl installed. Restart to apply changes.")
os.move("..\\..\\addon\\RCM\\data\\_LVL_PC\\custom_gc_5.lvl","custom_gc_5.lvl")
end
end
is it possible to write an external program/script and start it from the lua script?? so for example an bat file??
Re: Move files via Lua
Posted: Fri Feb 20, 2015 2:22 pm
by [RDH]Zerted
The only file creation/deletion you can do is through game saves and profile saves. Everything else has been disabled, likely to protect users. What you can do is create an installer that lets the user choose to install your galactic conquest. For reference, here's the v1.3 Inno Setup installation script: