Page 1 of 1

customParams table for weapons and features

Posted: 24 May 2008, 15:18
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.

Re: customParams table for weapons and features

Posted: 24 May 2008, 15:29
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)

Re: customParams table for weapons and features

Posted: 24 May 2008, 15:42
by KDR_11k
Ah thanks, guess I didn't read the log with enough attention.

Re: customParams table for weapons and features

Posted: 24 May 2008, 19:42
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)?

Re: customParams table for weapons and features

Posted: 24 May 2008, 19:55
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);

Re: customParams table for weapons and features

Posted: 24 May 2008, 21:58
by Gnomre
Oh, description. Sorry about that.

Re: customParams table for weapons and features

Posted: 25 May 2008, 01:45
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.

Re: customParams table for weapons and features

Posted: 25 May 2008, 09:16
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.