Lion.Kanzen Posted October 24, 2017 Report Share Posted October 24, 2017 8 minutes ago, wowgetoffyourcellphone said: only have bad memories with EE. and its worst with EE2 Quote Link to comment Share on other sites More sharing options...
Nescio Posted October 24, 2017 Author Report Share Posted October 24, 2017 6 hours ago, wowgetoffyourcellphone said: ? 16 hours ago, Nescio said: 45. Anyone able to explain why selling resources works but buying not, after I added silver? This still annoys me. 16 hours ago, Nescio said: And in which file can I replace the bribary cost of 500 metal with 250 silver? Found it: templates/special/spy.xml It's not the first time I repeatedly overlooked that important special/ folder... 7 hours ago, fatherbushido said: 48. Yes that's this one. (The tooltip should be change accordingly as those modifications are already handled in Template.js). Don't consider that patch as officialy recommended. It is not reviewed. (For example, take care of rounding issues, if you use only integers addition it will be fine). It does seem to work: However, 5*1.5=7.5 and resources are integers, so I suppose the code of that patch ought to be improved. Nevertheless, I actually only intend to avoid multiplicating loot and just use only adding integers. 7 hours ago, fatherbushido said: 45. Your modified files are on github? They are now: https://github.com/0abc/0abc-unified Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted October 24, 2017 Report Share Posted October 24, 2017 45. What did you exactly with the barter component in the last two commits? Quote Link to comment Share on other sites More sharing options...
Nescio Posted October 24, 2017 Author Report Share Posted October 24, 2017 3 minutes ago, fatherbushido said: 45. What did you exactly with the barter component in the last two commits? Nothing. I tried out if including an unchanged https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/Barter.js would help; it didn't, therefore I removed that file from my mod. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted October 24, 2017 Report Share Posted October 24, 2017 Well, did you add the bartermultiplier for silver resource in the player template? (special/player.xml) Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted October 24, 2017 Report Share Posted October 24, 2017 That's the issue. https://github.com/0abc/0abc-unified/blob/master/simulation/templates/special/player.xml Quote Link to comment Share on other sites More sharing options...
Nescio Posted October 24, 2017 Author Report Share Posted October 24, 2017 (edited) 2 hours ago, fatherbushido said: Well, did you add the bartermultiplier for silver resource in the player template? (special/player.xml) Great, that's it, many thanks for pointing it out, silver now works! 2 hours ago, Nescio said: It's not the first time I repeatedly overlooked that important special/ folder... Although buying and selling seems to work, I still get a warning I don't understand whenever I start or load a game: WARNING: JavaScript warning: simulation/components/Barter.js line 45 reference to undefined property multiplier.buy[resource] Furthermore, I still want to disable bartering resources other than silver directly; only silver ought to be used for buying or selling other resources. Edited October 24, 2017 by Nescio one more thing Quote Link to comment Share on other sites More sharing options...
Nescio Posted October 25, 2017 Author Report Share Posted October 25, 2017 49. Another idea I have and would like to implement is the GUI displaying (e.g. in the resource bar) current numbers of: active food gatherers active wood gatherers active metal gatherers active stone gatherers idle workers What do I need to do for this? Quote Link to comment Share on other sites More sharing options...
Grugnas Posted October 25, 2017 Report Share Posted October 25, 2017 (edited) can i ask here questions relative to AI behavior modify? Edited October 25, 2017 by Grugnas Quote Link to comment Share on other sites More sharing options...
leper Posted October 25, 2017 Report Share Posted October 25, 2017 #643. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted October 27, 2017 Report Share Posted October 27, 2017 On 24/10/2017 at 4:54 PM, Nescio said: Although buying and selling seems to work, I still get a warning I don't understand whenever I start or load a game: WARNING: JavaScript warning: simulation/components/Barter.js line 45 reference to undefined property multiplier.buy[resource] Furthermore, I still want to disable bartering resources other than silver directly; only silver ought to be used for buying or selling other resources. That's a really annoying bug. When putting warn(uneval(this.template.BarterMultiplier)) in the Init of the Player component, we see that the 5th resources is not taken into account. I hope it's because we miss something when using the resource feature (that would be the best). I will read the doc on trac. edit: I can't understand right now. Let's say it's magical since we find an explication. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted October 27, 2017 Report Share Posted October 27, 2017 Do you work on svn or a22? I tested with a22 and delenda est mod, I hadn't the error with the glory resources. So: - we (in fact you :p) do something wrong when modding - something changed since a22 about that Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted October 27, 2017 Report Share Posted October 27, 2017 Ah forget that, you have to edit the special/player_gaia.xml files @Nescio Quote Link to comment Share on other sites More sharing options...
Nescio Posted October 27, 2017 Author Report Share Posted October 27, 2017 (edited) On 25/10/2017 at 6:19 PM, leper said: #643. Many thanks, that's what I needed! I'm currently working on displaying resources (and gatherer numbers) in a separate panel, arranged vertically. 4 hours ago, fatherbushido said: Do you work on svn or a22? The latest stable release, i.e. A22. 4 hours ago, fatherbushido said: Ah forget that, you have to edit the special/player_gaia.xml files @Nescio And another file I overlooked, many thanks for pointing it out! That annoying warning has now disappeared (finally!). Still on my silver-to-do list: fix trader gain at 100% silver disable directly bartering resources other than silver; only silver should be used for buying and selling other resources remove the market requirement for bartering resources redesign the resource and barter and trade GUI panels Just in case anyone else intends to start adding resources, you need: to create: art/textures/ui/session/icons/resources/{newresource}.png art/textures/ui/session/icons/resources/{newresource}_small.png simulation/data/resources/{newresource}.json to edit: gui/common/setup_resources.xml gui/session/selection_panels.js gui/session/selection_panels_left/barter_panel.xml gui/session/top_panel/resources.xml simulation/templates/special/player.xml simulation/templates/special/player_gaia.xml simulation/templates/template_structure.xml https://trac.wildfiregames.com/wiki/ModdingResources is helpful but apparently incomplete; it does not mention the player files Edited October 27, 2017 by Nescio ce Quote Link to comment Share on other sites More sharing options...
Imarok Posted October 27, 2017 Report Share Posted October 27, 2017 2 hours ago, Nescio said: Many thanks, that's what I needed! I'm currently working on displaying resources (and gatherer numbers) in a separate panel, arranged vertically. The latest stable release, i.e. A22. And another file I overlooked, many thanks for pointing it out! That annoying warning has now disappeared (finally!). Still on my silver-to-do list: fix trader gain at 100% silver disable directly bartering resources other than silver; only silver should be used for buying and selling other resources remove the market requirement for bartering resources redesign the resource and barter and trade GUI panels Just in case anyone else intends to start adding resources, you need: to create: art/textures/ui/session/icons/resources/{newresource}.png art/textures/ui/session/icons/resources/{newresource}_small.png simulation/data/resources/{newresource}.json to edit: gui/common/setup_resources.xml gui/session/selection_panels.js gui/session/selection_panels_left/barter_panel.xml gui/session/top_panel/resources.xml simulation/templates/special/player.xml simulation/templates/special/player_gaia.xml simulation/templates/template_structure.xml https://trac.wildfiregames.com/wiki/ModdingResources is helpful but apparently incomplete; it does not mention the player files Could you complete the wiki entry? (It's free to edit...) 1 Quote Link to comment Share on other sites More sharing options...
Nescio Posted October 28, 2017 Author Report Share Posted October 28, 2017 On 27/10/2017 at 2:30 PM, Imarok said: Could you complete the wiki entry? (It's free to edit...) And I've largely rewritten the page, expanding and updating the parts on changing, removing, and adding resources from the game; I've left the “gathering” section unaltered (I've no experience with this (silver is intended to be not directly gatherable)); information on the AI and maps is also absent. Anyone interested in improving the page further, do not hesitate to edit it (I'm done with it now). On 25/10/2017 at 6:19 PM, leper said: #643. So I've attempted to include this over-five-years-old proposed patch into my mod, and although I didn't get any error messages after including the js parts into the simulation/components/ files (which was surprising, because I didn't really know what I was doing), I've not succeeded in actually displaying current gatherer numbers; the gui has simply changed too much, and amongst other things, resources are no longer hardcoded individually. For now I've shelved this idea, my programming skills are simply too limited. I would really appreciate it if someone with more coding experience could eventually update #643 and include it into 0 A.D. I don't think I'm the only one who considers displaying gatherer numbers useful. 45. Detaching the minimap from the central panel was surprisingly easy; moving the resources from the top panel to a new, separate panel turned out to be unexpectedly difficult. Apparently I'm overlooking something somewhere. Perhaps someone could help me by pointing out what I have to do to create a new (vertically arranged panel, e.g.: (x1,y1) --- (x2, y1) | resource[1] | | resource[2] | | resource[3] | | resource[4] | | resource[5] | (x1,y2) --- (x2, y2) 50. 0 A.D.'s AI is flexible in some respects: it trains new units, it researches new technologies, and it acquires and spends silver (0abc's new resource). Unfortunately it seems the AI is not capable of handling new or renamed structures. Apparently buildings are hardcoded somewhere in the AI files. Now, how to make the AI actually use new structures? On 25/10/2017 at 4:36 PM, Grugnas said: can i ask here questions relative to AI behavior modify? (Apparently I'm not the only one who would appreciate an introduction to how the AI works.) Structure changes I've implemented: made the fortress a purely defensive structure (the AI builds them) moved heroes to the centre (the AI trains them) moved siege weapons to siege workshops (surprisingly the AI builds these) moved war elephants to elephant stables (I haven't seen any of these) moved champions to military halls, see below (the AI doesn't use them) separated the military docks into economic docks (resource dropsite, trade route market, constructs fishing boats, merchant ships, war barges, and fire ships) military shipyards (constructs war galleys) separated the barracks into: infantry barracks cavalry stables camel stables created a military hall (structures which trains most of a faction's champions) gymnasium (athen), tavern (gaul), hall (pers), syssiton (spart) are merged and renamed into hall also created halls for cart, mace, ptol, sele renamed Persian adapana into palace and also added a palace for the Mauryans With a few exceptions, the AI does not seem to be capable of handling these. Ideally structures shouldn't be hardcoded in the AI files, allowing the AI to be flexible (as it is with units and technologies). Realistically, a guide to explain how to make the AI actually use new structures would already be great, not only for me, but also for many other mods (e.g. HC, VP, DE). Furthermore, this is also important for the default game; the Art team is creating many new structures; besides, I've never seen the AI actually building dog kennels, walls, and wonders. If the AI would be capable of handling all available structures, 0 A.D. would undoubtedly be a much more enjoyable game. Quote Link to comment Share on other sites More sharing options...
Grugnas Posted October 28, 2017 Report Share Posted October 28, 2017 AI never upgrades towers, shich struggle me into an eventual building upgrade ( matter of fact seleucid reforms are made through technology pair ). I simply managed to avoid AI from hunting chicknes with not cavalry units and gathering fruits with infantry ( they stay idle though ). Quote Link to comment Share on other sites More sharing options...
Imarok Posted October 28, 2017 Report Share Posted October 28, 2017 Thx for updating 1 Quote Link to comment Share on other sites More sharing options...
Servo Posted October 28, 2017 Report Share Posted October 28, 2017 Corrals still longer build time despite lowered HP (600)on build but I noticed the structure tree has 5000 build time. Could it be that the structure tree specs (parent?) overides gameplay build? Quote Link to comment Share on other sites More sharing options...
Nescio Posted November 4, 2017 Author Report Share Posted November 4, 2017 Currently I'm working on a new resource panel gui (again). Here is the code of the resources.xml file: <?xml version="1.0" encoding="utf-8"?> <object name="resourceCounts" size="0 32 116 244" sprite="genericPanel" type="image"> <repeat count="5"> <object name="resource[n]" size="0 6 108 46" type="image" style="resourceCounter" tooltip_style="sessionToolTipBold"> <object size="4 4 36 36" type="image" name="resource[n]_icon" ghost="true"/> <object size="32 0 100%-4 100%-4" type="text" style="resourceText" name="resource[n]_count"/> </object> </repeat> </object> This results into: Now I want to list the resources vertically (to the left of the minimap), instead of horizontally. Although I guess it's probably not that difficult, I can't figure out how to achieve that. Any suggestions? Quote Link to comment Share on other sites More sharing options...
leper Posted November 4, 2017 Report Share Posted November 4, 2017 You will have to create a verticallySpaceObjects functions that is quite similar to the currently existing horizontallySpaceObjects (gui/common/functions_utility.js), then change the call to that in gui/common/sessions.js to place the resource objects. I think the former or something quite similar to it might be in one of s0600204's patches or branches. The latter will be hard to maintain, so it would be best if you first moved that part into another file that just does that. And after you have done that you will notice that the population icon and counter will not be aligned properly. Mostly because that is handled slightly differently from the other "real" resources, so it might make sense to change that so that that specific hard-coding isn't needed anymore. Quote Link to comment Share on other sites More sharing options...
Nescio Posted November 4, 2017 Author Report Share Posted November 4, 2017 Many thanks! It worked: Quote Link to comment Share on other sites More sharing options...
leper Posted November 4, 2017 Report Share Posted November 4, 2017 In case it wasn't clear, you could most likely also add the verticallySpaceObjects function to another js file that is loaded (read a new one), and I'm quite sure if you'd factor out the piece of code that's aligning the resources into some function and place that in a new file, then the latter is quite likely to be accepted if submitted as a patch. Will also help with future updates where you don't have to figure out what you changed in some files. And if that isn't possible at least add the unmodified file in a commit, then have another commit with the changes only. 1 Quote Link to comment Share on other sites More sharing options...
Nescio Posted November 4, 2017 Author Report Share Posted November 4, 2017 Now you've lost me, I'm afraid. What exactly do you want me to put into a patch? All I did was inserting a new verticallySpaceObjects into functions_utility.js and subsequently changed a few lines in sessions.js 3 hours ago, leper said: And if that isn't possible at least add the unmodified file in a commit, then have another commit with the changes only. Which file(s) do you mean exactly? Quote Link to comment Share on other sites More sharing options...
leper Posted November 4, 2017 Report Share Posted November 4, 2017 Moving the part that does the layout of the resource objects into a function and calling that from the function where you replaced horizontallySpaceObjects with verticallySpaceObjects. Possibly placing that in some other file if you want to. Mostly so in your mod (or someone else in a mod) can just replace that new function without having to ship a modified copy of session.js. You added full copies of session.js and functions_utility.js to your mod, with small modifications. This is going to be hard to maintain. If the only thing you actually ship in your mod are two script files, one with the verticallySpaceObjects function, and one with the modified placement/layout function (which needs that part to be split from the function it is currently in), then the amount of work you will have to do when you upgrade to the next release will be reduced by a lot. 2 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.