Jump to content

Capture buildings using siege tower ?


Pyrophorus
 Share

Recommended Posts

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,

  • Like 1
Link to comment
Share on other sites

@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

  • Like 2
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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 by Pyrophorus
update
Link to comment
Share on other sites

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).

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...