Guys, i need some help

#1

I’m trying to learn to create new things in the game, i’m trying to create a martial art and i getting this error:

01:16:27.842 ERROR : src/main_menu.cpp:696 [bool main_menu::new_character_tab()] Error: data/mods//DragonSlayer/martialarts.json: line 1:557: missing separator

            "description": "Strength and Damage increases with anger",                "min_melee": 2,                "flat_bonuses": [                    ["damage" , "cut", "per", 1.0],                    [ "damage", "bash", "str", 1.0 ]
                                                                                                                                                                                                                                            ^

I’m really confused to where the separator is missing, i tried to make it the same spacing and everything as the martialarts.json, can someone shed some light here.

#2

Using what you gave, here’s what mine looks like, which works. It looks like you were missing a ‘]’ at the end of “flat bonuses”, so it was looking for a ‘,’ instead.

[
  {
    "type": "martial_art",
    "id": "blah_blah",
    "name": "blah blah",
    "description": "Strength and Damage increases with anger",
    "min_melee": 2,
    "flat_bonuses": [ [ "damage", "cut", "per", 1.0 ], [ "damage", "bash", "str", 1.0 ] ]
  }
]
#3

thanks you beatiful person

1 Like
#4

i got another problem if i can have your help one more time

03:08:31.172 ERROR : src/main_menu.cpp:696 [bool main_menu::new_character_tab()] Error: data/mods//DragonSlayer/martialarts.json: line 1:721: expected pair separator ‘:’, not ‘"’

mage" , “cut”, “per”, 1.0], [“damage”, “bash”, “str”, 1.0 ], [“dodge”, “str”, “0.5”] ] ], “onmove_buffs”: [ { “berserk_onmove_buff”, "
^
name" : “Berserk Block” “description”: “Your anger makes your moves faster making blocking easier.”, “min_melee”: 2, “max_stacks”: 5, “buff_duration”: 4, "flat_bonus

#5

Shouldn’t [“dodge”, “str”, “0.5”] be [“dodge”, “str”, 0.5 ]?

You know, I recommend putting your JSON into some kind of validator.

I use Visual Studio Code as it has a built-in JSON syntax highlight, but online tools can also work.

#6

In the future, when asking for help, do try to format things a little nicer. It hurts my brain to look at what you’re posting. o_o Putting the entire file up on github or putting the lines (if its short) between

[code] and [/code]

will make it show up as a code block in the comment, like I did earlier and am about to do again. It’s a lot easier to read that way.

Anyway, when you put “berserk_onmove_buff” and then a comma with a " it doesn’t like that. It’s expecting a colon to separate two things.

What I think you meant is . . .

“onmove_buffs”: [ 
  { 
    "id": “berserk_onmove_buff”,
    "name": “Berserk Block”,
    “description”: “Your anger makes your moves faster making blocking easier.”,
    “min_melee”: 2,
    “max_stacks”: 5,
    “buff_duration”: 4,

You were also missing a comma at the end of “Berserk Block”.

Also, yes, numbers shouldn’t be in quotes.

In the future, though, really, really, show the whole entry x_x

#7

Provide us the full code block from your martialarts.json file generating the error, we could help you deal with it :wink:

#8

sorry for the misformat, very new here in the forum, i’ll be mindiful in the future.

#9

https://pastebin.com/RfqhmtbL

Here is the full code if you guys can give me pointers, i would be grateful.

#11

It doesn’t, because “ondodge_buffs” is duplicated.

I’d recommend that while you’re learning to fiddle with the files, you should copy and paste entries from the core game files and then edit them.

Jumping right in to your own martial art, something I’ve still never done, seems pretty complex. Particularly if you’re creating it from scratch instead of copying.

#12

If you’re not already using it Notepad++ has display support for JSON files with highlighting and folding. That would help you pick out these missing commas and brackets a lot easier on your own.

#13
[
	{
		"type": "martial_art",
		"id": "berserker",
		"name": "Black Swordsman Style",
		"description": "Sword techniques used with two-handed swords.",
		"arm_block": 99,
		"leg_block": 99,
		"static_buffs": [
			{
				"id": "beserk_stationary_buff",
				"name": "BERSERKER!!!",
				"description": "Strength and Damage increases with anger",
				"min_melee": 2,
				"flat_bonuses": [
					
						[
							"damage",
							"cut",
							"per",
							1.0
						],
						[
							"damage",
							"bash",
							"str",
							1.0
						],
						[
							"dodge",
							"str",
							0.5
						]
					
				],
				"onmove_buffs": [
					{
						"name": "Berserk Block",
						"description": "Your anger makes your moves faster making blocking easier.",
						"min_melee": 2,
						"max_stacks": 5,
						"buff_duration": 4,
						"flat_bonuses": [
							[
								"dodge",
								-10.0
							]
						],
						"bonus_dodges": -1,
						"bonus_blocks": 2
					}
				],
				"ondodge_buffs": [
					{
						"name": "Berserk Dodge",
						"description": "Your anger makes your moves faster making dodging easier.",
						"min_melee": 2,
						"max_stacks": 5,
						"buff_duration": 4,
						"flat_bonuses": [
							[
								"dodge",
								-10.0
							]
						],
						"bonus_dodges": -1,
						"bonus_blocks": 2
					}
				],
				"onhit_buffs": [
					{
						"name": "Berserk Block 2",
						"description": "You go to the offensive not dodging a lot",
						"min_melee": 2,
						"max_stacks": 5,
						"buff_duration": 5,
						"flat_bonuses": [
							[
								"dodge",
								-5.0
							]
						],
						"bonus_dodges": -1.0,
						"bonus_blocks": 3
					}
				],
				" techniques ": [
					" black_slash ",
					" beserk_cut ",
					" beserk_chance ",
					" beserk_fury "
				],
				" weapons ": [
					" broadsword ",
					" dragon_slayer ",
					" zweihander_fake ",
					" zweihander_inferior ",
					" nodachi "
				]
			}
		]
	}
]

Well, with some modifications, it works now :wink:

If you’re on PC, use the tool said by @MamaLlama. Or use QuickEdit on your smartphone to ease your work…

#14

axema thanks very much, can you give me some pointers to what i did wrong or what program i may use, i using the regular notepad and seeing the code through pastebin

#15

you’re predicted my questions O:
thanks once again

1 Like
#16

Regular notepad is garbage… If you’re up for modding, use NotePad++ :wink:

1 Like
#17

learning something new everyday
I’ll try to become good at coding and make an awesome mod for the community.

2 Likes
#18

the next thing i going to see if i can make is a recipe and a gun, the shooty shooty type.

1 Like
#19

Well, good luck about that :slight_smile:

#20

sorry to bother again, trying to do the technique json and again something happens is saying that is expecting ‘’:" but getting " " ", in the part
[ [“damage”, “bash”, 3.0],

Being before bash the problem again i’m basing myself of the techniques.json the original and i get this thing again

https://pastebin.com/AfuCe3CV

here is the full code, is it a problem with spacing?

#21
[
	{
		"type": "technique",
		"id": "beserk_slash",
		"name": "beserk slash",
		"min_melee": 4,
		"mult_bonuses": [
			[
				"movecost",
				1.5
			],
			[
				"damage",
				"bash",
				3.0
			],
			[
				"damage",
				"cut",
				3,
				0
			]
		],
		"messages": [
			"you slash %s with the burning power of your rage",
			"<npcname> strikes % with the burning power of your rage"
		]
	},
	{
		"type": "technique",
		"id": "beserk_sweep",
		"name": "beserk sweep",
		"min_melee": 5,
		"down_dur": 2,
		"messages": [
			"Your strike knocks %s off balance",
			"<npcname>'s strike knocks %s off balance"
		]
	},
	{
		"type": "technique",
		"id": "beserk_chance",
		"name": "beserk chance",
		"min_melee": 3,
		"crit_tec": true,
		"mult_bonuses": [
			[
				"damage",
				"bash",
				2.0
			],
			[
				"damage",
				"cut",
				2.0
			]
		],
		"messages": [
			"You stun %s after finding an opening in his attack",
			"<npcname> stuns %s after finding an opening in his attack"
		],
		"stun_dur": 3
	},
	{
		"type": "technique",
		"id": "beserk_fury",
		"name": "Beserk Fury",
		"min_melee": 6,
		"req_buffs": [
			"beserk_sweep"
		],
		"messages": [
			"You strike %s beheading it",
			"<npcname> strikes %s beheading it"
		],
		"mult_bonuses": [
			[
				"movecost",
				0.5
			],
			[
				"damage",
				"bash",
				3.0
			],
			[
				"damage",
				"cut",
				3.0
			]
		],
		"stun_dur": 3
	},
	{
		"type": "technique",
		"id": "beserk_feint",
		"name": "Beserk Feint",
		"melee_allowed": true,
		"min_melee": 2,
		"defensive": true,
		"miss_recovery": true,
		"mult_bonuses": [
			[
				"movecost",
				0.5
			]
		],
		"messages": [
			"You feint %s",
			"<npcname> feint at %s"
		]
	}
]

No, your problem is the usage of commas. Try to read the error from the debug and skim through the line code…