Jump to content
  • Latest updates

  • Newest Posts

    • After testing many things I think that it's true But how this works for the civili-centre (building placed at the beginning of the game) and not for other buildings being constructed during the game ?   And if I can't pick my player from here, how can I do ?
    • The error means it cannot find the owner, (probably cause it doesn't have one) It's this code that fails: const color = QueryOwnerInterface(this.entity, IID_Player).GetColor(); cmpVisual.SetVariable("colorr", color.r); cmpVisual.SetVariable("colorg", color.g); cmpVisual.SetVariable("colorb", color.b); You can replace it with const cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); if (cmpPlayer) { const color = cmpPlayer.GetColor(); cmpVisual.SetVariable("colorr", color.r); cmpVisual.SetVariable("colorg", color.g); cmpVisual.SetVariable("colorb", color.b); } but then since it cannot find the player it will not set the color
    • Yes, it's possible. You can make a mod with resized cursor images (https://trac.wildfiregames.com/wiki/Modding_Guide). Default cursor is at mod/art/textures/cursors/default-arrow.png, in-game cursors are inside public/art/textures/cursors.
    • Can the size and color of the cursor be customized? I have poor vision. Consequently I keep "losing" the cursor. To improve its visibility, I would like to make the cursor bigger and to change its color.
    • Ok, I've got these errors with the second one :    So yes, itu says that is null, so how can I call my UpdateColor function if this is null ?
    • Weird because the second one is correct The first one registers a new interface for the engine. So it should never be called outside of the first initialisation of the component in the js file (Although you could create runtime components for nefarious purposes, I would advise against it) If the first one doesn't work, it means that whatever is calling that code doesn't have that component attached, which could mean the template is invalid.
    • I think I found something but I don't know how to use the UpdateColor function in another file. I tried this :  let cmpParticlePlayerColor = Engine.RegisterInterface("ParticlePlayerColor"); if (cmpParticlePlayerColor) { cmpParticlePlayerColor.UpdateColor(); } And this :  let cmpParticlePlayerColor = Engine.QueryInterface(this.entity, IID_ParticlePlayerColor); if (cmpParticlePlayerColor) { cmpParticlePlayerColor.UpdateColor(); } I think I understand why the second one doesn't work (wrong interface) but why the first one ?    I'm trying this because i saw that the UpdateColor function is called before the owner is set, and I think that's the problem.
×
×
  • Create New...