wickedly kick it, I would definitely rather use XML for that job. As your using Lua for main scripting, I think setting loads of variables into it will add lots of overhead.
Its thenerds decision anyway. That method does work quite well. But there are better ways to do it. I cant stand the thought of using lua for everything.
i would rather use them both together, you can also add scripts in too.
<weapon>
<name>Pistol</name>
<maxammo>7</maxammo>
<damage>120</damage>
<onshoot>
if ammo>0
ShootBullet(this.position,this.direction,velocity)
MakeMuzzleFlash(this.position,this.direction)
dec ammo
end
</onshoot>
</weapon>
Or, if you like making packs of different filetypes, you can put them all into 1 file.
<pack>
<weapon>
<name>Pistol</name>
<maxammo>7</maxammo>
<damage>120</damage>
<projectiletype>Bullet</projectiletype>
<onshoot>
if ammo>0
ShootBullet(this.position,this.direction,velocity)
MakeMuzzleFlash(this.position,this.direction)
dec ammo
end
</onshoot>
</weapon>
<weapon>
<name>Rocket Launcher</name>
<maxammo>1</maxammo>
<damage>200</damage>
<projectiletype>Rocket</projectiletype>
<onshoot>
if ammo>0
ShootBullet(this.position,this.direction,velocity)
MakeMuzzleFlash(this.position,this.direction)
dec ammo
end
</onshoot>
</weapon>
<projectiletype>
<name>Bullet</name>
<model>none</model>
<makesmoke>no</makesmoke>
<speed>100</speed>
<onupdate>
--Moveprojectileforward
--Check for collision
</onupdate>
</projectiletype>
<projectiletype>
<name>Rocket</name>
<model>rocket.x</model>
<makesmoke>yes</makesmoke>
<speed>10</speed>
<onupdate>
--Moveprojectileforward
--Add a little spin
--Check for collision, if collision make an explosion
</onupdate>
</projectiletype>
</pack>