
customParams table for weapons and features
Moderator: Moderators
customParams table for weapons and features
Can weapons and features have custom params? If not I'll request that as a new feature
. 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
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
Ah thanks, guess I didn't read the log with enough attention.
Re: customParams table for weapons and features
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
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
Oh, description. Sorry about that.
Re: customParams table for weapons and features
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.
"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
gadgets.lua. Never seen ShockFront o_O. Explosion needs Script.SetWatchWeapon(weaponID,true) to work, look into the KP areadenial.lua for an example.