Community Forum

Move objects around in game

Forum Overview >> Farming Simulator 2009

CategoryFarming Simulator 2009
Created14.01.2010 00:04


Tobias S. (Unknown) 14.01.2010 00:18
Hi,

i want to move my siloplane to another y coordinate. I have written this little part in my sourcecode to move the siloplane. The plan should be lowered, while i load the shovel of my tractor until the shovel is full or the silo is empty. -1.4 is the minLevel of my silo. what´s the mistake? Thanks


local x,y,z = getTranslation(g_currentMission.tipTriggers[i].movingId);
if y > -1.4 then
local deltaFillLevel = dt*self.fruitTrigger[i].fillSpeed;
attachable:setFillLevel(attachable.fillLevel+deltaFillLevel, self.fruitTrigger[i].fillType);
setTranslation(g_currentMission.tipTriggers[i].movingId, x, y - 0.003 ,z);
end;


I have found a mistake: the "g_currentMission.tipTrigger[i].movingId" is nil according to the log.txt. Why is it nil? this sourcecode is included in the game as an extra sourcefile. i have used the same expression in movable milktrigger and it works. but why there not?

Christian S (Unknown) 16.01.2010 13:03
Hi,

because not all Triggers have a Plane, so there is no movingId.

Best Regards

Christian


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