How can I make a small modification to a Lua script in a game?

How can I make a small modification to a Lua script in a game?

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
tankcommander
Posts: 9
Joined: 22 Apr 2017, 01:24

How can I make a small modification to a Lua script in a game?

Post by tankcommander »

I want to change one line in the game "Spring: 1944 test-4909-d25e4ff" which was automatically-downloaded through SpringLobby. I did it for a manually-downloaded game by simply modifying the file, but with the automatically-downloaded game I do not know where it is located. I want to implement this workaround. How can I do it? Where is the relevant file located?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: How can I make a small modification to a Lua script in a game?

Post by FLOZi »

In short, you can't.

Instead you can grab a copy of the file from https://github.com/spring1944/spring194 ... UI/Widgets and save it to your local user widgets folder, and it should overwrite the game copy for you.

You can also submit a pull request on github to s44 devs for the workaround if you get it working.
tankcommander
Posts: 9
Joined: 22 Apr 2017, 01:24

Re: How can I make a small modification to a Lua script in a game?

Post by tankcommander »

I placed it in ~/.spring/LuaUI/Widgets/gui_s44_supplyradius.lua and it does not work. What is the correct path?
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How can I make a small modification to a Lua script in a game?

Post by MasterBel2 »

If it's a widget that's part of the game, it needs to be in the game package itself. This would require uncompressing the game from sdz (zip) format and

If the game was downloaded by SL, this isn't possible because the "rapid" download system splits packages across "pool" files iirc. Afaik there's no way to reconstruct the full package from this.

If you want the latest version of the game, as in *the* latest, download the game from github as it stands, and play with a .sdd folder. Unfortunately this probably won't allow you to play multiplayer with others, unless they have the exact same file. To do this, set the modoptions & package it up as a .sdz file, and publish it on Spring files (unless you have a preferred method of distribution.) That way anyone can dl and play with you.

Did I make sense?

~MasterBel2
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: How can I make a small modification to a Lua script in a game?

Post by FLOZi »

I don't believe you are correct. S44 makes no effort to block user widgets so afaics it should work. Perhaps try changing the internal widget name and see if it appears in the F11 list
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: How can I make a small modification to a Lua script in a game?

Post by MasterBel2 »

FLOZi wrote:I don't believe you are correct. S44 makes no effort to block user widgets so afaics it should work. Perhaps try changing the internal widget name and see if it appears in the F11 list
Oops forgot about user widgets. :wink:
Post Reply

Return to “Help & Bugs”