Help with mods - questions

Currently impossible, spell counter is separate from CASTS bonus and can’t be modified by Bonus system at all. Same is true for shots, conunterstrikes and possibly more.

yes, i also tried to play “type” : “CASTS” and get nothing.
You can also try

{"type":"CASTS",
"valueType":"BASE_NUMBER",
"val":0,
"duration":"N_TURNS"
} 

Or

{"type":"CASTS",
"valueType":"PERCENT_TO_ALL",
"val":-100,
"duration":"N_TURNS"
} 

Thanks for quick reply!

Shame it can’t properly work right now, but if it will in future, it could be very useful and unique ability.

I’ll try not to bugger you too often but I have one last concern. I can’t make ADDITIVE_VALUE work as intended. Be it with afore-mentioned ability or some other one, all I can achieve is reducing creature’s statistic by defined value and not one point further. On older version of VCMI Disrupting Ray didn’t work at all, but it does after updating to 0.98d and it was written just like in my code (just with different “type”). Am I missing something obvious?

?
ADDITIVE_VALUE should work as you say - is it summed with parameter value. If you want to make -2 to defence (val:-2,“valueType”:“ADDITIVE_VALUE”), it will make -2 to defence (don’t remember but it will be lowered to 0 as there are no negative stat params allowed.

PS On primary params on older versions PERCENT_TO_ALL doesnt work. On most recent version didnt tested it yet. I tried to make artefact with bonus

{
"type":"PRIMARY_SKILL",
"subtype":2,
"val":100,
"valueType":"PERCENT_TO_ALL"
}

and it didnt icrease spell power by 100% :imp:

Hi everyone.

Opening my experimental town in a map editor got me excited, so I played around with some new ideas. One of them is an ability to turn foes to ice. That’s just a “stone gaze”/“paralysis” but with a twist. Attacking frozen unit would shatter it and make it lose its top stack, not unlike the Mighty Gorgon’s DEATH_STARE. I think it’s doable, but I lack some kind of limiter.
When I tried wishful thinking, I got a yellow message “Adding new bonuses not implemented” (shoot), so I thought I’ll ask here. What would I need to do to change the list of standard bonuses? I thought this shouldn’t be too hard, it wouldn’t even do anything, just be there and serve as a flag.

Well, every bonus effect is handled in C++ code. You are free to add new bonuses as long as it make sense. But we don’t need more “flags” with no functionality while so many WoG bonuses are still missing.

I though this one will be a piece of cake to make, but it turned out to be a tough cookie instead. I wanted to make a simple bonus, activated only at specific type of terrain. Am I doing something wrong, is it not yet implemented or did I misinterpret the use of “sourceType” determinant? NATIVE_TERRAIN doesn’t work as well. Bonus appears at all times regardless of terrain type.

			"Snow Stealth" : 
			{
				"type" : "BLOCKS_RETALIATION",
				"sourceType" : "TERRAIN_OVERLAY",	
				"sourceID" : 4
			}

This won’t work. You can’t force source type for bonus. The bonus as you described is static and “TERRAIN OVERLAY” is just additional indicator with no effect.

I want to make VCMI port of ERA2 mod called A Song of Ice and Fire. This mod brings 20+ map designed to suit Westeros geography, new heroes portraits, new music, new splash screens and loadgame pics.
Not everything can be ported to VCMI, but some of it features yes. So I’ve made such port, but encountered some problems. I’ve noticed that in vcmi mod New-menu there’s a code:

{
	"game-select" :
	
		"new-menu/Scenario Selection 1.png",
		"new-menu/Scenario Selection 2.png",
		"new-menu/Scenario Selection 3.png"
	],

	"loading" :
	
		"new-menu/LoadingScreen 1.png",
		"new-menu/LoadingScreen 2.png",
		"new-menu/LoadingScreen 3.png"
	],

So we have three random scenario selection screens and three loadgame screens. So I’ve tried to do same thing in mod, but game crashes every time and I don’t know why :cry: Could someone wants to look into into json files and tell what I did wrong?
Here’s link to the lite vesrsion:
www108.zippyshare.com/v/LqGfs02q/file.html

Important: for now, game crashes at the first four time. Fifth time game launch normally without errors. :open_mouth:

I have been trying to work on editing some descriptions and names on some of my heroes for Fairy Town, and some others, but when I try to update names it crashes it. I have a feeling it’s because there are other files that don’t recognize the names when I update them…can someone give me some idea on what all I need to change for one individual hero to make my changes work (Just description wise, not changing any pictures at this point)

You must remember that in mod.json file (below content folder) you must write patch do your hero.json.
For example:

"heroes" :
	
		"config/fairy/heroes/yourHeroName.json",

        ]

Okay, so I was looking through some mods at how the .json is set up for the townscreen and I noticed a lot of the buildings have "x:0 y:0 "… This doesn’t make sense to me unless the makers are saving each building as a transparent image the size of the whole background. Is that what I am seeing or am I just not understanding how it works?

Yes it is like that .

Town screens in vcmi support pngs and transparency. So you can just set it to x:0 y:0 and it will work for the same size as townscreen background images.

Every def and every transparent png file has itw own resolutions. And x,y coordinates are top-left townscreen coordinate of every image. Townscreen has 800x374 resolution, so min x=0, min y = 0, max x = 800, max y = 374. So if your def (or transparent png) has 800x374 resolution, it’s obvious that top-left pinnacle has x = 0, y = 0 coordinates (like in Asylum and Preserve mod). But look at the Grove mod. Defs are smaller, have smaller resolution so pnnacles must be set manually for proper viewing. I think this picture show you all about coordinates.

So it’s up to you which metod you choose. x=0, y = 0 method is easier for modder, but mod is heavier and tends to lag (like Silaneo’s NecroTown), second method is more time consuming, but final mod works better. If you work with defs and 8-bit graphic I suggest x=0, y=0 method. If you want work with transparent png, second method is reasonable.

Awesome guys~ Helps out a lot :slight_smile:

@misiokles:

Thanks for the info. While I use GIMP all the time I just never thought about getting coordinates with it. Certainly it is very easy . It was right there and I just never thought about it.

Do you have any idea how big would be the slowdown for x:0 y:0 method if town screen size was set to 1066x600 instead of standard 800x374?

@val-gaav

I have been using Paint.net and it actually gives the coordinates of where the mouse icon is pointing at the bottom of the program screen, so I imagine most art programs have similar options built in

Yes GIMP has this too, Misiokles posted screenshot of GIMP BTW.

I simply expected this to be very hard to do, and didn’t notice easy solution that was right there.

I only noticed Paint.net after you asked the question…lol…so don’t feel bad, I wasn’t picking on you

Hard to say, because we have only one (ufinished) town using full (800x374) png transparency files. Check Silaneo’s Necro Town:
heroescommunity.com/viewthread.p … 1358#focus

I edited most these png’s by cutting them to smaller “rectangles” files, and slowdown reduced dramatically! But you must test it by yourself.