Jump to content

Conversion system


Recommended Posts


ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Expecting an element Range, got nothing

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Invalid sequence in interleave

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Element Convert failed to validate content

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Expecting an element DefaultStance, got nothing

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Invalid sequence in interleave

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Element UnitAI failed to validate content

ERROR: RelaxNGValidator: Validation failed for '(null)'

ERROR: Failed to validate entity template 'units/kush/support_healer_b'

ERROR: JavaScript error: simulation/helpers/InitGame.js line 48 cmpPlayer.SetCheatsEnabled is not a function InitGame@simulation/helpers/InitGame.js:48:13

ERROR: Error in timer on entity 3, IID94, function UpdateSequences: TypeError: this.sequences is undefined StatisticsTracker.prototype.UpdateSequences@simulation/components/StatisticsTracker.js:522:2 Timer.prototype.OnUpdate@simulation/components/Timer.js:140:44

ERROR: Error in timer on entity 4, IID94, function UpdateSequences: TypeError: this.sequences is undefined StatisticsTracker.prototype.UpdateSequences@simulation/components/StatisticsTracker.js:522:2 Timer.prototype.OnUpdate@simulation/components/Timer.js:140:44

ERROR: Error in timer on entity 5, IID94, function UpdateSequences: TypeError: this.sequences is undefined StatisticsTracker.prototype.UpdateSequences@simulation/components/StatisticsTracker.js:522:2 Timer.prototype.OnUpdate@simulation/components/Timer.js:140:44

ERROR: Error in timer on entity 6, IID94, function UpdateSequences: TypeError: this.sequences is undefined StatisticsTracker.prototype.UpdateSequences@simulation/components/StatisticsTracker.js:522:2 Timer.prototype.OnUpdate@simulation/components/Timer.js:140:44

ERROR: JavaScript error: simulation/components/StatisticsTracker.js line 158 deepcopy requires one argument. StatisticsTracker.prototype.GetSequences@simulation/components/StatisticsTracker.js:158:19 GuiInterface.prototype.GetExtendedSimulationState@simulation/components/GuiInterface.js:193:58 GuiInterface.prototype.GetReplayMetadata@simulation/components/GuiInterface.js:212:32 GuiInterface.prototype.ScriptCall@simulation/components/GuiInterface.js:2131:20 endGame@gui/session/session.js:525:25 onPress@gui/session/message_box/QuitConfirmation.js:26:29 display@gui/session/SessionMessageBox.js:23:35 async*onPress@gui/session/MenuButtons.js:265:22 initButton/button.onPress@gui/session/Menu.js:68:12

ERROR: Error calling component script function ScriptCall

ERROR: JavaScript error: simulation/components/StatisticsTracker.js line 158 deepcopy requires one argument. StatisticsTracker.prototype.GetSequences@simulation/components/StatisticsTracker.js:158:19 GuiInterface.prototype.GetExtendedSimulationState@simulation/components/GuiInterface.js:193:58 GuiInterface.prototype.GetReplayMetadata@simulation/components/GuiInterface.js:212:32 GuiInterface.prototype.ScriptCall@simulation/components/GuiInterface.js:2131:20 endGame@gui/session/session.js:528:9 onPress@gui/session/message_box/QuitConfirmation.js:26:29 display@gui/session/SessionMessageBox.js:23:35 async*onPress@gui/session/MenuButtons.js:265:22 initButton/button.onPress@gui/session/Menu.js:68:12

ERROR: Error calling component script function ScriptCall

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

 

I don't have qny idea what's wrong.

Link to comment
Share on other sites

A modding tip or trick:

For js files like unit_actions.js, you could just have a file that amends the vanilla file so you don't have to maintain the entire original file. Just name it something like:

 

unit_actions_conversion.js

unit_actions_convsys.js

unit_actions_amend.js

unit_actions_{whatever you want here}.js

The file would contain only the sections of code that you change/add. I believe this only works with JS files.

@Itms @Stan` anything to add to my description?

  • Thanks 1
Link to comment
Share on other sites

34 minutes ago, wowgetoffyourcellphone said:

A modding tip or trick:

For js files like unit_actions.js, you could just have a file that amends the vanilla file so you don't have to maintain the entire original file. Just name it something like:

 

unit_actions_conversion.js

unit_actions_convsys.js

unit_actions_amend.js

unit_actions_{whatever you want here}.js

The file would contain only the sections of code that you change/add. I believe this only works with JS files.

@Itms @Stan` anything to add to my description?

And to do this I must do the same thing I did with ConvertUnitAI.js ?

Link to comment
Share on other sites

I fixed errors now I have less.

Quote

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Expecting an element DefaultStance, got nothing

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Invalid sequence in interleave

ERROR: RelaxNGValidator: Validation error: units/kush/support_healer_b:1: Element UnitAI failed to validate content

ERROR: RelaxNGValidator: Validation failed for '(null)'

ERROR: Failed to validate entity template 'units/kush/support_healer_b'

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 76)

ERROR: OpenAL error: (null); called from COggData::~COggData (line 80)

 

 

Link to comment
Share on other sites

 

 

The "Convert" order will be processed by an "Order.Convert" handler that must be added in "UnitAI.prototype.UnitFsmSpec".

 

And what is the thing?

According to what I saw it defines finite state machines (FSM) for unit behavior.

 

https://en.m.wikipedia.org/wiki/Finite-state_machine

 

"mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition".

 

It was hard for me to understand that.

 

So this defines how a unit will behave depending on the variants it encounters in the terrain, basically a series of mathematical and circumstantial variables, which dictate the behavior of the unit on the battlefield.

 

It is not the whole set, but it is the elementary one.

 

For example if the unit encounters allies or enemies you will see how it will behave although it seems to me that the allies or enemies is in another file.

Edited by Classic-Burger
Link to comment
Share on other sites

Quote

UnitAI.prototype.Convert = function(target, queued, pushFront) {
    let cmpFaith = Engine.QueryInterface(this.entity, IID_Faith);
    if (!cmpFaith || cmpFaith.GetCurrentFaith() < 50) {
        this.WalkToTarget(target, queued);
        return;
    }

    if (!this.CanConvert(target)) {
        this.WalkToTarget(target, queued);
        return;
    }

    if (this.order && this.order.type == "Convert" && this.order.data && this.order.data.target === target) {
        this.order.data.force = true;
        this.orderQueue = [this.order];
        return;
    }

    this.AddOrder("Convert", { "target": target, "force": true }, queued, pushFront);
};

 

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