Pyrophorus Posted May 19, 2017 Report Share Posted May 19, 2017 Hi everyone, New to the game, I created a new civilization to explore all the technologies, units and so on. The way one can modify the game even in details is really impressive and really easy. Thumbs up !!! Just a little thing: it would be nice to have a DTD for units/structures xml files, mainly to offer the many options the various tags have. For instance, the <passability_class> have "large" and "default" possible values, but you have to scan many files to discover that (and maybe there is another value I missed ! :-)). Now with my questions: I tried to give a <Capture> attack to siege tower (inheriting from template_unit_mechanical_siege_tower). In the game, the siege tower has the "capture" cursor, and clicking a building make the tower move and stop at the "MaxRange" distance, but then, no capture happens. The tower keep shooting arrows and the capture bar of the building don't change. Is it normal or I missed something ? When loading a saved game, at least some specs of the units are updated from the description files (if changed meanwhile), but structures specs are not. Is this correct ? Thanks in advance for the replies... Friendly, 1 Quote Link to comment Share on other sites More sharing options...
fatherbushido Posted May 19, 2017 Report Share Posted May 19, 2017 @Pyrophorus For the Capture thing, it should be fixed sooner or later. If you really want do it, you have to see that in your mod, something like (provided without warranty) should do the job: Index: binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- binaries/data/mods/public/simulation/components/UnitAI.js (révision 19609) +++ binaries/data/mods/public/simulation/components/UnitAI.js (copie de travail) @@ -2013,7 +2013,7 @@ // BuildingAI has it's own attack-routine var cmpBuildingAI = Engine.QueryInterface(this.entity, IID_BuildingAI); - if (!cmpBuildingAI) + if (!cmpBuildingAI || this.order.data.attackType != "Ranged") { let cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); cmpAttack.PerformAttack(this.order.data.attackType, target); For the second thing, what do you mean by specs? For the documentation, You will find many things here https://trac.wildfiregames.com/wiki, for example https://trac.wildfiregames.com/wiki/Aura_Templates https://trac.wildfiregames.com/wiki/Technology_Templates https://trac.wildfiregames.com/wiki/Mod_Layout are relevant page. The xml entries documentation is currently not online but I attached it as an html page. entity-docs.html 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 19, 2017 Report Share Posted May 19, 2017 9 minutes ago, fatherbushido said: For the Capture thing, it should be fixed sooner or later. If you really want do it, you have to see that in your mod, something like (provided without warranty) should do the job: Index: binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- binaries/data/mods/public/simulation/components/UnitAI.js (révision 19609) +++ binaries/data/mods/public/simulation/components/UnitAI.js (copie de travail) @@ -2013,7 +2013,7 @@ // BuildingAI has it's own attack-routine var cmpBuildingAI = Engine.QueryInterface(this.entity, IID_BuildingAI); - if (!cmpBuildingAI) + if (!cmpBuildingAI || this.order.data.attackType != "Ranged") { let cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); cmpAttack.PerformAttack(this.order.data.attackType, target); This kind of thing get you in trouble later when the file is changed by the public mod. I should know... Quote Link to comment Share on other sites More sharing options...
elexis Posted May 19, 2017 Report Share Posted May 19, 2017 Can we add that check to Attack.js until someone is willing to rewrite BuildingAI? :-( Quote Link to comment Share on other sites More sharing options...
Pyrophorus Posted May 19, 2017 Author Report Share Posted May 19, 2017 (edited) Thanks to you all ! 5 hours ago, fatherbushido said: For the Capture thing, it should be fixed sooner or later. If you really want do it, you have to see that in your mod, something like (provided without warranty) should do the job: OK, I'll check this, even if... 4 hours ago, wowgetoffyourcellphone said: This kind of thing get you in trouble later when the file is changed by the public mod. I should know... [EDIT] Actually, it works... Great... 5 hours ago, fatherbushido said: For the second thing, what do you mean by specs? I mean specifications/properties/values for a structure or a unit. For instance, if I change the Attack/Hack value in a unit file, I think I will see this new value in the unit info, even if I load a saved game where the unit had previously another value. But it seems it's not the case with structures (they keep their original values AFAICS). Is this right ? 5 hours ago, fatherbushido said: The xml entries documentation is currently not online but I attached it as an html page. entity-docs.html Thanks for this great resource. It's just what I expected. Friendly, Edited May 19, 2017 by Pyrophorus update Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 19, 2017 Report Share Posted May 19, 2017 4 hours ago, elexis said: Can we add that check to Attack.js until someone is willing to rewrite BuildingAI? :-( I'd be willing to rewrite it with some help. Quote Link to comment Share on other sites More sharing options...
leper Posted May 19, 2017 Report Share Posted May 19, 2017 3 hours ago, Pyrophorus said: I mean specifications/properties/values for a structure or a unit. For instance, if I change the Attack/Hack value in a unit file, I think I will see this new value in the unit info, even if I load a saved game where the unit had previously another value. But it seems it's not the case with structures (they keep their original values AFAICS). Is this right ? Changing templates and loading save games might work, but I would recommend against doing that for proper testing. Same as hotloading is fine for figuring out if something fixes a bug, but could break unrelated things in various ways. Stats for entities present in a saved game state should still be the same after loading, so newly trained units will have the new values while everything the existed before that point will still have the old values. Same as for hotloading (exept that there you might run into some things being cached and not being invalidated when hotloading). 1 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.