The Scorched3D weapons library is a LUA library that implements a set of Scorched3D functions that can create and manipulate weapons. All of the functions have the s3dweapon prefix i.e. use s3dweapon.functionname to call them.
Fires the weapon called weaponName. This weapon needs to have been previously defined in the accessories.xml file.
Example:
s3dweapon.fire_weapon(
"Nuke", -- Fire a "Nuke" weapon
playerId,
{x=0, y=0, z=0} -- At position 0,0,0
{x=0, y=0, z=0} -- With no speed or direction (velocity)
);
Creates an explosion at the given position. The explosion parameters are the same as the parameters to WeaponExplosion in the accessories.xml file.
Example:
s3dweapon.explosion(
playerId,
{x=0, y=0, z=0} -- At position 0,0,0
{
size = 4, -- The size of the explosion
hurtamount = 0, -- Doesn't hurt
deform = 2, -- Up
animate = false
}
);
Creates an napalm flow at the given position. The napalm parameters are the same as the parameters to WeaponNapalm in the accessories.xml file.
Example:
s3dweapon.napalm(
playerId,
{x=0, y=0, z=0} -- At position 0,0,0
{
napalmtime=8.0
napalmheight=0.2
steptime=0.1
hurtsteptime=2.0
hurtpersecond=1.0
numberstreams=1
effectradius=5
}
);