con un clic
springrts-widget
Widget file structure to be used in SpringRTS/Recoil engine games
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Widget file structure to be used in SpringRTS/Recoil engine games
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
| name | springrts widget |
| description | Widget file structure to be used in SpringRTS/Recoil engine games |
Description: Widget file structure to be used in SpringRTS/Recoil engine games
When creating or editing lua widget files, commonly within the luaui/widget folder and subfolders.
Spring.GetUnitTeam(unitID), are called "callouts".springrts-wiki/Lua_Callins.html. Unsynced callins should be preceded with widget:, eg: widget:DefaultCommand(type, id).springrts-wiki/LuaTutorials__InterCommunications.html.Checking similar pre-existing widgets within the luaui/widgets folder is a great option. Online docs might be hard to find and access, there's a dump to the official SpringRTS docs within /springrts-wiki. For general scripting, /springrts-wiki/Lua_Scripting.html is a good starting point.
/springrts-wiki/Lua_Tutorial_GettingStarted.html has some basic examples to be used as a reference as well.
Spring.* calls at the top, right after widget:GetInfo() - the "local variables declaration section". For instance, instead of using Spring.GetMyTeamID, add a local spGetMyTeamID = Spring.GetMyTeamID at the local variable declaration section and later reference it like, eg: if teamID ~= spGetMyTeamID().return commands should always be in a single line, for legibility. So instead of:
if teamID ~= Spring.GetMyTeamID() then return end
make it:
if teamID ~= Spring.GetMyTeamID() then
return end
local PI = 3.1416gamedata/taptools.lua, eg: IsValidUnit, include the file in the widget (using springrts's specific include command - VFS.Include("gamedata/taptools.lua") - before the variable declaration section) and use it instead.taptools.lua is included, make sure to not "re-include" the cached Spring.* commands, like spGetUnitPosition, in the widget file.function widget:Initialize()