Search the Community
Showing results for tags 'question'.
-
As I already wrote once in a different thread, I'd like to create a random map where height and reliefs have an important role, but I need answer to some important questions: how can one access the heightmap from random map generation? how is passability computed from heightmap? how does that relate to height rendering in game? how can one apply a specific texture to impassable terrains? An answer to one of these questions alone, is better than nothing.
-
So I'd like to create a Morale system mod... My plan is to make it to be some kind of Aura of units that influences other units in range. However I need it to be more dynamic, i.e. the effect strength would change according to unit's own morale strength. I decided to create separate component. Morale.js. There are two mechanisms in this component: (1) Morale level and how it affects unit performance. This is similar to how Health.js works. (2) Unit effect on other units in range based on its own morale level. This is intended to be similar to how Auras.js works. The first one already work, but the second one is not yet. I still don't understand why the effect is not applied yet. This is the repository on GitHub: https://github.com/azayrahmad/morale-system The problematic part is in simulation/components/Morale.js. Here are the snippet of the relevant parts: Init: Morale.prototype.Init = function() { this.affectedPlayers = []; ... this.CleanMoraleInfluence(); ... }; The CleanMoraleInfluence(), intended to be similar to Clean() function from Aura.js. The target here is to apply morale influence to any allied units in 10m range. (GetAllies() also includes player's own units right?) Morale.prototype.CleanMoraleInfluence = function() { var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); //Remove Morale let targetUnitsClone = []; if (this.targetUnits) { targetUnitsClone = this.targetUnits.slice(); this.RemoveMoraleInfluence(this.targetUnits); } if (this.rangeQuery) cmpRangeManager.DestroyActiveQuery(this.rangeQuery); //Add Morale var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); if (!cmpPlayer) cmpPlayer = QueryOwnerInterface(this.entity); if (!cmpPlayer || cmpPlayer.GetState() == "defeated") return; this.targetUnits = []; let affectedPlayers = cmpPlayer.GetAllies(); this.rangeQuery = cmpRangeManager.CreateActiveQuery( this.entity, 0, 10, affectedPlayers, IID_Identity, cmpRangeManager.GetEntityFlagMask("normal"), false ); cmpRangeManager.EnableActiveQuery(this.rangeQuery); } Here is the apply and remove morale influence functions. The intention is to apply the effect (add Morale regenrate by 1 per second) and remove it if no longer in range). Morale.prototype.ApplyMoraleInfluence = function(ents) { var cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager); cmpModifiersManager.AddModifiers( "MoraleSupport", { "Morale/RegenRate": [{ "affects": ["Unit"], "add": 1 }] }, ents ); } Morale.prototype.RemoveMoraleInfluence = function(ents) { if (!ents.length) return; var cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager); cmpModifiersManager.RemoveAllModifiers("MoraleSupport", ents); } And lastly OnRangeUpdate. This should run apply and remove functions when units are moving in/out of other units range right? Morale.prototype.OnRangeUpdate = function(msg) { if(this.rangeQuery) { this.ApplyMoraleInfluence(msg.added); this.RemoveMoraleInfluence(msg.removed); } } I have been looking at the code all day and still don't understand why does the effect not apply. In the repo I added template units that includes Morale which start at 50%. The intention is that every players unit within 10m range should have increased Morale, but they don't. If you want to test this with Aura and see how I intend this to work, you can put these snippet inside template_unit.xml: <Auras datatype="tokens"> morale_friendly </Auras> Any help would be extremely appreciated. Thank you!
-
question Random player position with already existing CC
Grapjas posted a topic in Tutorials & Guides
I'm trying to give players a random position on the map im currently making. I took a look at the rmgen scripts but im a lil lost honestly. To be clear, my map already has civic centers placed, aswell as the resources, so these things do not have to be randomized. The only thing i want random is where each player will be put into existing CC, while being adjacent to team members. If up until this part of what i'm asking is not possible the way i discribe it, is it possible to make a custom rmgen2 script and put the exact coordinates where i want players to have their CC placed? I think i need some parts of rmgen2/setup.js but im doubtful as to how to approach this. -
Hi, I'd like to modify Petra bot to make the first AI house to be built within Civic Center range. I think the code to manage it is in this part in queueplanBuilding, but it seems to have no impact on the game. Here's the code: if (template.hasClass("House") && !alreadyHasHouses) { // try to get some space to place several houses first bestTile = placement.findBestTile(3*radius, obstructions); if (!bestTile.val) bestTile = undefined; } I tried modifying the radius multiplier to 6, 2, even 0.5 but it seems that they always end up building it outside of CC's perimeter, sometimes even at the edge of territory. I tried to find findBestTile code but to no avail. I believe findBestTile prevents any building to be built inside CC's range. Does anyone might know about this findBestTile script? Thank you.
-
(I'm not sure if this should've went here or in Game Development & Technical Discussion.) I'd like to know some details on lobby ranking. Namely, how exactly is is calculated? and when the rank isn't shown for new players, is there a hidden rank behind the scenes? Or is is calculated after the first match? I suppose I could poke around in the game code but I doubt I would be able to understand it very well I'm mostly wondering since I would like to add an average opponent ranking to my graphing tool [below], but I'm not certain how I should deal with not-yet-ranked players thanks!
-
I played the Anglo-Saxons and figured out the Cavalry can build buildings. Is this a bug or a feature? Should cavalry really be able to build buildings?
- 10 replies
-
- anglo-saxons
- cavalry
-
(and 2 more)
Tagged with:
-
While I was modding my FCI mod I decided to make one of the minor factions look more like they actually looked in the gaming clan war the mod was based off of, I was trying to edit the 3d model of another unit but found I cannot as they are all in pmd files, I do not want to have to download the entire svn version of 0ad (it is massive in file size) to get the raw pmd files. How would I either convert the pmd files or get the raw dae files for the default 3d models ingame?
-
How mods can add new sounds variations, i mean file and differentiate from other, example I want add a sound for New phase reached. and actually tech reach and phase reach are same, how i can differenciate and put the new one in my Aristeia Mod.