Page 1 of 1
Sunrise Samurai(AOF)-Unit json 1(json edit, bonuses) PASSED
Posted: Sat Sep 23, 2017 5:19 am
by Stratego (dev)
The first task was to modify a few bonuses on an AOW unit, here was the json of M7 priest and the bonus list was this to be modified to.
+100% buildings
+100% infantry
+400% Ships_Carrier
+400% battleships
+100% light tanks
+20% medium tanks
(sorry i just saw you are on AOF, the next ones will be on that - however we need to ask Alexander to let you do some since he is very fast on making any jsons if come up to change any

)
Re: Daniel Ward - Unit json (AOF orientation)
Posted: Sat Sep 23, 2017 11:09 am
by Sunrise Samurai
Alright, modifying the bonus value is easy enough. Had to check out another one to be sure on the use of decimals to define bonuses less than 100%. The problem I'm having is with the light and medium tanks, since I can't be sure if I've got the name right. Attaching what I have so far, but it needs edited with the right names once you tell me how to reference the tanks. Right now I have them as LIGHTTANK and MEDIUMTANK, which I doubt is actually what it needs to be. Don't have any other aow json files to compare.
Including JSON checker link for personal use, rather than have to go hunting for it later. I suggest all other apprentices do the same.
https://jsonformatter.curiousconcept.com
Re: Daniel Ward - Unit json (AOF orientation)
Posted: Sat Sep 23, 2017 11:35 am
by Midonik
I wrote: LIGHT_TANK and MEDIUM_TANK but I also dont know if its correct ir not.
Re: Daniel Ward - Unit json (AOF orientation)
Posted: Sat Sep 23, 2017 12:27 pm
by Sunrise Samurai
Your guess is as good as mine until Daniel chooses to enlighten us. I've poured through everything we've been given, and can't find any lists or examples that includes them. Unfortunately our AoWW database is limited, and no matter where I look I can't seem to access the internal files already in the games. If I could find those, I'd be able to get a lot of information without needing to ask

Re: Daniel Ward - Unit json (AOF orientation)
Posted: Sat Sep 23, 2017 2:50 pm
by Stratego (dev)
i have posted in FAQ (categories section) the current AOW json file, there you can see the valid AOW categories.
Re: Daniel Ward - Unit json (AOF orientation)
Posted: Sat Sep 23, 2017 2:53 pm
by Stratego (dev)
Sunrise Samurai wrote:Alright, modifying the bonus value is easy enough. Had to check out another one to be sure on the use of decimals to define bonuses less than 100%. The problem I'm having is with the light and medium tanks, since I can't be sure if I've got the name right. Attaching what I have so far, but it needs edited with the right names once you tell me how to reference the tanks. Right now I have them as LIGHTTANK and MEDIUMTANK, which I doubt is actually what it needs to be. Don't have any other aow json files to compare.
Including JSON checker link for personal use, rather than have to go hunting for it later. I suggest all other apprentices do the same.
https://jsonformatter.curiousconcept.com
very good!
- you need to use category name that is valid for AOw, so i have posted the current in the FAQ section - check them and use those,
- after that your json seems ok,
- so i will compile it in and the app might tell me if there is any other problem.
Re: Daniel Ward/Sunrise Samurai - Unit json (AOF orientation
Posted: Sat Sep 23, 2017 3:38 pm
by Sunrise Samurai
.....duh. I should have guessed from the ships how to format it. Well, fixed that. How's this?
Re: Daniel Ward/Sunrise Samurai - Unit json (AOF orientation
Posted: Sat Sep 23, 2017 4:31 pm
by Stratego (dev)
good job!
it seems impeccable
...putting in...
it is in the game! without errors! thanks!
Re: Daniel Ward/Sunrise Samurai - Unit json (AOF orientation
Posted: Sat Sep 23, 2017 4:51 pm
by Sunrise Samurai
I await further instructions, Sensei

Re: Daniel Ward/Sunrise Samurai - Unit json (AOF orientation
Posted: Sat Sep 23, 2017 5:09 pm
by Stratego (dev)
hai! oss! vakarimas-ka!?
it will be a bit harder:
Make an AOF unit to be json based (from this java code convert it to JSON.
steps:
- find a json based unit wich is similar (some kind of archer) - i searched one for you, rohan archer see attached
- copy the file and name it as *human_archer*
- modify every property so the new json will work as the info you see below
- codename and ID of unit: UNIT_ARCHER = 1;
- unit image name 32_unit_archer.png, 32x32px.
u.costTurn = 2;
u.sight = 7; //visiblity range
u.rangeAttack = 5; //attack range (what maximal range it can attack) (1 means only nearby unit)
u.attackTypeArrow = true; //if arrow than some units have defense against that
u.hpMax = 11; //health points
u.armorPierce = 0; //how big the armor against arrows
u.armorNormal = 0; //how big the armor against normal attack
u.power = 5; // u.power of its attack
u.rangeWalk = 3; // how far it can walk
u.canWalkHill = false;
u.canWalkForest = true;
u.canOccupyBuilding = true;
u.canBeCarried = true;
u.bonusHealing = 1; // if this unit have bonus when it is healed by an other unit. 1,1 means 10% bonus.
u.convertResistance = 0; // victim property: 0.2 = 20% -> if priest has 30% than 30 - 30*0,2 => priest has 26% to convert.
bonus(u, a (U_CHEAP_INFANTRY_MELEE, UNIT_ORNITHOPTER), 0.5f);
u.bestAgainstMeGround = U_ANTI_ARCHER;
u.bestAgainstMeWater = U_SHIP_ATTACK;
u.builders = new int[]{ //is it built in a TC? or in an archery range? or a worker builds it?
UNIT_TC,
UNIT_BUILDING_ARCHERY
};
u.modifiers = new int[]{//"type"-s (TECH) that modifies its properties
EFFECT_POISONED_ARROWS,
};
u.revokerTechs = new int[]{ //"type"-s that revokes this as a buildable unit/tech (eg. a crossbowman upgrade revokes archer from the palette)
TECH_UPGRADE_UNIT_CROSSBOWMAN,
};
u.races = new int[] { // only these races can build this
RacesLoader.RACE_HUMAN
};
Re: Daniel Ward/Sunrise Samurai - Unit json (AOF orientation
Posted: Sat Sep 23, 2017 5:42 pm
by Sunrise Samurai
Hai!
I'll probably get a decent chance to do this tonight (about 7 hours from now). You weren't kidding when you said a bit harder

I'm going from editing a little bit of bonuses to making a whole new unit. Do I take it to mean that most AoF units still need to be bumped up to json form?
Re: Daniel Ward/Sunrise Samurai - Unit json (AOF orientation
Posted: Sat Sep 23, 2017 5:53 pm
by Stratego (dev)
Sunrise Samurai wrote:Hai!
I'll probably get a decent chance to do this tonight (about 7 hours from now). You weren't kidding when you said a bit harder

I'm going from editing a little bit of bonuses to making a whole new unit. Do I take it to mean that most AoF units still need to be bumped up to json form?

will be not be THAT hard - you need almost to keep the rohan properties, only a few changes will be.
most AOF units: no, i think the ones inherited from AOS yes, some first few AOF units too, i think approx 50-60 units, not that much

they will be good to practice jsoning, however you 3 will not make all of them - i think only 8-10 jsons per apprentice, we will see how interesting they are .
there are more complex things like spells and effects and "born with" abilities and "area damaging stuff" and such and there are several caster units out of json now to discover.
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Sat Sep 23, 2017 10:12 pm
by Sunrise Samurai
Not sure I got the bonus against ornithopters right. I took a wild guess, since in the game, it has a bonus vs ornithopters, but no other fliers. Checks out as a valid json, so hopefully it's good. Did I miss anything?
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Sat Sep 23, 2017 10:20 pm
by Stratego (dev)
thanks!
good!
quick reply, the things i saw in first glance to be fixed
- the image name is not right.
- the unit idString is not right
- the unit id is not right
- the ornithopter is not properly references (it is not a category, but a single unit so it needs a different kind of referencing)
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Sun Sep 24, 2017 1:08 am
by Sunrise Samurai
Fixed image name, unit Id, and unit id string (I hope)
Pretty sure I got the bonus right this time. I copied it right out of elf archer.....which after some comparison, may have been a bit easier for a starting point

that's where I figured out some of the rest I did wrong.
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Sun Sep 24, 2017 6:05 am
by Stratego (dev)
the unit idString (unitTypeName) is still not right, jsonizing an existing unit you can not change it.
but checking further.
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Sun Sep 24, 2017 6:11 am
by Stratego (dev)
ok by observing i see these:
- the unit typename (idString)
- you have not defined where the player can build it.
- the bonus line is not singular (maybe the elf was not either, i will make that too:
this is more readable if we have more bonus lines, and more easily copy+pasteable into other units:
"trnBonusList":[
{"modifier":0.5, "unitList":{"categories":["U_CHEAP_INFANTRY_MELEE"],"unitTypes":["UNIT_ORNITHOPTER"]}}
],
please
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Mon Sep 25, 2017 4:10 pm
by Sunrise Samurai
Unit type name should be "UNIT_ARCHER" I assume? And not sure what you mean by not singular? Is what you posted copy/pasteable into the json? It looks like it needs spaces like the rest.
And as for not defining where it's built......oops

guess it wouldn't cramp anybody's style too much if they can't make archers right?
I'll fix that when I get more time than my lunch break. 30 minutes isn't enough to do everything I want to do

Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Mon Sep 25, 2017 6:01 pm
by Stratego (dev)
Sunrise Samurai wrote:Unit type name should be "UNIT_ARCHER" I assume?
yes
And not sure what you mean by not singular? Is what you posted copy/pasteable into the json? It looks like it needs spaces like the rest.
yes pput it in this form:
"trnBonusList":[
{"modifier":1.5, "unitList":{"categories":["U_CHEAP_INFANTRY_MELEE"],"unitTypes":["UNIT_ORNITHOPTER"]}},
{"modifier":2.5, "unitList":{"categories":["U_CHEAP_INFANTRY_MELEE"],"unitTypes":["UNIT_ORNITHOPTER"]}},
{"modifier":3.5, "unitList":{"categories":["U_CHEAP_INFANTRY_MELEE"],"unitTypes":["UNIT_ORNITHOPTER"]}},
{"modifier":4.5, "unitList":{"categories":["U_CHEAP_INFANTRY_MELEE"],"unitTypes":["UNIT_ORNITHOPTER"]}},
{"modifier":5.5, "unitList":{"categories":["U_CHEAP_INFANTRY_MELEE"],"unitTypes":["UNIT_ORNITHOPTER"]}}
],
one line is one bonus line, (one "modifier" keyword)
And as for not defining where it's built......oops

guess it wouldn't cramp anybody's style too much if they can't make archers right?
yes please put it in.
I'll fix that when I get more time than my lunch break. 30 minutes isn't enough to do everything I want to do

ok!
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Tue Sep 26, 2017 12:57 am
by Sunrise Samurai
Ok. Should all be fixed now. Surprisingly, the json checker says it's valid, so hopefully it's good.
Re: Sunrise Samurai (AOF fan) - Unit json (json edit, bonusl
Posted: Tue Sep 26, 2017 4:09 am
by Stratego (dev)
perfect! PASSED!