Jump to content

Allan

Community Members
  • Posts

    56
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Allan

  1. That makes sense yes Yep
  2. Another starge thing is when the construction of the wall_tower is finished, the particle is grey (bad color) but when I change the diplomacy color from green to blue, the particle change to green Same with the other building which was "not working"
  3. Nope same color called on preview, when I start the construction by left-clicking, when the construction begin and when it's constructed. What do you mean when you say this ? Because we actually use GuiInterface.js in our project so I don't know how to rename the file. So I added the IID_ParticlePlayerColor to the function in the basic .js file and it's not changing the color of the partcile when I change diplomacy color.
  4. Yep, that's why it's strange
  5. I just see the good color on preview, not when I start the construction and not when it's constructed + It seems like the only building concerned by the good preview is my wall_tower, the other building doesn't have the good color on preview
  6. I did put the same thing in preview.xml and I see the particle color on preview, but not when it's constructed
  7. I changed the file that u said + the special/filter/construction.xml and nothing changed, the color is not applied to the particle, in construction preview and when it's constructed If I put the OnUpdate function, I clearly see that the color is updated after the construction, but I still don't have it on preview
  8. There's still a problem : When I start building a new building with particles, the color is not updated. I warned the UpdateColor function and the values are changing good but the particles are not getting the color of the player And when I change the diplomacy color with the button on the minimap, the particle color stay as the first color of the player, surecly because I have to call the UpdateColor function here
  9. I have a great result with these ! If you want to try Particle file : <?xml version="1.0" encoding="utf-8"?> <particles> <texture>art/textures/particles/red_lightning.png</texture> <blend mode="over"/> <constant name="emissionrate" value="250.0"/> <uniform name="lifetime" min="0.1" max="1.0"/> <uniform name="angle" min="-3.14" max="3.14"/> <uniform name="velocity.x" min="-5.0" max="5.0"/> <uniform name="velocity.y" min="-5.0" max="5.0"/> <uniform name="velocity.z" min="-5.0" max="5.0"/> <uniform name="size" min="1.0" max="8.0"/> <constant name="size.growthRate" value="25.0"/> <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"/> </particles> Noticed that I named it red, I have to rename all of these files The texture is right down here
  10. Ok I did a new texture more simple to have a lightning effect, here are some "good" results : Yellow Green : Do you have any idea to improve that ? Because the render with the red lightning at the beginning was way better than this
  11. The "problem" now is to have a good result, I think the texture I made is clearly not the best one because I have these :
  12. Ok I found the problem, I feel soooo dumb The fact is that I was testing these particules on a map where is only one player, so the game consider that is a win and ask me if I want to go back to lobby or stay in the game. So it attributes the gaia color (grey), and not the player color, because i'm not a player. I tested the particules without the OnUpdate function in a normal map and it's working.
  13. Sorry i'm a bit late Here is the template of the building : <?xml version="1.0" encoding="utf-8"?> <Entity parent="template_structure_civic_command_base"> <Attack> <Ranged> <AttackName>Bow</AttackName> <Damage> <Pierce>40</Pierce> <Crush>40</Crush> </Damage> <MaxRange>100</MaxRange> <PrepareTime>0</PrepareTime> <RepeatTime>100</RepeatTime> <Projectile> <Speed>100</Speed> <Spread>1.5</Spread> <Gravity>0</Gravity> <FriendlyFire>false</FriendlyFire> <LaunchPoint y="3"/> <ActorName>props/units/weapons/laser_ammo.xml</ActorName> </Projectile> <PreferredClasses datatype="tokens">Human</PreferredClasses> <RestrictedClasses datatype="tokens">Spaceship Structure</RestrictedClasses> <RangeOverlay> <LineTexture>outline_border.png</LineTexture> <LineTextureMask>outline_border_mask.png</LineTextureMask> <LineThickness>0.175</LineThickness> </RangeOverlay> </Ranged> </Attack> <Footprint> <Square width="140.0" depth="120.0"/> <Height>8.0</Height> </Footprint> <Health> <DeathType>vanish</DeathType> <Max>2500</Max> <RegenRate>0</RegenRate> <IdleRegenRate>0</IdleRegenRate> <Unhealable>false</Unhealable> </Health> <Identity> <Civ>robot</Civ> <Icon>structures/robot/powerstation.png</Icon> <GenericName>Power Station</GenericName> <SpecificName>Power Station</SpecificName> <Tooltip>Main Building of the Robot civilisation. Make you able to train Buildobots, Spybots and to research many useful technologies to improve them.</Tooltip> <History>This building is very important for the Robots because he shelters the Quantum Computer which manages the AI of all the civilisation. Robots will be very agressive if they see someone or something attacking it.</History> </Identity> <Obstruction> <Static width="140.0" depth="120.0"/> </Obstruction> <ParticlePlayerColor/> <Researcher> <Technologies datatype="tokens"> phase_village_robot phase_town_robot phase_city_robot </Technologies> </Researcher> <Resistance> <Entity> <Damage> <Pierce>20</Pierce> <Hack>12</Hack> </Damage> </Entity> </Resistance> <Sound> <SoundGroups> <select>interface/select/building/command_base_select.xml</select> </SoundGroups> </Sound> <VisualActor> <Actor>structures/robot/command_base.xml</Actor> <FoundationActor>structures/fndn_20x20.xml</FoundationActor> </VisualActor> </Entity> Here is the actor of the building : <?xml version="1.0" encoding="UTF-8"?> <actor version="1"> <castshadow/> <group> <variant frequency="100" name="Base"> <mesh>structures/robot/command_base.dae</mesh> <props> <prop actor="particles/big_red_lightning.xml" attachpoint="lightning"/> </props> <textures> <texture file="structures/robot/command_base.png" name="baseTex"/> <texture file="null_white.dds" name="specTex"/> </textures> </variant> </group> <material>player_trans_spec.xml</material> </actor>
  14. I’m not at home I will do it at near 4pm
  15. No there is no variants on these buildings, i don’t understand why it worked with the OnUpdate function if it doesn’t work without it
  16. Ok I've got the same results as you with this, that's a little victory. But if I don't put this code in the .js component, the particle don't take the player color, and I don't know why And as you said, it seems like it updates particles at every frame, so the game starts being laggy
  17. So I put warns in UpdateColor function 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); warn(color.r); warn(color.g); warn(color.b); } OnOwnershipChanged(msg) { if (msg.to == INVALID_PLAYER) return; this.UpdateColor(); } } ParticlePlayerColor.prototype.Schema = "<empty/>"; Engine.RegisterComponentType(IID_ParticlePlayerColor, "ParticlePlayerColor", ParticlePlayerColor); And that's the result for Blue : Red : Green : Yellow : Maybe you hacked something else that i don't have on my version ? x)
  18. Ok some weird things happened. To test your code, I have to put the emissionrate on constant, if I don't do this I can't see anything. The result is the screenshot linked to the post. I put the <ParticlePlayerColor/> in the building template as you said, i put warns so I can say that the component is working. But as you can see, the result is not what I really want After some tests, I can see the colour changing when testing your code, but it seems like it's changing on greyscale, the dust appears a little darker but not blue. After more tests, I thinkn the problem is not resolvable by this way because we can't change the RGB of the texture directly, so I can't have red particule for red player, blue particles for blue player etc...
  19. I tried with it and nothing has been colored. Here is my particule file : <?xml version="1.0" encoding="utf-8"?> <particles> <texture>art/textures/particles/red_lightning.png</texture> <blend mode="over"/> <!-- <start_full/> --> <constant name="emissionrate" value="150.0"/> <uniform name="lifetime" min="0.1" max="1.0"/> <constant name="position.y" value="0"/> <uniform name="angle" min="-3.14" max="3.14"/> <uniform name="velocity.x" min="-5.0" max="5.0"/> <uniform name="velocity.y" min="-5.0" max="5.0"/> <uniform name="velocity.z" min="-5.0" max="5.0"/> <!-- <uniform name="velocity.angle" min="-0.5" max="0.5"/> --> <uniform name="size" min="1.0" max="6.5"/> <constant name="size.growthRate" value="25.0"/> <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"/> <ParticlePlayerColor/> </particles>
  20. Ok I tried with this and it doesnt work, I think I didn't understand well the concept of drawing a texture without colors It seems like the code is working but the color of the player is not being attached /put to the particle color. The color of the particule doesn't change
  21. I put some warns in the .js component and it seems that it's working, the values (color.r-g-b) change when I change player color. But it's not updating the color of the texture, it's still red even if i'm a the green or bleu team
  22. Hey, I think I understood the main part of this, thanks for being this clear ! But there is a little misunderstanding for this. When you say template, what file do you mean ? Because I tried to put it on every single XML files attached to a building (simulation/templates, actors, particles flie, particles actor...) but nothing worked, i keep having these : On particle file (same on particle actor file) : On building template file : So I think I did something wrong but I don't know what
  23. 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
  24. We are working on making it possible but I can't assure that it will be available. We added so many new mechanics so Petra is kinda lost now
  25. Hey 0AD community ! The Robots Uprising Mod is in progress and still in development but we have some good news for you all ! Before releasing the project in June 2024, we wanted to show you the progress of our project with screenshots or by giving you some news (we are a small team so don't be mad at us if there's not so many news around here, we are doing our best !). We actually finished modelising and texturing our ground / levitating Robots ! Enjoy !
×
×
  • Create New...