-
Posts
17.380 -
Joined
-
Last visited
-
Days Won
549
Posts posted by Stan`
-
-
Can you show me the actor? and the template
- 1
-
No date yet. Few things to solve and not enough activity
-
Mmh that's a bit strange. Does the building switch variants a lot (Does it have animations or specific states)?
Unfortunately there is no GetVariable so we cannot check if the values changed. Maybe there is an event we should be listening to.
-
Also note that using setvariable you could say change the intensity of the fire of the flying vehicles
- 1
-
Made a few more tests with this particle:
<?xml version="1.0" encoding="utf-8"?> <particles> <texture>art/textures/particles/dust_256a.png</texture> <blend mode="over"/> <constant name="emissionrate" value="1000.0"/> <constant name="lifetime" value="10.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="7.4" 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>
Custom actor:
<?xml version="1.0" encoding="utf-8"?> <actor version="1"> <castshadow/> <group> <variant frequency="1" name="Carthaginian House"> <mesh>skeletal/celt_trader.dae</mesh> <props> <prop actor="props/structures/decals/dirt_small.xml" attachpoint="root"/> <prop actor="particle/construction_dust.xml" attachpoint="root"/> </props> <textures> <texture file="structural/kart_struct.dds" name="baseTex"/> <texture file="structural/kart_struct_norm.png" name="normTex"/> <texture file="structural/kart_struct_spec.png" name="specTex"/> </textures> </variant> </group> <group> <variant frequency="1" name="ungarrisoned"/> <variant name="garrisoned"> <props> <prop actor="props/special/common/garrison_flag_kart.xml" attachpoint="garrisoned"/> </props> </variant> </group> <group> <variant name="alive" frequency="1"/> <variant file="structures/cart/light_damage.xml"/> <variant file="structures/cart/medium_damage.xml"/> <variant file="structures/cart/heavy_damage.xml"/> <variant file="structures/cart/destruction_small.xml"/> </group> <material>player_trans_parallax_spec.xml</material> </actor>
I used a custom texture for the following one:
I used the following texture: -> (It's not all white)
Few notes:
Hotloading particles is crashy as in changing a few values can crash the game.
SetVariable won't work if you hotload particles (each time you change a value in the XML or the modle you have to restart the match) Fortunately you can use the following code in your tests (Don't use in production) that will keep forcing the variables at each frame.
class ParticlePlayerColor { ... Don't touch the previous code. OnUpdate() { this.UpdateColor(); } }
As for the grey in the middle it's due to particles decaying maybe it's an engine bug @vladislavbelov would know.
- 1
-
Nice work. This is why stella artis was made happy someone else made a scifi mod
- 1
-
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
-
<?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
-
Try with the dust texture ?
Can you show your particle file ?
- 1
-
48 minutes ago, Allan said:
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
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
-
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
-
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.
- 3
- 1
-
The problem is that the fix is very involved so it's acceptance will take a while. Do note you can apply the patch without waiting for it to be merged though
- 1
-
Might be interesting to document their function in detail (ideally in the design document but a trac page might be enough) Basically intended usage (when and how to use it (hotkeys,buttons)), restrictions, and any other things relevant
-
Maybe @chrstgtr @borg- and @real_tabasco_sauce have some strong opinions on that.
Also the wanted behaviour might differ between SP and MP.
-
-
14 hours ago, Obskiuras said:
Here is another attempt at a civic center, it is better but it looks like a big house with the car parked in the yard. At least it look decent, you can use the other design for houses.
Do you base your designs of something else or do you just "wing it" Else you could play around with a shorter second floor, or some kind of rain cover with wood planks. You can use software like PurRef (Or pinterest to gather a list of references.
-
That's a bit strange. Depending on your Operating System, you might check if there are leftovers of the mod that were not correctly cleared.
-
You might make version of it as ages progress 3-4 (if you want to take into account DE's 4th phase.
- 1
- 1
-
16 hours ago, real_tabasco_sauce said:
@Stan` is there already some sort of tiebreaking mechanism when two targets are exactly the same distance?
I'm not sure but IIRC units have preferences with regards to their target e.g. the Elephant class.
-
1 hour ago, chrstgtr said:
So random arrows but there can be manual targeting for some arrows? Sounds worth trying to me
Yep. Either a ratio, or a max of two or something.
1 hour ago, Feldfeld said:Imo that would be an improvement but I still also would like to see deviation with arrows being able to hurt a different unit than the target, not sure if that's possible without hurting performance
I think arrows can still miss and hit something else, which is probably the reason of the lags @maroder noticed when there are many enemies.
-
Can't we have a system were depending on buildings, up to max n arrows can be focused on a unit ? That number n would be the max between the value in the template and a ratio of the current number of arrows with the max number of arrows that can be shot from that building.
- 1
- 1
-
Ah sorry, yeah we could probably make an exception for winners, although I'm not sure what the point would be to still be able to flare
-
You shouldn't be able to interact with the game once you've lost is my understanding of why the button is disabled.
The icon is disabled because it checks for whether the unit is an observer but the actual action doesn't check for that but rather whether you control the player which is probably broken somehow. You can check the changes in D1751 and input.js
When is a27 release?
in General Discussion
Posted
hopefully we'll have more visibility in september, but no, no expected month.