You must be logged in to post messages.
Please login or register

Scenario Design and Discussion
Moderated by Sebastien, Mr Wednesday

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: JSON files
posted 01-20-17 12:29 PM CT (US)   
Hey HD users,

you now can use your own JSON to create your own campaign backgrounds for your releases.

In common/Age2HD/resources/_packages/custom-campaign-fallback you can find a MD file which you can open with a text editor; in this file it is explained how to create your own campaign backgrounds, banners and markers etc.
That's the good thing.

The bad thing is, that I still have no clue how to do it since I don't know shit about all that stuff. I tried it and totally failed.

Is there anyone who actually knows well about this JSON thing and could create a JSON for me for my upcomming two releases?

[This message has been edited by Bassi (edited 01-21-2017 @ 09:22 AM).]

Replies:
posted 01-21-17 02:00 AM CT (US)     1 / 14  
I can't figure out how to link the custom graphics files in the json file.

The md file tells you to do this:

"MenuBannerFileName": "textures\\banner.png",
"BackgroundImageFileName": "textures\\background.jpg",
"MouseUpBorderImageFileName": "textures\\button_up.png",
"MouseDownBorderImageFileName": "textures\\button_down.png",
"MouseOverBorderImageFileName": "textures\\button_hover.png"

But no matter what I do, I can't seem to get the game to recognize my custom graphics files. I put the textures folder with those files in the campaign folder with the json file and the aoe2scenario file but it doesn't work.

Is there some trick to linking to a URL with JSON?

posted 01-21-17 09:25 AM CT (US)     2 / 14  
Thanks to Freeman 1302 I am now able to make custom descriptions visible for the scenarios that are included in the campaigns.

But this graphic thing doesn't seem to work proper; Freeman has the same problem with it like you Al_Kharn.
posted 01-21-17 09:58 AM CT (US)     3 / 14  
I messed with it for several hours last night and got some of the graphics files to appear in game. I did this by putting the files in the mod folder.

I put the campaign file and the json file in this folder path:
Age2HD\mods\XXX\resources\_common\campaign\

And I put the graphics files in this folder path:
Age2HD\mods\XXX\resources\_packages\custom-campaign-fallback\textures\

I made separate folders for the graphics called XXXbackground and XXXicons

Inside the json file, I set the below filepaths:
"MenuBannerFileName": "textures\\XXXicons\\banner.png",
"BackgroundImageFileName": "textures\\XXXbackground\\background.jpg",
"MouseUpBorderImageFileName": "textures\\XXXicons\\button_up.png",
"MouseDownBorderImageFileName": "textures\\XXXicons\\button_down.png",
"MouseOverBorderImageFileName": "textures\\XXXicons\\button_hover.png"

For whatever reason, it seems that in the json file, the filepaths assume \resources\_packages\custom-campaign-fallback\ before the URL begins. It doesn't make sense to me since the json file is in a different folder but doing this, I got most of the graphics to appear in game.

The exception is the banner.png file. That did not change for some reason.

posted 01-21-17 11:22 AM CT (US)     4 / 14  
Amazing! Thank you very much! I made it work for me now!

This is the result!

http://www.fotos-hochladen.net/uploads/example15fatld60x.jpg

[This message has been edited by Bassi (edited 01-21-2017 @ 11:30 AM).]

posted 01-21-17 12:55 PM CT (US)     5 / 14  
What's the Settings for? To let the player know gamespeed, music off, etc.?

posted 01-21-17 01:09 PM CT (US)     6 / 14  
Yes, since this scenario comes with a triggered custom soundtrack, I thought it would be a good idea to have a setting scenario first, where the player is told what settings he should use, so the real scenario is automatically running smooth.
I made this because on steam there a are a lot of players that are not very familiar with custom campaigns. To make sure they all will enjoy the scenario how it is ment to be, I made this setting scn.
posted 01-21-17 01:23 PM CT (US)     7 / 14  
It looks good.

Too bad the custom banners don't work.

posted 02-25-17 09:58 AM CT (US)     8 / 14  
is this only for HD version? i tried to search a bit for the mentioned folder but...meh
posted 02-25-17 11:09 AM CT (US)     9 / 14  
HD only, yes.
posted 02-25-17 01:46 PM CT (US)     10 / 14  
The custom json graphics will not appear for subscribers on the Steam Workshop but that is a bug which has been reported. Currently, only those with the mod folder (i.e., the content creator) can view them.

posted 03-02-17 04:56 PM CT (US)     11 / 14  
I think it was Al_Kharn the Great (FilthydelphiaAoK) over on reddit who linked me to this thread. Anyway I took on the challenge and solved this one for now based on a bit of intuition and testing.

How to do it:
You can get your custom campaign to show up with proper positioning/graphics/descriptions etc. on the Steam Workshop through proper URL placement.

The expected directory for the textures\\.. folder is your mod's resources\common\ directory. This is what the developer refers erroneously to as the 'root' directory, but it was enough of a clue for me to guess at the issue.

So if in the .json file you wrote:

textures\\icons\\up.png

then the directory is:

Mods\MyModName\resources\common\textures\icons\up.png

As noted in the previous comments, this doesn't work for testing when it just sits in your mods\ folder as there is indeed a programming issue here, but it does work once it is uploaded to the workshop, and even works with the banners.

If you have issues once you subscribe to your own mod, then I'd try removing the mod\ folder version to make sure it isn't interfering. For other users they won't receive the mod folder so they shouldn't have issues.


But What About Testing?
If you want to test during creation though I recommend using the packages\custom-campaign-fallback\ texture directory trick as noted above and switch it over when you're happy with it. Of note, I also recommend naming your directory or files differently from the custom-campaign-fallback default otherwise they'll temporarily overwrite the values for the other custom campaigns you may have. This is because adding files to this directory is overwriting any files that match it's name. It is not a huge deal if you keep them the same though as that won't happen once the Mod is uploaded to steam.

The only exception is possibly your banner, as you can then preview it if the URL matches the default directory. The .json code doesn't work in the mod\ directory for banners so this must be a URL bug in the code. As before the naming won't have an impact on other custom campaigns once uploaded to steam.

Here's a really rough example I've uploaded to the workshop for anyone who is interested in having something to copy:

http://steamcommunity.com/sharedfiles/filedetails/?id=875627263

I Hope this helps!

For anyone interested in how I figured this out:I figured it was a directory issue so...
by dropping the textures\\... folder I was using into every possible directory under resources\\common and resources\\packages I then uploaded the file as a private mod and subscribed to it. I then removed the original folder from my "mods" directory as to not to interfere with the subscription test.

My intuition was right luckily, it worked! Then through the process of elimination I derived the actual expected location by repeating the process while removing half the possible texture mod folders every time I re-uploaded and re-subscribed. I knew having duplicates wouldn't cause a crash as the engine seem good at ignoring random data (like our textures for instance) so this seemed like the fastest way.

[This message has been edited by Taerkalith (edited 03-02-2017 @ 05:21 PM).]

posted 03-03-17 06:18 AM CT (US)     12 / 14  
I have subscribed your sample file and it works!
Thank you very much for sharing this information with us!
posted 03-03-17 06:29 PM CT (US)     13 / 14  
Great find Taerkalith. I had pretty much the same settings but I never thought that I had to publish it in order for it to work. I'll try it out this weekend.

EDIT: It works. Nice.

[This message has been edited by Jan dc (edited 03-04-2017 @ 08:01 AM).]

posted 06-06-17 12:26 PM CT (US)     14 / 14  
Hei. It doesn't work for me. None of my graphics appear. Only the default. Not sure what more to say. After lots of tests I'm just even more confused. Any further advice?
Age of Kings Heaven » Forums » Scenario Design and Discussion » JSON files
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames