I'm just about ready to cry at this!
The main problem im facing is if I move frictional's part of the script to the onstart section it throws up errors and wont load, but leaving it where it is means your solutions cant be implemented (unless im doing it wrong?).
void PullStartLever(string &in asEntity, int alState)
{
if(alState == -1) AddDebugMessage("Lever Min", false);
else if (alState == 1) StartMachine(asEntity);
}
/*If all settings correct start the machine, if not do a hickup start
*/
void StartMachine(string sEntity)
{
PlaySoundAtEntity("s1"+sEntity, "13_ignite", sEntity, 0.2f, false);
PlaySoundAtEntity("s2"+sEntity, "13_machine_fail", sEntity, 0.2f, false);
if(GetLocalVarInt("WheelOK") == 3 && GetLocalVarInt("Coal") == 3)
PullStartLever in this case is linked to the main machine lever, when it is pulled it does the Var checks, somewhere in here I need another check for the other lever. Perhaps im missing something obvious but I just cant get it working. I tried adding this before the PullStartLever command:
void PullCoalLever(string &in asEntity, int alState)
{
if(alState == 1) AddLocalVarInt("LeverOn", 1);
}
but this just stops the machine from starting even if the burner is running. I guess in this case im using the AddLocalVarInt command wrong?