Where is the weapon code stored?
Sun, 2020-05-24 14:12
To start off, I didn't know whether to post this in support or content creations, so I asked it here.
My question is: Where is the weapon code stored?
The reason I ask this is that I am considering making my own weapons and submitting the code. I had searched my game files for the weapon code(that files I can open and read that is) and found nothing.
I wanted to take a look at your weapon code to get a feel for how you guys made the ones that exist now.
A little disclaimer: I have a little experience(very little, basically just starting) in python and while I am able to read Lua, and this is kind of new to me, but I want to try.
Generally the weapon handling is located in https://hg.hedgewars.org/hedgewars/file/tip/hedgewars/uGearsHandlersMess.pas (doStep procedures). There are also few other places that define common weapon properties and where are they located in configuration menus, but this file is enough if you want to try modifying behavior of existing weapons first. Unlike Lua scripts, it's necessary to be able to build Hedgewars from source to see those changes though.
Note some lua scripts do create new "weapons" by overriding existing weapon behaviour. For example you can hook into grenade spawn and delete to make a grenade that does other things like, oh, teleport stuff or create dirt/snow or somesuch. Naturally those weapons are specific to that script, although it is possible to chain lua scripts together like Gravity.lua does
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
Okay, thanks!
After taking a look, I'll admit, it'll take me a little to fully comprehend everything. (learning .pas)