Jump to content

Increase xp in barracks


screab
 Share

Recommended Posts

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

Link to comment
Share on other sites

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 ?

 

Link to comment
Share on other sites

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

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.

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