Cities: Skylines

Cities: Skylines

Vehicle Effects 1.9.5
 This topic has been pinned, so it's probably important
Acc3ss Violation  [developer] 9 Mar, 2018 @ 3:40am
'Custom' Particle Effects - Tutorial
To create a somewhat 'custom' particle effect you can now use an xml file. Most of the stuff on the Custom Sound page applies to this as well, so read that too. Currently the system is limited to changing properties of a MovementParticleEffect, so no custom sprites or custom ParticleSystem settings.

The config
A file containing sound effects should be called ParticleEffects.xml and must be placed in a mod's or asset's root folder, same as with VehicleEffectDefinition.xml. Below is the contents of VE's own ParticleEffects.xml file, showing the Diesel Smoke effect.
<?xml version="1.0" encoding="utf-8" ?> <ParticleEffectsDefinition> <Effects> <ParticleEffect name="Diesel Smoke" base="Factory Smoke Small" velocitymultiplier="0" spawnarearadius="0.25" minmagnitude="0.1" magspeedmultiplier="0" magaccmultiplier="1" usebezier="false" usemeshdata="false" usepositions="true" minspawnangle="0" minstartspeed="5.5" minlifetime="1" maxlifetime="3" maxspawnangle="20" maxstartspeed="8.5" /> </Effects> </ParticleEffectsDefinition>

The important thing here is the Particle Effect tag, which has a few required attributes: name and base. The rest of the attributes are optional and can be used to change the particle settings.

The attributes
Here's a list of all attribute names, they map to properties of ParticleEffect, MovementParticleEffect and CustomMovementParticleEffect (Part of this mod).

name base usebezier usemeshdata usepositions extraradius maxlifetime maxspawnangle maxstartspeed maxvisdistance minlifetime minspawnangle minstartspeed renderduration usesimtime magaccmultiplier magspeedmultiplier minmagnitude velocitymultiplier spawnarearadius

Color overrides
You might want to change the blend color of the particle. To do this add a Color tag as a child of the ParticleEffect tag like so:
<?xml version="1.0" encoding="utf-8" ?> <ParticleEffectsDefinition> <Effects> <ParticleEffect name="Diesel Smoke" base="Factory Smoke Small" velocitymultiplier="0" spawnarearadius="0.25" minmagnitude="0.1" magspeedmultiplier="0" magaccmultiplier="1" usebezier="false" usemeshdata="false" usepositions="true" minspawnangle="0" minstartspeed="5.5" minlifetime="1" maxlifetime="3" maxspawnangle="20" maxstartspeed="8.5" > <Color r="1" g="1" b="1" a="1"/> </ParticleEffect> </Effects> </ParticleEffectsDefinition>
It uses values from 0 to 1.0 for r,g,b and alpha.

Something about load order
There are some things to keep in mind about the loading process that Vehicle Effects uses for custom particle effects. To start, mod folders are always loaded first before it checks and loads from asset folders. When it detects that another custom effect already exists with the same name it won't load any other with that same name. Error messages for duplicate effects are only displayed when loading from mod folders. This means that you can include the same effect config and sound in multiple assets without having to worry about the mod complaining or loading duplicate effects.
Last edited by Acc3ss Violation; 23 Oct, 2018 @ 2:56am
< >
Showing 1-8 of 8 comments
Crofzed 9 Oct, 2021 @ 9:31am 
Hi, I get this error message when I try to load an XML document. Does anyone know where it comes from?

____

Text node cannot appear in this state. Line 1, position 39.
at Mono.Xml2.XmlTextReader.ReadText (Boolean notWhitespace) [0x00000] in <filename unknown>:0
at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0
at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0
at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0
at System.Xml.XmlReader.MoveToContent () [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0

____
Acc3ss Violation  [developer] 10 Oct, 2021 @ 3:05am 
Probably an XML format error at the first line
c95samuel 6 Oct, 2022 @ 1:09pm 
hi all the changes i do in the Particles Effects xml arent making effect ingame, also it shows the error: The name of the asset - 'maxstartspeed' is expected Line 22, 8
i go to that line and it has this </Effects> what i have to do?
Acc3ss Violation  [developer] 7 Oct, 2022 @ 12:33pm 
Fix the file so it doesn't produce error, I can't help unless you post the whole thing here
c95samuel 30 Oct, 2022 @ 6:07pm 
how to change the color of the steam? i tried changing the values of the rgb a but i dont see a change, and i only used from 0 to 1.0
Acc3ss Violation  [developer] 31 Oct, 2022 @ 11:29am 
That should work, unless it broke at some point. Or maybe it doesn't work nicely with some particles.
GATOR17 13 May, 2024 @ 2:04pm 
Which folder is the XML FIle suppose to be in?
Acc3ss Violation  [developer] 18 May, 2024 @ 11:03am 
The mod scans any folder that has a .crp asset file in it, but in general you want to keep it together with the asset you're using it for.
< >
Showing 1-8 of 8 comments
Per page: 1530 50