Community Forum

Emitting particle systems problem

Forum Overview >> Farming Simulator 15

CategoryFarming Simulator 15
Created12.09.2015 11:46

Martin Fabik (Hungar) 12.09.2015 12:03

I trying to create my own silo for some reason. Everything is OK but particle animations is still on. First I tried to create new class SiloTrigger in my script - this works, but I was not able to fill the trailer through this way and particle animations was still on. So I copy the code and paste it in my script and edit it. Now I can fill the trailer, but particle animations is still going on. For control the emiting state I using the original part of script:

Utils.setEmittingState(self.mySilo.dropParticleSystems, true/false);

If I write the content of table self.mySilo.dropParticleSystems (by this script):
for k,v in pairs(self.mySilo.dropParticleSystems) do
print(tostring(k).." -> "..tostring(v));
if type(v) == "table" then
for k2,v2 in pairs(v) do
print(" "..tostring(k2).." -> "..tostring(v2));
I've got this:
isEmitting -> true

Full code of particle systems:

(in Load function)
local x,y,z = getTranslation(pipe);
local particlePositionStr = getUserAttribute(pipe, "particlePosition");
if particlePositionStr ~= nil then
local psx,psy,psz = Utils.getVectorFromString(particlePositionStr);
if psx ~= nil and psy ~= nil and psz ~= nil then
x = x + psx;
y = y + psy;
z = z + psz;
local psData = {};
psData.psFile = getUserAttribute(pipe, "particleSystemFilename");
psData.posX, psData.posY, psData.posZ = x,y,z;
psData.forceNoWorldSpace = true;
trigger.dropParticleSystems = {};
Utils.loadParticleSystemFromData(psData, trigger.dropParticleSystems, nil, false, nil, g_currentMission.baseDirectory, pipe);
self.mySilo = trigger;

(in startFill function)
Utils.setEmittingState(self.mySilo.dropParticleSystems, true);

(in stopFill function)
Utils.setEmittingState(self.mySilo.dropParticleSystems, false);

Can anyone help me?
Martin FabĂ­k.

Emil Drefers (Unknown) 14.09.2015 08:34

just to get sure, you probably should not name your custom classes like an original/default class ...

So, just a guess .... if you can turn on the PS with your script butswitch it off the problem is most likely in your code.
Try to use some print() to find the mistake. (Is the stop function really called?)


Martin Fabik (Hungar) 14.09.2015 20:27

I'm sure that I have all classes without name colliding.
Unfortunately if I use prints they show me this in log (also old print code used):

isEmitting -> false
isEmitting -> false
(now I pull trailer into fill trigger)
start emitting
isEmitting -> true
(now I pull trailer out of fill trigger)
stop emitting
isEmitting -> false

It's very weird for me, because game tells me that the PS is not emitted, but PS is always emitted - maybe I'll try to create my own stop/start emitting function using shader parameters. I'll post here some info about my progress in this.


Emil Drefers (Unknown) 15.09.2015 08:05

wondering why the output of your debug prints for the "self.mySilo.dropParticleSystems" does not reveal more.

This table should consist of a boolean varaiable (isEmitting) plus further tables (which contain variables like geometry, shape and forceFullLifespan)


Alex Bartz (Unknown) 15.03.2016 01:54
I have a problem with particle system.
I had installed the mod Futterlager with conveyor belts, and the particle system don't stop work.
What i have to do?

Thanks Alex Bartz.

Emil Drefers (Unknown) 15.03.2016 07:39

we can't give full support for mods here (would be way too much).
Please try to contact the author of the mod.


Note: Log in to post. Create a new account here.