Adding of a new weapon

4 replies [Last post]
Mapper720
Mapper720's picture
User offline. Last seen 7 years 51 weeks ago. Offline
Joined: 2012-07-14
Posts: 8

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.

nemo
nemo's picture
User offline. Last seen 1 week 3 days ago. Offline
Joined: 2009-01-28
Posts: 1861

$ 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 Smile

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

Mapper720
Mapper720's picture
User offline. Last seen 7 years 51 weeks ago. Offline
Joined: 2012-07-14
Posts: 8

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:

Quote:
Last two engine messages:
Establishing IPC connection to tcp 127.0.0.1:37756 ok
Incomplete or missing ammo scheme set (incompatible frontend or demo/save?)

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.

Koda
Koda's picture
User offline. Last seen 8 weeks 5 days ago. Offline
Joined: 2008-11-10
Posts: 215

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

Koda
Koda's picture
User offline. Last seen 8 weeks 5 days ago. Offline
Joined: 2008-11-10
Posts: 215

TODO: convert this thread in a proper wiki page

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]