screab Posted February 6, 2018 Report Share Posted February 6, 2018 Hello, I am trying to make a technology that will increase a unit's xp over time if stationed in a building. I've looked at heal_barracks.json but I can't find a suitable modification. I see that for life there is "modifications": [{"value": "GarrisonHolder/BuffHeal", "add": 1}], but how do I create something like "modifications": [{"value": "GarrisonHolder/BuffXp", "add": 1}], Thank you for your help Quote Link to comment Share on other sites More sharing options...
screab Posted February 6, 2018 Author Report Share Posted February 6, 2018 I found that I can sort of duplicate the BuffHeal in GarrisonHolder.js but this method looks like it was created just for healing. Can anyone explain to me what these timers are and how can I use them ? GarrisonHolder.prototype.OnValueModification = function(msg) { if (msg.component != "GarrisonHolder" || msg.valueNames.indexOf("GarrisonHolder/BuffHeal") == -1 || msg.valueNames.indexOf("GarrisonHolder/BuffXp") == -1) return; if (this.timer && this.GetHealRate() == 0) { let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); cmpTimer.CancelTimer(this.timer); this.timer = undefined; } else if (!this.timer && this.GetHealRate() > 0) { let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer); this.timer = cmpTimer.SetTimeout(this.entity, IID_GarrisonHolder, "HealTimeout", 1000, {}); } }; Can I use the timer or should I create a new one for training units ? Quote Link to comment Share on other sites More sharing options...
Grugnas Posted February 6, 2018 Report Share Posted February 6, 2018 You can check Vox Populi mod where this kind of feature is implemented already. Quote Link to comment Share on other sites More sharing options...
screab Posted February 6, 2018 Author Report Share Posted February 6, 2018 (edited) 5 minutes ago, Grugnas said: You can check Vox Populi mod where this kind of feature is implemented already. I found this link https://wildfiregames.com/forum/applications/core/interface/file/attachment.php?id=20120 but I get this error Sorry, there is a problem The page you are trying to access is not available for your account. Error code: 2C171/1 Edited February 6, 2018 by screab Quote Link to comment Share on other sites More sharing options...
screab Posted February 6, 2018 Author Report Share Posted February 6, 2018 So I managed to get the light version of the mod but I can't find anything in there related to what I want. Maybe can you specify the exact technology you were referring to ? Quote Link to comment Share on other sites More sharing options...
Grugnas Posted February 6, 2018 Report Share Posted February 6, 2018 Actually I have no access to the game but AFAIK the feature isn't implemented as technology to reasearch, matter of fact once u have a barracks, you can simply garrison a soldier in it and notice how his xp will rise overtime. I guess that you can find more infos in the barracks template, thus the component which handle this. Quote Link to comment Share on other sites More sharing options...
screab Posted February 6, 2018 Author Report Share Posted February 6, 2018 Pretty hard to do this since the light version doesn't contain anything about barracks. How could I get the files for the mod ? As mentioned, the page of the mod has a link but I don't seem to have permissions to download the files. Quote Link to comment Share on other sites More sharing options...
Grugnas Posted February 6, 2018 Report Share Posted February 6, 2018 afaik it is implemented in the 22.1.3 version. maybe @Hannibal_Barca or @(-_-) can help Quote Link to comment Share on other sites More sharing options...
Imarok Posted February 6, 2018 Report Share Posted February 6, 2018 Look at https://code.wildfiregames.com/D1245 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.