Adding of a new weapon
Tue, 2013-01-22 07:06
I want to add some new weapons into the game.
I've explored several sources and managed to add a new column to weapon table and to change some weapons' properties (e.g. I changed air bombs to hellish bombs in AirStrike).
So, how can I add something as NEW weapon? Which file should be changed for it?
Free software - for free people!
The Combine theme for Hedgewars.
$ grep -il portal *.pas *.inc | xargs
uAIAmmoTests.pas uGearsHandlersRope.pas uGearsHedgehog.pas uGearsList.pas uGears.pas uGearsRender.pas uTypes.pas uVariables.pas GSHandlers.inc
... so. above wasn't the best choice due to "portalcounter"
$ grep -il molotov *.pas *.inc | xargs
uAIAmmoTests.pas uGearsHedgehog.pas uGearsList.pas uGears.pas uGearsRender.pas uSound.pas uTypes.pas uVariables.pas GSHandlers.inc
better list
Anyway, yeah. Seriously, searching for a weapon name is best way right now to see what stuff it touches, and how.
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
Thanks, but now I have a new problem: I've managed to compile and launch the game, but I can't begin to play: I get a error:
What does it mean? As I understand, there is some problem in the weapon's table, but how can I fix it?
Free software - for free people!
The Combine theme for Hedgewars.
you also need to add a number to the long strings in hwconsts.h
#define AMMOLINE_DEFAULT_QT "9391929422199121032235111001201000000211110101011111101"
this provides the initial quantity for each weapon
#define AMMOLINE_DEFAULT_PROB "0405040541600655546554464776576666666155510101115411101"
this defines the probabilty % to find the weapon in crates
#define AMMOLINE_DEFAULT_DELAY "0000000000000205500000040007004000000000220000000600000"
this tells how many turns have to pass before the weapon can be used
#define AMMOLINE_DEFAULT_CRATE "1311110312111111123114111111111111111211111101111111101"
this sets how many pieces of weapon you will find in a crate
TODO: convert this thread in a proper wiki page