Freagarach Posted July 9, 2019 Report Share Posted July 9, 2019 23 hours ago, Nescio said: 60. Currently 0 A.D. has “Wonder” and “Capture the Relic” victory conditions. I've been pondering about adding another, similar one, winning by centre count, e.g. control at least 10 centres for 10 minutes. Moving catafalques inside a heavily fortified base or concentrating your forces around a wonder is easier than protecting a number of centres with distances in between. Unfortunately I have no idea what has to be done to implement it. Any suggestions? I like the idea! I haven't really dug into it, but the victory conditions itself can be found in: `simulation/data/settings/victory_conditions`, whilst the scripts they refer to are located in `maps/scripts`. 1 Quote Link to comment Share on other sites More sharing options...
Nescio Posted July 19, 2019 Author Report Share Posted July 19, 2019 There are many hotkeys already in game, probably more than a normal person can remember. However, I'd like to have one more: pressing `Home` to cycle through your centres. Any suggestions on how to implement that? 2 Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted July 19, 2019 Report Share Posted July 19, 2019 5 hours ago, Nescio said: There are many hotkeys already in game, probably more than a normal person can remember. However, I'd like to have one more: pressing `Home` to cycle through your centres. Any suggestions on how to implement that? I would suggest looking at how hotkey.selection.idleunit is implemented. First you need to add the hotkey definition to default.cfg. Then you would implement something like findIdleUnit in binaries/data/mods/public/gui/session/input.js. Here are a few tickets covering this feature: #1899, #1492. You might be able to reuse some or all of those patches. 1 Quote Link to comment Share on other sites More sharing options...
Nescio Posted July 21, 2019 Author Report Share Posted July 21, 2019 On 7/19/2019 at 4:43 PM, historic_bruno said: First you need to add the hotkey definition to default.cfg. Yeah, but that file is outside the public/ folder, so I'm not sure how that could be done with a mod? Quote Link to comment Share on other sites More sharing options...
nani Posted July 21, 2019 Report Share Posted July 21, 2019 On 7/19/2019 at 11:09 AM, Nescio said: However, I'd like to have one more: pressing `Home` to cycle through your centres. Any suggestions on how to implement that? Probably will add this to my mod in the next version. As historic_bruno said there are already patches with it implemented on trac. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted July 22, 2019 Report Share Posted July 22, 2019 7 hours ago, Nescio said: Yeah, but that file is outside the public/ folder, so I'm not sure how that could be done with a mod? You have access to the following functions in JS (see JSInterface_ConfigDB.cpp): bool Engine.ConfigDB_HasChanges(namespace) bool Engine.ConfigDB_SetChanges(namespace, bool) string Engine.ConfigDB_GetValue(namespace, key) bool Engine.ConfigDB_CreateValue(namespace, key, value) bool Engine.ConfigDB_RemoveValue(namespace, key) bool Engine.ConfigDB_WriteFile(namespace, path) bool Engine.ConfigDB_WriteValueToFile(namespace, key, value, path) bool Engine.ConfigDB_SetFile(namespace, path) bool Engine.ConfigDB_Reload(namespace) For namespace, I guess "mod" is most appropriate. I think you could check if your new hotkey(s) are set yet in mod.cfg (mod namespace) and if not, set the defaults. Also check out the options GUI implementation. Note: this isn't ideal -- each mod should have its own separate config. 3 Quote Link to comment Share on other sites More sharing options...
Nescio Posted August 9, 2019 Author Report Share Posted August 9, 2019 62. If I understand correctly, elevation (from terrain, position, and entity's <Attack/Ranged/ElevationBonus>) increases effective maximum range (simulation/components/Attack.js: `Attack.prototype.GetRange`). However, I'd like it to also improve ranged attack damage; e.g. an archer standing on a wall 11.5 above the ground would inflict +23% damage on someone below. I guess it might actually be quite easy to do, but my understanding of JavaScript is rather limited. Quote Link to comment Share on other sites More sharing options...
Freagarach Posted August 9, 2019 Report Share Posted August 9, 2019 7 minutes ago, Nescio said: 62. If I understand correctly, elevation (from terrain, position, and entity's <Attack/Ranged/ElevationBonus>) increases effective maximum range (simulation/components/Attack.js: `Attack.prototype.GetRange`). However, I'd like it to also improve ranged attack damage; e.g. an archer standing on a wall 11.5 above the ground would inflict +23% damage on someone below. I guess it might actually be quite easy to do, but my understanding of JavaScript is rather limited. D781 I plan on revising that next month. (To also include melee attacks.) 1 Quote Link to comment Share on other sites More sharing options...
Nescio Posted August 9, 2019 Author Report Share Posted August 9, 2019 10 minutes ago, Freagarach said: D781 I plan on revising that next month. (To also include melee attacks.) Great! Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted August 10, 2019 Report Share Posted August 10, 2019 (edited) On 8/9/2019 at 12:40 PM, Nescio said: 62. If I understand correctly, elevation (from terrain, position, and entity's <Attack/Ranged/ElevationBonus>) increases effective maximum range (simulation/components/Attack.js: `Attack.prototype.GetRange`). However, I'd like it to also improve ranged attack damage; e.g. an archer standing on a wall 11.5 above the ground would inflict +23% damage on someone below. I guess it might actually be quite easy to do, but my understanding of JavaScript is rather limited. Is this because of the trajectory/gravity adding force to the projectile? While the height bonus cannot currently be implemented (on hills or elevations), the wall attack bonus can certainly be implemented right now. Edited August 10, 2019 by wowgetoffyourcellphone Quote Link to comment Share on other sites More sharing options...
Nescio Posted August 22, 2019 Author Report Share Posted August 22, 2019 Another idea I'd like to try out but have no idea how to implement: 63. Instead of a player population setting, have a world population setting; each surviving player is then entitled to a 1/n share. E.g. a four player game with a world population of 600: all players have a maximum population limit of 150 at start; one player is defeated, the others can now have up to 200; then another is defeated, both survivors up to 300. Methinks this would provide an interesting dynamic (do you keep weak players alive to prevent stronger opponents from training more units?) while avoiding performance issues and improving realism. 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted August 22, 2019 Report Share Posted August 22, 2019 That would be a nice feature for the base game, definitely. Don't just leave it for a mod! Quote Link to comment Share on other sites More sharing options...
Freagarach Posted October 21, 2019 Report Share Posted October 21, 2019 @Nescio I saw on your feature wish list that the distance limit for buildings applies to all players? In `BuildRestrictions.js` after line 242 add: let players = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetAllPlayers(); Then at lines 255 and 267 (the range queries) replace [cmpPlayer.GetPlayerID()] with players . That should do the job Quote Link to comment Share on other sites More sharing options...
Stan` Posted October 21, 2019 Report Share Posted October 21, 2019 28 minutes ago, Freagarach said: @Nescio I saw on your feature wish list that the distance limit for buildings applies to all players? In `BuildRestrictions.js` after line 242 add: let players = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetAllPlayers(); Then at lines 255 and 267 (the range queries) replace [cmpPlayer.GetPlayerID()] with players . That should do the job Maybe could be translated in a gamemode ? 1 Quote Link to comment Share on other sites More sharing options...
Nescio Posted November 10, 2019 Author Report Share Posted November 10, 2019 On 10/21/2019 at 8:50 AM, Freagarach said: @Nescio I saw on your feature wish list that the distance limit for buildings applies to all players? In `BuildRestrictions.js` after line 242 add: let players = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetAllPlayers(); Then at lines 255 and 267 (the range queries) replace [cmpPlayer.GetPlayerID()] with players . That should do the job Thanks! That was quite easy, the AI isn't complaining either, and it's nice in combination with capturable foundations, so I've incorporated in my 0abc mod. 1 Quote Link to comment Share on other sites More sharing options...
Freagarach Posted November 15, 2019 Report Share Posted November 15, 2019 On 8/22/2019 at 7:40 PM, Nescio said: Another idea I'd like to try out but have no idea how to implement: 63. Instead of a player population setting, have a world population setting; each surviving player is then entitled to a 1/n share. E.g. a four player game with a world population of 600: all players have a maximum population limit of 150 at start; one player is defeated, the others can now have up to 200; then another is defeated, both survivors up to 300. Methinks this would provide an interesting dynamic (do you keep weak players alive to prevent stronger opponents from training more units?) while avoiding performance issues and improving realism. D2426. 2 Quote Link to comment Share on other sites More sharing options...
Sundiata Posted November 15, 2019 Report Share Posted November 15, 2019 Just now, Freagarach said: D2426. Oooh, new game mode? Sounds nice for vanilla as well... Quote Link to comment Share on other sites More sharing options...
Nescio Posted December 29, 2019 Author Report Share Posted December 29, 2019 Two other things I'd like to try out, without knowing how to implement them: 64. If you delete a foundation that's x (e.g. 60%) completed, you only get 1 - x (i.e. 40%) of the resource costs back, instead of the full amount. 65. Newly placed foundations start with some health, e.g. 10% of maximum, rather than just 1. Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted December 29, 2019 Report Share Posted December 29, 2019 24 minutes ago, Nescio said: Two other things I'd like to try out, without knowing how to implement them: 64. If you delete a foundation that's x (e.g. 60%) completed, you only get 1 - x (i.e. 40%) of the resource costs back, instead of the full amount. Perhaps that's what you are looking for: https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/Foundation.js#L88 Quote Link to comment Share on other sites More sharing options...
Freagarach Posted December 29, 2019 Report Share Posted December 29, 2019 Indeed what @fatherbushido said, it can also be seen there that that feature should already be present in vanilla? 44 minutes ago, Nescio said: 65. Newly placed foundations start with some health, e.g. 10% of maximum, rather than just 1. It is defined in templates/special/filter/foundation.xml that foundations start with 1 HP. One can set the health in Foundation.js in the function InitialiseConstruction. E.g.: Spoiler let cmpHealth = Engine.QueryInterface(this.entity, IID_Health); if (cmpHealth) cmpHealth.SetHitpoints(cmpHealth.GetMaxHitpoints() * 0.1); Should do the trick. Quote Link to comment Share on other sites More sharing options...
Nescio Posted December 29, 2019 Author Report Share Posted December 29, 2019 31 minutes ago, fatherbushido said: Perhaps that's what you are looking for: https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/Foundation.js#L88 Yes, it is, thank you for pointing out. What I wanted is actually already implemented. Now I wonder why I assumed it wasn't, and feel a bit dumb. 66. An option to deconstruct structures, which returns some resources but takes some time. Quote Link to comment Share on other sites More sharing options...
Nescio Posted December 29, 2019 Author Report Share Posted December 29, 2019 1 minute ago, Freagarach said: It is defined in templates/special/filter/foundation.xml that foundations start with 1 HP. One can set the health in Foundation.js in the function InitialiseConstruction. E.g.: Reveal hidden contents let cmpHealth = Engine.QueryInterface(this.entity, IID_Health); if (cmpHealth) cmpHealth.SetHitpoints(cmpHealth.GetMaxHitpoints() * 0.1); Should do the trick. Thanks! Would it also be possible to define the starting value (or percentage) in the templates, rather than fixing it at 10% for everything? E.g. corral starting with 5% of 500, i.e. 25, and the field with 20% of 250, i.e. 50. Quote Link to comment Share on other sites More sharing options...
Stan` Posted December 29, 2019 Report Share Posted December 29, 2019 It will be easy to do after the autobuild patch gets in (https://code.wildfiregames.com/D2492). Currently foundation component (the one where you'd define that value) are added to buildings at runtime under the form of filters (defined in templates/special/filters) and it's buggy to set values there. Once the buildable component has been set, it will be a few lines of code 1 Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted January 10, 2020 Report Share Posted January 10, 2020 Is there a summary of the requests with the according numbers? (It would save the time of going through the whole topic). Quote Link to comment Share on other sites More sharing options...
Freagarach Posted January 10, 2020 Report Share Posted January 10, 2020 1 hour ago, fatherbushido said: Is there a summary of the requests https://github.com/0abc/0abc-a23 will come the closest I guess ;) 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.