Adding a new weapon
- Retributer
- Greenhorn
- Posts: 14
- Joined: 15 Jan 2013, 12:15
Adding a new weapon
Hey everyone !
I've recently learned how to modify existing weapons using the weapons.txt file, but I thought it would be better to add new weapons instead of just changing the existing ones. I tried editing a few files like research.txt, weapons.txt or names.txt by simply copying the machinegun and giving it another name, this way I would have two weapons that would do exactly the same thing but with different names, just to see if it would work. Unfortunatly, it doesn't, the game just crashed when I started a skirmish game.
So I need your help, what files do I need to edit to create a weapon, and what do I need to change ?
I've recently learned how to modify existing weapons using the weapons.txt file, but I thought it would be better to add new weapons instead of just changing the existing ones. I tried editing a few files like research.txt, weapons.txt or names.txt by simply copying the machinegun and giving it another name, this way I would have two weapons that would do exactly the same thing but with different names, just to see if it would work. Unfortunatly, it doesn't, the game just crashed when I started a skirmish game.
So I need your help, what files do I need to edit to create a weapon, and what do I need to change ?
Re: Adding a new weapon
Show us what you did and/or read how exactly it crashed.
Most likely forgot to add the name into names.txt.
Most likely forgot to add the name into names.txt.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
- Retributer
- Greenhorn
- Posts: 14
- Joined: 15 Jan 2013, 12:15
Re: Adding a new weapon
Ok, first off, here are the two errors it returns when I start a skirmish game :
http://imageshack.us/f/203/errorhf.png/
Then the four files I edited :
/stats/weapons.txt :
http://imageshack.us/f/12/weaponsi.png/
there are a few values missing on the right, but they're all the same as MG1Mk1.
/stats/weaponsounds.txt :
http://imageshack.us/photo/my-images/40/soundsf.png/
/stats/research/multiplayer/research.txt :
http://imageshack.us/photo/my-images/16/researchz.png/
and finally /messages/strings/names.txt :
http://imageshack.us/photo/my-images/837/names.png/
As you can see I named my weapon W_Test and gave it "custom" as it's internal name. I don't think I inverted the internal name and in-game name in any file, but that's not impossible. Basically all I did for every edited file was to copy the value of MG1Mk1 and past it at the end of the file.
So either there are more files to edit, or I just got it completely wrong. I'm not sure creating a weapon just takes some text editing.
http://imageshack.us/f/203/errorhf.png/
Then the four files I edited :
/stats/weapons.txt :
http://imageshack.us/f/12/weaponsi.png/
there are a few values missing on the right, but they're all the same as MG1Mk1.
/stats/weaponsounds.txt :
http://imageshack.us/photo/my-images/40/soundsf.png/
/stats/research/multiplayer/research.txt :
http://imageshack.us/photo/my-images/16/researchz.png/
and finally /messages/strings/names.txt :
http://imageshack.us/photo/my-images/837/names.png/
As you can see I named my weapon W_Test and gave it "custom" as it's internal name. I don't think I inverted the internal name and in-game name in any file, but that's not impossible. Basically all I did for every edited file was to copy the value of MG1Mk1 and past it at the end of the file.
So either there are more files to edit, or I just got it completely wrong. I'm not sure creating a weapon just takes some text editing.
Re: Adding a new weapon
Spoiler:
Also, i don't think you can use the same internal name for both weapon and technology.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Adding a new weapon
i would suggest to use my "stat editor" viewtopic.php?f=5&t=8726
- Retributer
- Greenhorn
- Posts: 14
- Joined: 15 Jan 2013, 12:15
Re: Adding a new weapon
Mmh, I thought about just posting some text, but I wanted to keep the layout as it was. As for using something else than notepad, dunno why I didn't use notepad++. Or Excell.
I'll try Reg's stat editor.
For the weapon technology's name, I thought it used the same than the weapon itself. I'll try with something different. Thanks for the help.
I'll try Reg's stat editor.
For the weapon technology's name, I thought it used the same than the weapon itself. I'll try with something different. Thanks for the help.
- milo christiansen
- Regular
- Posts: 749
- Joined: 02 Jun 2009, 21:23
- Location: Perrinton Michigan
Re: Adding a new weapon
To be exact this is cause by notepad clobbering line endings.
The files use \n to mark a new line and notepad uses \r\n. Since \n is "non-printing", and notepad does not recognize it as valid, notepad strips it when you save, hence you get a file that is just one big run-on line that is unreadable to the game.
Use wordpad, or better yet google notepad++.
The files use \n to mark a new line and notepad uses \r\n. Since \n is "non-printing", and notepad does not recognize it as valid, notepad strips it when you save, hence you get a file that is just one big run-on line that is unreadable to the game.
Use wordpad, or better yet google notepad++.
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
- Demigod Game Ganual
Re: Adding a new weapon
@Retributer - you can use the code tags to keep text formatting the same in the forums. For more info on the tags you can use in forums, see this list of examples.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
- Retributer
- Greenhorn
- Posts: 14
- Joined: 15 Jan 2013, 12:15
Re: Adding a new weapon
Ok, I changed the research name and internal name, now the game doesn't crash anymore, but my research doesn't appear. There must be another file to edit, but I don't know which one.
I tried Reg's stat editor, it's well done, but when I try to compile my work, it tells me there's an error with template.txt :
Error (linked table invalid right key): file=assignweapons.txt, KeyValue=ViperLtMGWheels, Row=ViperLtMGWheels,MG1Mk1,NULL,NULL,0,MG1Mk1,60
And I don't understand what I do with the file I get after this. Where do I put it ? Do I replace mp.wz with it ?
I tried Reg's stat editor, it's well done, but when I try to compile my work, it tells me there's an error with template.txt :
Error (linked table invalid right key): file=assignweapons.txt, KeyValue=ViperLtMGWheels, Row=ViperLtMGWheels,MG1Mk1,NULL,NULL,0,MG1Mk1,60
And I don't understand what I do with the file I get after this. Where do I put it ? Do I replace mp.wz with it ?
Re: Adding a new weapon
no, keep mp.wz intact or else you wont be able to play a multiplayer game again. Instead load it as a mod in /mods/autoload/myMod/stats/...
you seem to forgot prresearch.txt where you must link your new research to something else already existent. OR rules.js to add the new research at start up
you seem to forgot prresearch.txt where you must link your new research to something else already existent. OR rules.js to add the new research at start up
Heretic 2.3 improver and proud of it.
- Retributer
- Greenhorn
- Posts: 14
- Joined: 15 Jan 2013, 12:15
Re: Adding a new weapon
I've edited prresearch, now I'm supposed to unlock my research by researching the machinegun. The game still doesn't crash, which is good, but my research still isn't here.
As for rules.js, I've added "enableresearch("Rcustom", playnum);" with the three other researches, but the game acted strangely, I started with a base even though I set the game in no base mode, and I started with 0 power instead of 2500 (if I read the rules.js right). Also I didn't have any model, and many researches were missing, and if I tried to create a template, it only displayed a black zone. Is there something else to change in this rules.js ?
As for rules.js, I've added "enableresearch("Rcustom", playnum);" with the three other researches, but the game acted strangely, I started with a base even though I set the game in no base mode, and I started with 0 power instead of 2500 (if I read the rules.js right). Also I didn't have any model, and many researches were missing, and if I tried to create a template, it only displayed a black zone. Is there something else to change in this rules.js ?
Re: Adding a new weapon
Maybe you could upload the .txt files you altered (as attachments ...in text format!!) so people can take a look at them?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
- Retributer
- Greenhorn
- Posts: 14
- Joined: 15 Jan 2013, 12:15
huehue
Mh. I guess that's a good idea. But I can only attach 3 files, I'll have to merge some of them (I have 5 files in total).
Here. This should do it. I think.
Here. This should do it. I think.
- Attachments
-
- weapons+sounds.txt
- (37.6 KiB) Downloaded 360 times
-
- research+prresearch.txt
- (74.03 KiB) Downloaded 364 times
-
- names.txt
- (74.8 KiB) Downloaded 363 times
Re: Adding a new weapon
Hello,
did anyone post a solution for this example?
I do look for the same thing.
C.U. R.E.Z.
did anyone post a solution for this example?
I do look for the same thing.
C.U. R.E.Z.
Re: Adding a new weapon
I guess not.
[/b]' (minus the quotes) around that code, that is what aubergine meant.
@Retributer: You should have pasted the code into the forum edit window, then used 'you can use the code tags to keep text formatting the same in the forums
Code: Select all