Hi, im Brazilian, sorry for bad english :3
so,
I'm trying to run a combination of levers on the machine, I tried but could not find tutorials,and I was improvising and comparing with others to see if it worked, but I can not at all.Here is my script out, what's wrong with it? D: the levers are: L1, 2,3,4,5,6 ... I wanted the combination would be: up, up, down, up, down, up. that the machine would be the sum, 11up and 8 down. Help please '-'
void OnStart(){
}
void Levers(string &in asEntity, int alState){ /*Set values depending on up/down postion or 0 for middle */ if(alState == -1){ if(asEntity == "L1") SetLocalVarInt("up_"+asEntity, 3); else if(asEntity == "L2") SetLocalVarInt("up_"+asEntity, 3); else if(asEntity == "L3") SetLocalVarInt("up_"+asEntity, 5); else if(asEntity == "L4") SetLocalVarInt("up_"+asEntity, 1); else if(asEntity == "L5") SetLocalVarInt("up_"+asEntity, 2); else if(asEntity == "L6") SetLocalVarInt("up_"+asEntity, 4); CheckValue(asEntity); } else if(alState == 1){ if(asEntity == "L1") SetLocalVarInt("down_"+asEntity, 1); else if(asEntity == "L2") SetLocalVarInt("down_"+asEntity, 5); else if(asEntity == "L3") SetLocalVarInt("down_"+asEntity, 6); else if(asEntity == "L4") SetLocalVarInt("down_"+asEntity, 5); else if(asEntity == "L5") SetLocalVarInt("down_"+asEntity, 2); else if(asEntity == "L6") SetLocalVarInt("down_"+asEntity, 2); CheckValue(asEntity); } else if(alState == 0){ SetLocalVarInt("up_"+asEntity, 0); SetLocalVarInt("down_"+asEntity, 0); } if(GetLocalVarInt("up_value") == 11 && GetLocalVarInt("down_value") == 8){ SetEntityActive("ShardDoor", false); GiveSanityBoost(); PlayMusic("02_puzzle.ogg", false, 0.7f, 0, 10, false); PlaySoundAtEntity("door_safety_open", "door_safety_open.snt", "Player", 0.0f, false); }}
void CheckValue(string sEntity){ PlaySoundAtEntity("s"+sEntity, "lever_mech_min_max", sEntity, 0.0f, false);
SetLocalVarInt("up_value", 0); SetLocalVarInt("down_value", 0); for(int i=1;i<=6;i++){ AddLocalVarInt("up_value", GetLocalVarInt("up_L"+i)); AddLocalVarInt("down_value", GetLocalVarInt("down_L"+i)); }}
void OnEnter(){ PlayMusic("18_amb.ogg", true, 1, 2.0f, 0, false); }
void OnLeave(){ StopMusic(2,0);}