Jump to content

Freagarach

WFG Programming Team
  • Posts

    1.125
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Freagarach

  1. The elevation adapted range depends on the surrounding terrain. So the number in the template is acutally the attack-height offset (the point from which the projectile is actually fired), which is used to calculate the "real" range. (I made a diff a while ago to rename it: D2016.) I hope this clarifies it for you :)
  2. Update: It is in vanilla now! One can remove a property from the resource json file to prevent it from being bartered, traded or tributed.
  3. Do you have a link to a public repo where your code lies? That would make debugging a lot easier (and you don't have to upload every changed file here on the forum) :) In this case, you did remove the ability to build stone walls, but as you mentioned Now, the engine tries to remove wallset_stone from the template of those Spartans, but that (wallset_stone) is not there anymore. Like trying to get money of an empty bank account. That is what is causing the warnings. To fix it, you can remove those lines (those being: "-structures/{civ}_wallset_stone") from the Spartan templates.
  4. If I'm not mistaken, the game sees those as being multiplayer, so you'll have to select either multiplayer or singleplayer/multiplayer.
  5. Aye, this is for armour only. This would allow for a modder to circumvent specific resistance types. An example: The downside of this is, when we include it but noone uses it, that it means more code to maintain, more chance for bugs, for no benefit. I hope this clarifies it a bit @Trinketos? Otherwise feel free to ask! Anyone who is constructively participating on the forum is, IMHO, a contributor. But if you still want to be edited out (because you're no modder?), I'm willing to do that.
  6. This is spot on That (a percentage of damage based on the position) is currently not implemented, but is not that hard (see @Angen's battalion mod). What I envision is that a unit attacked from the front has a ~95% chance of using the shield to block damage (when not preoccupied, perhaps) and decreasing that percentage to "0" at the edges of the LOS of a person. But that has to be coded in seperately in "Attacking.js". (D2175 combined with D2182 and properly working formations, as @Alexandermb noted.) Glad to be of service!
  7. Hail to all modders! (@Exodarion, @darkinterloper, @borg-, @Nescio, @Angen, @wowgetoffyourcellphone, @Trinketos, @Stan`, @FeXoR, @asterix, @DarcReaver, @nani, @azayrahmad, @Loki1950 and all those not mentioned (we gotto have a list or something for this).) When working on improving support for armour (D2229) there rose some questions during discussion with @wraitii. I've seen some mods with directional damage support and, because templates ought to be changed anyways, I thought I might as well try to add some support in SVN, or at least make it easier. Template code as it stands: What I propose: The code to calculate the resistance to a specific attack would allow for resistance types to be circumvented. However, the condition as to which resistance type(s) to circumvent still needs to be coded in component files, by you. This leads to the loaded question: do you think this is worth a shot? (For those interested in the actual code and perhaps willing to give some feedback on that specifically: D2229.)
  8. The most efficient way of expanding is by building a civic center, though. That will give you large amount of extra territory. So you can build a civic center close to your beloved stone deposit. That has an extra advantage that your citizens can hide inside the civic centre in case of a raid. The civic center can only be build in the city phase. Some civilisations can build a military colony in the town phase, however, which is a "smaller" version of the civic center, with less territory influence.
  9. It (the feature of diffent stances) was actually on my ToDo-list for rainy days (which we have quite a lot here in the Netherlands). Happy to take a look at your patch of course, just ping me when you've got something
  10. That'll be D1971 :) Often loading the "Units_demo"-map also shows errors, but I do not know whether that map is updated automatically? B.t.w. this looks awesome
  11. I vaguely recall that those wolves have the "domestic" class to make them taskable by triggers. (D1960 would be a solution.)
  12. The way I implemented it was that at a certain (template-based) range from their targets, the units started running instead of walking. No user input required.
  13. I guess the error does not occur when you lower the weight of the territory influence by 2?
  14. D781 I plan on revising that next month. (To also include melee attacks.)
  15. No problem at all! Glad to be of service :) Aye, I indeed meant that line. I meant the following: You want the AI to build its houses close to the CC, that means you want to add a addInfluence so that it actually tries to do that. But if the area is already full of houses, you need a bigger range to allow more houses. When you start with the bigger range however, the AI might try to build the houses already at the edge of that range, which is not exactly like you want, I guess. placement.addInfluence(x, z, 60/cellSize, +XX) Means the AI will try to place the building within XX meter(s) from "ent". placement.addInfluence(x, z, 60/cellSize, -XX) Means the AI will try to place the building at least XX meter(s) away from "ent". Oh, you might be able to remove that previous block now since in your mod houses are less (or more) special. Hehe, I make it myself unnecessary hard: I use a plain text editor, to force myself to write properly since I've just started coding. But I would advice an IDE.
  16. You can check with a warn("Hello world"); if the code is called at all, I suspect it not to because of line 213. You can try and remove that condition (I am by no means an expert on the AI and do not know what side effects this could have!). If you try that it may be wise to increase the radius a bit with every house built, otherwise it either might get very full around the CC quickly or the AI builds the first houses too far away for your liking ;)
  17. Hmm, this should already have been fixed in rP22611. Does this happen with every civ? For I could not reproduce this. Edit: How often is "some" btw?
  18. Hi, just a few lines earlier (~ line 200) you can see several "placement.addInfluence(...)"-functions that might be of interest to you. Especially the lines around 230 are interesting for your question. I hope this helps! Otherwise just ask again :)
  19. You can ask of course But wouldn't that be very annoying? For it would probably mean to have all different voices of a large selection group to be played simultaneously, which would mean you only hear rumour? The phenotypes itself are used (were previously genders), but the new feature to use random phenotypes is not used in the base game.
  20. Thanks for the reaction @Stan`! And glad it worked out for you @wowgetoffyourcellphone, sorry for the delayed reaction, I was AFK for the weekend In the first template in the inheritance one should use (something like): <?xml version="1.0" encoding="utf-8"?> <Entity parent="template_unit"> <Identity> <Phenotype datatype="tokens">Child</Phenotype> </Identity> <VisualActor> <Actor>units/athenians/{phenotype}_citizen.xml</Actor> </VisualActor> </Entity> This will replace all {phenotype} occurrences in the visual actor (as well as in sounds) with "child". <?xml version="1.0" encoding="utf-8"?> <Entity parent="template_unit_support"> <Identity> <Phenotype>Male Female</Phenotype> </Identity> <VisualActor> <Actor>units/athenians/{phenotype}_citizen.xml</Actor> </VisualActor> </Entity> This will randomly choose between the two given phenotypes. You have to make sure the Actor for all these entities (units/athenians/male_citizen.xml and units/athenians/female_citizen.xml) exist. Using: <?xml version="1.0" encoding="utf-8"?> <Entity parent="template_unit_support_citizen"> <Identity> <Phenotype datatype="tokens">Child</Phenotype> </Identity> <VisualActor> <Actor>units/athenians/{phenotype}_citizen.xml</Actor> </VisualActor> </Entity> will add the "Child" to the list of possible phenotypes. (So that will become "Male Female Child".) A notion to all (template) modders: <Gender> is to be replaced with <Phenotype>! @Exodarion @darkinterloper @borg- @Nescio @Angen @(-_-) @Trinketos (And everyone else I did not mention.) Any questions? Please ask!
  21. @roadtripping.ph, you can try moving your mod (the link does not work for me) one level up and unzip it there. So that it would read "~/.local/share/0ad/mods/sophia/simulation/" etc. Then you could open 0A.D. normally and go to "Settings", then "Mod Selection", where you should see your mod in the list (if you have a proper mod.json).
  22. If D2140 is thoroughly tested and icons are made for it (anyone?) it can be implemented in the game and one can choose a preferred attack type for their units.
  23. I would advise looking into the modding guide to see how to create your own mod. There you need to add your new AI (under the same path as in vanilla (i.e. the "public" mod), i.e. "<NAMEOFYOURMOD>/simulation/ai/<NAMEOFYOURAI>"). I would suggest copying the PetraAI (changing its name, also in "data.json") and tinkering with code as you go, watching the effects of your changes. In the "config.js" you can find a variable "this.debug" which can greatly aid you in what is going on during a game. I hope this helps. If you need more information, please ask.
  24. One could combine that? E.g. capturing a sheep gives a player two options: garrison it inside the corral for a small trickle of food, or slaughter it immediately as a quick food source. Same with the horses/camel: garrison for a horse/camel production boost or slaughter for food.
×
×
  • Create New...