CMD table.

CMD table.

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

CMD table.

Post by smoth »

What builds this table?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: CMD table.

Post by jK »

engine?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: CMD table.

Post by smoth »

CMD is kinda hard to track down via find in files. I'll get the latest source and try later today. If anyone else can narrow my search down I'd appreciate it.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: CMD table.

Post by FLOZi »

Not entirely clear what you're after without context, but

https://github.com/spring/spring/blob/d ... nstCMD.cpp
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: CMD table.

Post by smoth »

in lua there is a table CMD

it stores command name and id, so a made up example:

PATROL_FOR_YORDLES with an id 9001

in cmd there are 2 entries for this command

PATROL_FOR_YORDLES = 9001,
9001 = PATROL_FOR_YORDLES,
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: CMD table.

Post by FLOZi »

Then my link is what you're after, or at least the starting point.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: CMD table.

Post by smoth »

yeah definitely the bit I wanted

#define PUSH_CMD(cmd) LuaInsertDualMapPair(L, #cmd, CMD_ ## cmd);

LuaInsertDualMapPair(L, #cmd, CMD_ ## cmd); is in the lua utilities file blah blah etc.

good I can complete that part.
Post Reply

Return to “Lua Scripts”