fatherbushido Posted April 16, 2020 Report Share Posted April 16, 2020 For fixing some bugs I am changing the auras and technology affects syntax in the json files. I would request inputs from @Nescio or @wowgetoffyourcellphone (not exclusive) as currently active modders about what they prefer between type A and type B. Type A: affects: [["Pork", "Beans"]] affects: [["Pork"]] affects: [["Pork"], ["Bean"]] Type B: affects: "Pork+Beans" affects: "Pork" affects: "Pork Bean" 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted April 16, 2020 Report Share Posted April 16, 2020 I am not sure. Perhaps an example from the game (or from one of our mods) would help. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 16, 2020 Author Report Share Posted April 16, 2020 For example in: https://github.com/JustusAvramenko/delenda_est/blob/master/simulation/data/technologies/advanced_unit_bonus.json { "genericName": "Stats for advanced units", "autoResearch": true, "description": "These stat modifications will be applied to advanced and elite units.", "modifications": [ {"value": "ResourceGatherer/BaseSpeed", "multiply": 0.75 }, {"value": "Health/Max", "multiply": 1.1 }, {"value": "Armour/Hack", "add": 1 }, {"value": "Armour/Pierce", "add": 1 }, {"value": "Armour/Crush", "add": 1 }, {"value": "UnitMotion/WalkSpeed", "multiply": 0.95, "affects": "Infantry" }, {"value": "UnitMotion/WalkSpeed", "multiply": 0.95, "affects": "Cavalry" }, {"value": "Attack/Ranged/Damage/MaxRange", "multiply": 1.2, "affects": "Ranged" }, {"value": "Vision/Range", "multiply": 1.2, "affects": "Ranged" }, {"value": "Attack/Ranged/Damage/Spread", "multiply": 0.90, "affects": "Ranged" }, {"value": "Attack/Melee/Damage/Hack", "multiply": 1.1, "affects": "Melee" }, {"value": "Attack/Capture/Capture", "multiply": 1.1 }, {"value": "Heal/Range", "multiply": 1.1, "affects": "Healer" }, {"value": "Vision/Range", "multiply": 1.1, "affects": "Healer" }, {"value": "Heal/HP", "multiply": 1.1, "affects": "Healer" }, {"value": "Cost/Resources/food", "add": 5, "affects": "Citizen Soldier -Mercenary" }, {"value": "Cost/Resources/wood", "add": 5, "affects": "Archer -Mercenary" }, {"value": "Cost/Resources/wood", "add": 5, "affects": "Spear -Mercenary" }, {"value": "Cost/Resources/wood", "add": 5, "affects": "Javelin -Mercenary" }, {"value": "Cost/Resources/wood", "add": 5, "affects": "Crossbow -Mercenary" }, {"value": "Cost/Resources/metal", "add": 5, "affects": "Sword -Mercenary" }, {"value": "Cost/Resources/metal", "add": 5, "affects": "Sling -Mercenary" }, {"value": "Cost/Resources/glory", "add": 5, "affects": "Healer" }, {"value": "Cost/BuildTime", "add": 2, "affects": "Citizen" } ], "affects": ["Advanced Unit", "Elite Unit"] } Which one of those two things would you prefer (in any case there are scripts to do it auto): "affects": [["Advanced", "Unit"], ["Elite", "Unit"]] or "affects": "Advanced+Unit Elite+Unit" Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted April 16, 2020 Report Share Posted April 16, 2020 14 minutes ago, fatherbushido said: "affects": "Advanced+Unit Elite+Unit" Maybe this works. Quote Link to comment Share on other sites More sharing options...
Nescio Posted April 16, 2020 Report Share Posted April 16, 2020 2 hours ago, fatherbushido said: For fixing some bugs I am changing the auras and technology affects syntax in the json files. What exactly is wrong with the current syntax? I'm not saying is perfect, but I'm used to it now. If it is to be changed, I'd recommend following the syntax used in the xml templates, i.e. a space means “or” and a plus means “and”. 20 minutes ago, fatherbushido said: "affects": "Advanced+Unit Elite+Unit" I'd also favour that one (less typing than the alternative with square brackets). This would even be shorter: "affects": "Unit+(Advanced Elite)" (I'm not entirely sure that's an improvement, though.) Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 16, 2020 Author Report Share Posted April 16, 2020 (edited) 8 minutes ago, Nescio said: What exactly is wrong with the current syntax? I'm not saying is perfect, but I'm used to it now. It's bugged and source of confusions. I expected that the second form I suggested would be preferred. I will opt for that one. The shorter form you suggest can't be supported. You need to put things in disjunctive normal form. Edited April 16, 2020 by fatherbushido Quote Link to comment Share on other sites More sharing options...
Nescio Posted April 16, 2020 Report Share Posted April 16, 2020 4 minutes ago, fatherbushido said: It's bugged and source of confusions. I expected that the second form I suggested would be preferred. I will opt for that one. Once you've done that in your fork, perhaps you could consider making a patch for 0 A.D. as well? I don't know if and when you intend to release your project, but having a different syntax would mean more work for modders, if they decide to switch or port from one to the other. 41 minutes ago, fatherbushido said: {"value": "Cost/Resources/wood", "add": 5, "affects": "Archer -Mercenary" }, Shouldn't that be "Archer+!Mercenary"? Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 16, 2020 Author Report Share Posted April 16, 2020 17 minutes ago, Nescio said: but having a different syntax would mean more work for modders, if they decide to switch or port from one to the other. Indeed that's problematic :/ We try to document the more we can and I had already offered to helping in converting mods. If there are massive changes, we try to make them scriptable. 17 minutes ago, Nescio said: Shouldn't that be "Archer+!Mercenary"? Yes it should. (But anyway none of them will work as expected here.) Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted April 16, 2020 Report Share Posted April 16, 2020 22 minutes ago, Nescio said: I don't know if and when you intend to release your project, but having a different syntax would mean more work for modders, if they decide to switch or port from one to the other. Welcome to my world. 1 Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 16, 2020 Author Report Share Posted April 16, 2020 1 minute ago, wowgetoffyourcellphone said: Welcome to my world. :D Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted April 16, 2020 Report Share Posted April 16, 2020 26 minutes ago, Nescio said: Shouldn't that be "Archer+!Mercenary"? Is that what it should be right now? Because the tech is indeed bugged currently. Quote Link to comment Share on other sites More sharing options...
Nescio Posted April 16, 2020 Report Share Posted April 16, 2020 4 minutes ago, wowgetoffyourcellphone said: Is that what it should be right now? Because the tech is indeed bugged currently. Try replacing the hyphen-minus with an exclamation mark; see e.g. https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/data/auras/teambonuses/pers_player_teambonus.json 1 Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 18, 2020 Author Report Share Posted April 18, 2020 On 4/16/2020 at 8:13 PM, fatherbushido said: (But anyway none of them will work as expected here.) Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted April 18, 2020 Report Share Posted April 18, 2020 On 4/16/2020 at 12:18 PM, fatherbushido said: So you are trying to no have mods. You must release a fist version then change the syntax. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 18, 2020 Author Report Share Posted April 18, 2020 25 minutes ago, Lion.Kanzen said: So you are trying to no have mods. Not at all mate :/ I even offered to do the job. 25 minutes ago, Lion.Kanzen said: You must release a fist version then change the syntax. I didn't understand Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted April 18, 2020 Report Share Posted April 18, 2020 Just now, fatherbushido said: Not at all mate :/ I even offered to do the job. I didn't understand You must have a release or you project then you can make the syntax if you don't follow this way you probably don't have any modder in your project. Quote Link to comment Share on other sites More sharing options...
happyconcepts Posted April 18, 2020 Report Share Posted April 18, 2020 Greetings bushido There are enough capricious and arbitrary changes being made in this world. This change would directly affect me e.g. "affects": "mod maintainer", What is the benefit to changing how these tech targets are parsed? Which bug(s) does it address? Thank you for your time. 1 Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 18, 2020 Author Report Share Posted April 18, 2020 @happyconcepts (and others): if you need something send me a pm or come asking on https://webchat.freenode.net/#forkad irc channel. Quote Link to comment Share on other sites More sharing options...
Silier Posted April 20, 2020 Report Share Posted April 20, 2020 As far as I know MatchesClassList supports A and B variants already. For reference "A B+C" == A or (B and C) Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted April 20, 2020 Author Report Share Posted April 20, 2020 (edited) 22 minutes ago, Angen said: As far as I know MatchesClassList supports A and B variants already. For reference "A B+C" == A or (B and C) If you need an explanation, just ask me in pm or come asking on https://webchat.freenode.net/#forkad irc channel. Edited April 20, 2020 by fatherbushido Quote Link to comment Share on other sites More sharing options...
Silier Posted April 20, 2020 Report Share Posted April 20, 2020 Oh, I see what can cause confusion. It is mixed version, I do not like that one really. Btw @wowgetoffyourcellphone if you want "value": "Cost/Resources/wood", "add": 5, "affects": "Archer !Mercenary" to be Archer AND NOT Mercenary you need to enclose that into [ ] so it would be like ["Archer !Mercenary"] what can be ["Archer+!Mercenary"] (I know, bleh) or "Archer+!Mercenary" or [["Archer", "!Mercenary"]] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.