Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 2024-06-01 in all areas

  1. Hey, First things first, materials have no effect whatsoever on particles. Ideally the particle actors would have a different format, but that's off topic. The good news is you can affect particle colors through code! Using this one weird trick (Mostly an unknown engine feature). Particles support expressions such as this one: <expr name="emissionrate" from="numbuilders" mul="50.0" max="200.0"/> Which is interpreted by the code like so: std::min(m_Max, emitter.m_EntityVariables[m_From] * m_Mul); std::min(200.0, yourValue * 50.0); So how does one set the "yourValue" parameter you might ask. Well you can find an example in the Foundation.js code: let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); if (cmpVisual) cmpVisual.SetVariable("numbuilders", this.GetNumBuilders()); So in your case, you might need an extra component let's say ParticlePlayerColor.js class ParticlePlayerColor { Init() { this.UpdateColor(); } UpdateColor() { let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); if (!cmpVisual) return; const color = QueryOwnerInterface(this.entity, IID_Player).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(); } } ParticlePlayerColor.prototype.Schema = "<empty/>"; Engine.RegisterComponentType(IID_ParticlePlayerColor, "ParticlePlayerColor", ParticlePlayerColor); That you can add to your template with <ParticlePlayerColor/> And this little component will take care of updating your particles with the correct values. You need to define colors as expressions in your particle file: <expr name="color.r" from="colorr" mul="1.0" max="1.0"/> <expr name="color.g" from="colorg" mul="1.0" max="1.0"/> <expr name="color.b" from="colorb" mul="1.0" max="1.0"/> Do note that it will not be the exact color you want as the particle texture say <texture>art/textures/particles/dust_256a.png</texture> as its own, but it should get close.
    4 points
  2. Hey ! I would like to change the colour of these lightnings into the player color, does anyone knows how to do it ? I tried so many things but nothing worked, I have the impression that materials are not working like I want with particles
    1 point
  3. Hmm that's really strange because I tested that code earlier and I had blue and red dust X) And yeah emission rate has to be constant I hacked the foundation code that relies on builder numbers. What values do you have in player colors ? I will test some more tomorrow
    1 point
  4. <?xml version="1.0" encoding="utf-8"?> <particles> <texture>art/textures/particles/dust_256a.png</texture> <blend mode="over"/> <expr name="emissionrate" from="numbuilders" mul="50.0" max="200.0"/> <uniform name="lifetime" min="3.0" max="5.0"/> <uniform name="position.x" min="-8.0" max="8.0"/> <uniform name="position.z" min="-8.0" max="8.0"/> <constant name="position.y" value="1.0"/> <uniform name="angle" min="-3.14" max="3.14"/> <uniform name="velocity.x" min="-1.5" max="1.0"/> <uniform name="velocity.y" min="2.0" max="3.5"/> <uniform name="velocity.z" min="-1.5" max="1.0"/> <uniform name="velocity.angle" min="-2.0" max="3.0"/> <uniform name="size" min="5.0" max="7.5"/> <expr name="color.r" from="colorr" mul="1.0" max="1.0"/> <expr name="color.g" from="colorg" mul="1.0" max="1.0"/> <expr name="color.b" from="colorb" mul="1.0" max="1.0"/> <force y="-2.5"/> </particles> This is the one I tested with. <ParticlePlayerColor/> Should only be in the building template in simulation/templates
    1 point
  5. Try with the dust texture ? Can you show your particle file ?
    1 point
  6. You need to use a texture without colors. Such as the one for dust it doesn't colorize it just reduces the rgb value of each pixel so if you have a blue texture you can only do shades of blue.
    1 point
  7. My bad, you also need an interface for that component in simulation/components/interfaces add a new file called ParticlePlayerColor.js With this content Engine.RegisterInterface("ParticlePlayerColor");
    1 point
  8. Hello everyone, It is with great sadness and a little relief that I am announcing my retirement as project leader of both 0 A.D.: Empires Ascendant and Wildfire Games. It has been an awesome 12 years and 8 months, with its ups and downs. Making it to the team will remain one of my greatest achievements ever. After 6 years of 3D art struggles, getting the chance to join the team was unexpected (and, to this day one of my proudest moments), and two years later to be offered the leader job came even more as a surprise. It has been an incredible opportunity to be the leader of such a project. I would not have met half of the awesome people I met if it were not for it, and I would certainly have not have had the opportunities to go to the places I went if it were not for it. I don’t know half of you half as well as I should like; and I like less than half of you half as well as you deserve. Being able to spread the word about the game around the world has been an honor, and I hope the game will continue to shine at events. Recently, I had less and less energy and motivation to give to 0 A.D. The delay followed by the cancelling of A27 was no exception; I simply could not give the same energy I gave for the previous ones. The lobby became a source of permanent mental load and anxiety, first because of it is lack of moderation, then because of it started becoming moderated, and now because mods splat the community even more and the cheating is rampant. And it went downhill from there, as I started the longest break I ever took from 0 A.D. Those of you that know me know I was not really far, but I was simply not there. On the development side, I cannot seem to find any fun anymore. Everything feels more like duty than an actual desire, which can only work for so long until it breaks. The learning curve is just simply not worth the burnouts anymore. There are so many things I wanted to add to 0 A.D to showcase the true potential of the engine, as it is just immense, look at all the mods have done, look at all the thing people learnt about history, programming, art, bugs.. But I don't feel I can carry that vision anymore. I believe it is time for a change. I am therefore, effective immediately, quitting my functions as programmer, artist, video editor, documentation manager, translator, human resources, moderator, social media manager, public relations, system administrator, mod signer and modder, (all my mods can be considered archived until further notice). It is the only way for me to ever move on. I cannot just keep doing one thing for 0 A.D., unless I get a clean break I will continue feeling everything not covered by someone is on my shoulders, and it is a weight too big for a single person. I would like to thank everyone that made some or the whole journey with me, I will miss you all very much. I hope we shall meet again. I would also like to thank all the players that took action in the balancing department it has not been an easy task. I do not have ideas for the person who can or will replace me, nor do I know whether I should be replaced by a single person. I will leave it for the remaining people to decide what kind of leadership model they want to go for from now on. As for what I'll do next I do not know yet, but I've been working on Godot tools to import 0 A.D. assets and it's been fun, so I might continue that. I'm still working with Activ' Design this year as well. tldr; So long and thank you for the fish. May Wildfire Games and 0 A.D: Empires Ascendant live a long and healthy life after I am gone. Best regards, Stan
    0 points
×
×
  • Create New...