customParams table for weapons and features

customParams table for weapons and features

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

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

customParams table for weapons and features

Post by KDR_11k »

Can weapons and features have custom params? If not I'll request that as a new feature :P. Custom params are very useful for avoiding tons of separate config files for gadgets and making the data pertaining to an object actually part of the object's definition files.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: customParams table for weapons and features

Post by trepan »

Code: Select all

r5907 | trepan | 2008-05-17 23:13:53 -0300 (Sat, 17 May 2008) | 24 lines
* Added the 'customParams' table to both featureDefs and weaponDefs
  (accessible via the lua FeatureDefs and WeaponDefs' tables)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: customParams table for weapons and features

Post by KDR_11k »

Ah thanks, guess I didn't read the log with enough attention.
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: customParams table for weapons and features

Post by Gnomre »

On a somewhat related note, can the 'name' weapon tag be included in the weapondef table (as humanName like the unitdef table does)?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: customParams table for weapons and features

Post by trepan »

LuaWeaponDefs.cpp:

Code: Select all

  ADD_STRING("name",        wd.name);
  ADD_STRING("filename",    wd.filename);
  ADD_STRING("description", wd.description);
  ADD_STRING("cegTag",      wd.cegTag);
  ADD_STRING("type", wd.type);
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: customParams table for weapons and features

Post by Gnomre »

Oh, description. Sorry about that.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: customParams table for weapons and features

Post by Argh »

Um, stupid question time... I see that there are two un-documented call-ins:

"Explosion",
"ShockFront",

What is returned by the Explosion call-in? A WeaponID, or a UnitID? It isn't documented anywhere yet. I'll go look it up in the source here in a bit, was wondering if anybody knew yet.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: customParams table for weapons and features

Post by KDR_11k »

gadgets.lua. Never seen ShockFront o_O. Explosion needs Script.SetWatchWeapon(weaponID,true) to work, look into the KP areadenial.lua for an example.
Post Reply

Return to “Lua Scripts”