Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Help with new weapons  (Read 772 times)

InfinityWEAPON

  • Bay Watcher
  • Not as cool as he thinks he is.
    • View Profile
Help with new weapons
« on: August 26, 2011, 07:54:35 pm »

SO I'm a newb and....

I've been trying to mod in some new weapons (namely, guns) in such a way as to co-exist with crossbows. Unfortunately (being a newb) I've run into an endless slew of problems.

The most pressing of which is that the items I've tried to mod in don't seem to exist. The workshop and commands are there and 'work', however when I que up a 'create -gun-' order, the worker walks over, then walks away. The order dissapears. No weapons are made, no materials used, and no error messages.

I'm at a loss as to what I'm doing wrong :(

The basis of my coding is:
Spoiler (click to show/hide)

If anyone could offer any insight into how to fix my troubles, I would be very grateful.
Logged
The bacon is currently molten, this is a problem.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Help with new weapons
« Reply #1 on: August 26, 2011, 07:58:18 pm »

Well, for one thing, all your guns are using skills like "RAILGUN" and "PISTOL"; you may want to fix those to CROSSBOW or such, E.G

Code: [Select]
[RANGED:RAILGUN:SLUG]
Should be

Code: [Select]
[RANGED:CROSSBOW:SLUG]
Also, you should look at your errorlog.txt.
« Last Edit: August 26, 2011, 07:59:53 pm by Putnam »
Logged

InfinityWEAPON

  • Bay Watcher
  • Not as cool as he thinks he is.
    • View Profile
Re: Help with new weapons
« Reply #2 on: August 26, 2011, 08:02:21 pm »

Ah, thanks. I'll try that.

EDIT: Try'd, didn't seem to work.
Also, the errorlog is filled endlessly with pathing fails. Near the bottom, though I found that the 'WEAPONSMITHING' token I used isn't recognized. I'm gonna work from there.
« Last Edit: August 26, 2011, 08:09:53 pm by InfinityWEAPON »
Logged
The bacon is currently molten, this is a problem.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Help with new weapons
« Reply #3 on: August 26, 2011, 08:19:16 pm »

[NAME:make .45]
   [BUILDING:GUN_SHOP:CUSTOM_B]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL]
   [PRODUCT:100:100:ITEM_AMMO:ITEM_AMMO_.45BULLETS]
 your product line is wrong same with reagent they are too short it should be

[NAME:make .45]
   [BUILDING:GUN_SHOP:CUSTOM_B]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL:NONE]
   [PRODUCT:100:100:ITEM_AMMO:ITEM_AMMO_.45BULLETS:GET_MATERIAL_FROM_REAGENT:A:NONE]
that should produce a 100 bullets from what ever metal the dwarf/creature grabs

You could also do
   [REAGENT:A:150:BAR:NO_SUBTYPE:INORGANIC:COPPER]
   [REAGENT:B:150:BAR:NO_SUBTYPE:INORGANIC:LEAD]
   [PRODUCT:100:100:ITEM_AMMO:ITEM_AMMO_.45BULLETS:GET_MATERIAL_FROM_REAGENT:A:NONE]

now its copper coated candy or hot lead (won't acually be hot lead or even related to that metal, the bullets would purely be copper)
Logged

TurkeyXIII

  • Bay Watcher
    • View Profile
Re: Help with new weapons
« Reply #4 on: August 26, 2011, 08:23:11 pm »

Delete the errorlog before each attempt, it'll make a new one with only the relevant errors.

Your products are all missing material lines.  Should be something like  [PRODUCT:100:1:ITEM_WEAPON:ITEM_WEAPON_RAILGUN:GET_MATERIAL_FROM_REAGENT:A:NONE]

You could probably do without the reactions completely, and add the weapons/ammo to the entity directly.  Only difference is they'd be made at a forge instead of the gun shop.

Bah, ninja'd
Logged
A medium-sized bird with a distinctive fleshy wattle that hangs from the underside of the beak, and a fleshy protuberance that hangs from the top of its beak called a snood.

InfinityWEAPON

  • Bay Watcher
  • Not as cool as he thinks he is.
    • View Profile
Re: Help with new weapons
« Reply #5 on: August 26, 2011, 08:29:44 pm »

@Hugo_The_Dwarf:
Did as you said and the 'Make .45 bullets' option is suddenly redded out. Like an idiot, I forgot to bring a bar of metal with me, but I'll take that as success. Thanks for the tip.
Logged
The bacon is currently molten, this is a problem.

trees

  • Bay Watcher
  • [MUNDANE]
    • View Profile
Re: Help with new weapons
« Reply #6 on: August 26, 2011, 08:32:00 pm »

Instead of WEAPONSMITHING, you want FORGE_WEAPON. Skill tokens are a bit odd sometimes, the wiki has a list if you ever run in to any more problems with them.

And considering that most of your reactions simply require a metal bar, it would probably be much less work adding your items as weapons to entities so that they could be made at the forge, as others have stated.
Logged
I am often bad at phrasing things - don't hesitate to ask for clarification if something I said doesn't make sense.

InfinityWEAPON

  • Bay Watcher
  • Not as cool as he thinks he is.
    • View Profile
Re: Help with new weapons
« Reply #7 on: August 26, 2011, 08:39:58 pm »

@trees:
Yeah, I literally caught that at the last second. Fix'd.

Also, errorlog keeps spouting: *** Error(s) found in the file "data/save/region1/raw/objects/item_weapon.txt"
ITEM_WEAPON_RAILGUN:Unrecognized Item Definition (Weapon) Token: SKILL_HAMMER
ITEM_WEAPON_RAILGUN:Unrecognized Item Definition (Weapon) Token: SHOOT_MAXVAL

and when I go to make .45 bullets the game freezes and quits out.

I think I'm going to add my weapons to the entities but I have NO idea as to how I should go about that procedure. Any help?
Logged
The bacon is currently molten, this is a problem.

Kipi

  • Bay Watcher
    • View Profile
Re: Help with new weapons
« Reply #8 on: August 26, 2011, 09:06:37 pm »

@trees:
Yeah, I literally caught that at the last second. Fix'd.

Also, errorlog keeps spouting: *** Error(s) found in the file "data/save/region1/raw/objects/item_weapon.txt"
ITEM_WEAPON_RAILGUN:Unrecognized Item Definition (Weapon) Token: SKILL_HAMMER
ITEM_WEAPON_RAILGUN:Unrecognized Item Definition (Weapon) Token: SHOOT_MAXVAL

and when I go to make .45 bullets the game freezes and quits out.

I think I'm going to add my weapons to the entities but I have NO idea as to how I should go about that procedure. Any help?

For the errors you should change the lines
Code: [Select]
[SKILL_HAMMER]
[SHOOT_MAXVAL:1000]

to

Code: [Select]
[SKILL:HAMMER]
[SHOOT_MAXVEL:1000]

Also, you have all the RANGED tags wrong. The tags go [RANGED:<skill used when shooting>:<bullet>]

I am not sure how the game handles the '.' characters in item names, you could perhaps just remove those. That may be the reason of crash.

Finally, to add weapon and ammo to entity just add the following lines under MOUNTAIN (dwarf) entity section:
Code: [Select]
[WEAPON:ITEM_WEAPON_RAILGUN]
   [AMMO:ITEM_AMMO_SLUG]
That's just an example of adding railgun and proper ammo to entity, look for the WEAPON:CROSSBOW inside the entity file for another example.
Logged
Room Values - !!SCIENCE!!

Quote from: zanchito
You know, they could teach maths like this at school. "There are 105 dwarves in a settlement. A goblin invasion appears and 67 die. Then a migrant wave..."

Kweri

  • Bay Watcher
    • View Profile
Re: Help with new weapons
« Reply #9 on: August 26, 2011, 09:42:56 pm »

Just a note - using METAL doesn't restrict your material of your bar to just metal. http://df.magmawiki.com/index.php/Material_token STONE and METAL are just aliases for INORGANIC.

That said, unless you've modded in making stone bars, I don't see this being an issue. Soap is not inorganic and coke/charcoal bars are their own material main type as well. Just wanted to point this out though for any future modding pursuits. :)
Logged

Jake

  • Bay Watcher
  • Remember Boatmurdered!
    • View Profile
    • My Web Fiction
Re: Help with new weapons
« Reply #10 on: August 26, 2011, 11:18:55 pm »

A word of warning. The slug is going to be totally useless in combat with a BLUNT tag; early versions of my own firearms mod used it for musket ammunition and it kept getting deflected by a simple pig tail cloth shirt, until a lucky shot to the head jammed the target's skull through their brain.
Logged
Never used Dwarf Therapist, mods or tilesets in all the years I've been playing.
I think Toady's confusing interface better simulates the experience of a bunch of disorganised drunken dwarves running a fort.

Black Powder Firearms - Superior firepower, realistic manufacturing and rocket launchers!

InfinityWEAPON

  • Bay Watcher
  • Not as cool as he thinks he is.
    • View Profile
Re: Help with new weapons
« Reply #11 on: August 26, 2011, 11:28:45 pm »

@Jake: Even if I ramp up the shooting force?

@Kweri: SO if I mod a little more I can make stone bullets....?

@Kipi: Pretty sure you just fixed my railgun problem, and also with the forge making my guns it works insofar as the sniper. Thanks alot!

EDIT: Verified that all guns can be made, right now I'm just testing if they actually work.
« Last Edit: August 27, 2011, 12:48:45 am by InfinityWEAPON »
Logged
The bacon is currently molten, this is a problem.

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: Help with new weapons
« Reply #12 on: August 27, 2011, 02:13:44 am »

It's better to use edge attacks with low area and high penetration for firearm-type weapons.  I know it doesn't seem as logical, but the engine handles it a lot better than small blunt objects.

InfinityWEAPON

  • Bay Watcher
  • Not as cool as he thinks he is.
    • View Profile
Re: Help with new weapons
« Reply #13 on: August 28, 2011, 04:03:02 pm »

@narhiril: Damn :(

Also, all the guns are functional as melee weapons, I haven't figured out how to make my military bring ammo with them, however.
Logged
The bacon is currently molten, this is a problem.