Hi,
does someone know how to move files via lua??
Move files via Lua
Moderator: Moderators
- Anakin
- Master of the Force

- Posts: 4817
- Joined: Sat Sep 19, 2009 11:37 am
- Projects :: RC Side Mod - Remastered - SWBF3 Legacy
- Location: Mos Espa (germany)
- Teancum
- Jedi Admin

- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Move files via Lua
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.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Move files via Lua
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.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.
- Anakin
- Master of the Force

- Posts: 4817
- Joined: Sat Sep 19, 2009 11:37 am
- Projects :: RC Side Mod - Remastered - SWBF3 Legacy
- Location: Mos Espa (germany)
Re: Move files via Lua
it's a shame. I don't wanted to break someones work, i wanted to install my galactic conquest on the first start.
is it possible to write an external program/script and start it from the lua script?? so for example an bat file??
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- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Move files via Lua
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:
Hidden/Spoiler:
