(08-01-2012, 02:46 PM)Steve Wrote: could you give us some more information(I mean more like the entire script or a bigger part or something...)
The error here:
void SixLevers(string &in asEntity, int alState)
{
/*Set values depending on up/down postion or 0 for middle
*/
if(alState == -1){
if(asEntity == "lever_machine_lever01_1") SetLocalVarInt("up_"+asEntity, 3);
else if(asEntity == "lever_machine_lever01_2") SetLocalVarInt("up_"+asEntity, 3);
else if(asEntity == "lever_machine_lever01_3") SetLocalVarInt("up_"+asEntity, 5);
else if(asEntity == "lever_machine_lever01_4") SetLocalVarInt("up_"+asEntity, 1);
else if(asEntity == "lever_machine_lever01_5") SetLocalVarInt("up_"+asEntity, 2);
else if(asEntity == "lever_machine_lever01_6") SetLocalVarInt("up_"+asEntity, 4);
AddDebugMessage("Lever Min & up value: " + GetLocalVarInt("up_value"), false);
}
else if(alState == 1){
if(asEntity == "lever_machine_lever01_1") SetLocalVarInt("down_"+asEntity, 1);
else if(asEntity == "lever_machine_lever01_2") SetLocalVarInt("down_"+asEntity, 5);
else if(asEntity == "lever_machine_lever01_3") SetLocalVarInt("down_"+asEntity, 6);
else if(asEntity == "lever_machine_lever01_4") SetLocalVarInt("down_"+asEntity, 5);
else if(asEntity == "lever_machine_lever01_5") SetLocalVarInt("down_"+asEntity, 2);
else if(asEntity == "lever_machine_lever01_6") SetLocalVarInt("down_"+asEntity, 2);
AddDebugMessage("Lever Max & down value: " + GetLocalVarInt("down_value"), false);
}
else if(alState == 0){
SetLocalVarInt("up_"+asEntity, 0);
SetLocalVarInt("down_"+asEntity, 0);
AddDebugMessage("Lever Mid", false);
}
/*All rods correct
*/
if(GetLocalVarInt("up_value") == 8 && GetLocalVarInt("down_value") == 8){
SetMessage("Ch01Level13", "EvenFlow", 0);
SetLocalVarInt("SticksOK", 1);
for(int i=1;i<7;i++)
SetLeverStuckState("machine_lever_"+i, GetLeverState("machine_lever_"+i), true);
for(int i=1;i<=6;i++){
CreateParticleSystemAtEntity("FlowP"+i, "ps_steam.ps", "FlowParticles_"+i, true);
PlaySoundAtEntity("FlowS"+i, "13_steam", "FlowParticles_"+i, 0.5, true);
}
PlaySoundAtEntity("done"+asEntity, "13_flow_done", asEntity, 0.0f, false);
}
}