The 91 isn't set up yet, so I'd just like to test the concept of 'disabling' the pantograph. If I wanted to get it to run without ending, could I put it in a while loop? Does everything have to start with a function, because if I'd have to contain it in Initialise() I'd end up in the same situation.Kariban wrote: Put BeginUpdate at the bottom of Initialise. Update runs when you're driving the vehicle I think, but not when the AI is unless you tell it to. Initialise is only run once when the script starts, so it sets your panto to 0 and then never touches it.
:EDIT:
I've tried this 'while' loop, there's an Initialise() inside the block of code and PantographControl is already preset to 0, yet I can still use the pantograph. I thought that since Initialise() is inside the loop it will continue to run through it even though Initialise() only does it once. But this doesn't seem to work
Code: Select all
while Call("*:GetControlValue", "PantographControl", 0) == 0 do
function Initialise()
if (Call("*:GetControlValue", "PantographControl", 0) ==0) then
Call("*:SetControlValue", "PantographControl", 0, 0);
end
end
end