Jump to content

Allan

Community Members
  • Posts

    56
  • Joined

  • Last visited

  • Days Won

    2

Allan last won the day on June 22

Allan had the most liked content!

Recent Profile Visitors

3.010 profile views

Allan's Achievements

Discens

Discens (2/14)

33

Reputation

  1. Sure ! Forgot to mention it my bad
  2. Hey 0.A.D Community ! The Robots Uprising Mod is now available on 0.A.D here : https://mod.io/g/0ad/m/robots-uprising Let us know if you like it by the comments below the page of the mod or dm me !
  3. To be honest I don't understand this concept, like how a simple timer crash the game ? It makes no sense
  4. It says this : ERROR: Cannot serialise JS objects of type 'function': (unnamed) ERROR: Script component ParticlePlayerColor of entity 1643 failed to serialize: Serialize_InvalidScriptValue Serializing: ({TimerTick:(function() { this.UpdateColor(); })})
  5. Yes we had all the same. When I deleted all the ParticlePlayerColor files it worked, maybe it crashes because of the cmpPlayer in the function
  6. I tested with particles enabled in multiplayer but the game crashes, and we are sure that the particles are the problem because we deleted them and it worked. Do you have an idea of what can cause this ?
  7. Ok, I think there are like 3 or 4 buildings with particles so it would be ok. Thank you for helping me with these particles, such a pleasure to interact with you ! Now we are finishing the details to release the project this week
  8. Nice it's working ! Are you sure that it will not be too expensive for the engine ? I mean updating the color every 1 sec, maybe we have to put this on 3 or 4 sec ?
  9. Ok thank you ! I only have one week left to do it, so I don't think I will follow this solution. I think I can do this, I just don't know where can I put this timer ? In what file ? Maybe these particules are only a detail, I'm hesitating, it's already working to be honest, I don't know if I will take time for this, because I have a lot of things to do :/
  10. Hey ! Did you find something ? My exams are tomorrow and Friday so I'll be back on this after my exams
  11. UpdateColor() { // warn("UpdateColor"); // let cmpFoundationOwnership = Engine.QueryInterface(this.entity, IID_Ownership); // let owner = cmpFoundationOwnership.GetOwner(); // if (cmpFoundationOwnership) // { // cmpFoundationOwnership.SetOwner(owner); // } // warn("Entity : " + this.entity + "Owner : " + owner) // var owner = Engine.QueryInterface(this.entity, IID_Ownership).GetOwner(); const cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); let owner = Engine.QueryInterface(this.entity, IID_Ownership).GetOwner(); warn("Entity : " + this.entity + "Owner : " + owner); let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); if (!cmpVisual) return; if (cmpPlayer) { const color = cmpPlayer.GetColor(); cmpVisual.SetVariable("colorr", color.r); cmpVisual.SetVariable("colorg", color.g); cmpVisual.SetVariable("colorb", color.b); } // warn("red : "+color.r); // warn("green : "+color.g); // warn("blue : "+color.b); } I think it doesn't get the good color untli the building is finally constructed, so that's why it applies the gaia color. But how to collect the owner of a building before its construction ? Something that I don't understand is that I call all the messages during the construction, it should be good but it's not
  12. If I put this in OnGlobalOwnershipChanged it doesn't work anymore, the color is not updated. The wallset.js in kind of empty to be honest, and I can't find another file attached to walls. Moreover, I don't understand why i've got a good preview (with the good color) with my wall tower but not with my other building (spacedock) I'll see this tomorrow I take a break
  13. Here is the "final" version of my UpdateColor function : UpdateColor() { const cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); let owner = Engine.QueryInterface(this.entity, IID_Ownership).GetOwner(); warn("Entity : " + this.entity + "Owner : " + owner); let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); if (!cmpVisual) return; if (cmpPlayer) { const color = cmpPlayer.GetColor(); cmpVisual.SetVariable("colorr", color.r); cmpVisual.SetVariable("colorg", color.g); cmpVisual.SetVariable("colorb", color.b); } } OnOwnershipChanged(msg) { if (msg.to == INVALID_PLAYER) return; this.UpdateColor(); } OnGlobalOwnershipChanged(msg) { if (msg.to == INVALID_PLAYER) return; this.UpdateColor(); } OnEntityRenamed(msg) { if (msg.to == INVALID_PLAYER) return; this.UpdateColor(); } OnHealthChanged(msg) { if (msg.to == INVALID_PLAYER) return; this.UpdateColor(); } OnGlobalInitGame(msg) { if (msg.to == INVALID_PLAYER) return; this.UpdateColor(); } When I build a large wall (Tower + Wall + Tower), the particles of the first tower is gaia colored. When the wall is constructed, the first tower particles turns player colored. The third tower stays gaia colored since I build something else. I don't understand how is this possible to be honest
×
×
  • Create New...