(01-14-2012, 06:21 PM)Statyk Wrote: I'm jamming out to music full blast in my house since no one is home. Meanwhile, I will try this, as I could learn from it =P
I got it working, tested it in my "testng map" and everything works fine. Just switched caps to your info like usual =] I actually learned a good amount from this! Thanks!
NOTE: Go into the Level Editor, to each lever and make sure "InteractionDisablesStuck" is CHECKED. this way the player can move the still levers after they are stuck.
void lever3func(string &in asEntity, int alState) //follows a different "if" statement, making it opposite from the rest or... Down rather than Up.
{
if(alState == 1)
{
SetLeverStuckState("LEVER3", 1, true);
SetLocalVarInt("lever3bank", 0);
}
if(alState == -1)
{
SetLeverStuckState("LEVER3", -1, true);
SetLocalVarInt("lever3bank", 1);
CheckFunction();
}
}
void CheckFunction() //custom function called each time a lever is correctly in place. when all are in place, the function continues.
{
if(GetLocalVarInt("lever1bank") == 1 && GetLocalVarInt("lever2bank") == 1 && GetLocalVarInt("lever3bank") == 1 && GetLocalVarInt("lever4bank") == 1)
{
GiveSanityBoost();
SetSwingDoorLocked("LEVERDOOR", false, true);
}
}
Also, If the levers are facing wrong directions, instead of changing the script, just rotate the levers =P
(This post was last modified: 01-14-2012, 07:59 PM by Statyk.)
void lever3func(string &in asEntity, int alState) //follows a different "if" statement, making it opposite from the rest or... Down rather than Up.
{
if(alState == 1)
{
SetLeverStuckState("LEVER3", 1, true);
SetLocalVarInt("lever3bank", 0);
}
if(alState == -1)
{
SetLeverStuckState("LEVER3", -1, true);
SetLocalVarInt("lever3bank", 1);
CheckFunction();
}
}
void CheckFunction() //custom function called each time a lever is correctly in place. when all are in place, the function continues.
{
if(GetLocalVarInt("lever1bank") == 1 && GetLocalVarInt("lever2bank") == 1 && GetLocalVarInt("lever3bank") == 1 && GetLocalVarInt("lever4bank") == 1)
{
GiveSanityBoost();
SetSwingDoorLocked("LEVERDOOR", false, true);
}
}
I have no idea how to fix this as I'm unfamiliar with this type of scripting.
(01-15-2012, 10:54 AM)flamez3 Wrote: You have a ; at the end of void OnStart(), delete it.
Haha thanks. That's what happens, when you're working with something more advanced then you're used to and you run into an error, you assume it's caused by something you don't understand. If I would have noticed that I would have known that it doesn't belong there.
Thank you. =)
EDIT: Alright Statyk, it works. But there are a few problems..
1. You can keep pushing the last lever to the right state over and over and get a shitload of sanity boosts.
2. When it's done, I want the levers to lock in place, if possible.
Even if you cant help me with these two things, you have been of huge help once again. What would I do without you? <3
void lever3func(string &in asEntity, int alState) //follows a different "if" statement, making it opposite from the rest or... Down rather than Up.
{
if(alState == 1)
{
SetLeverStuckState("LEVER3", 1, true);
SetLocalVarInt("lever3bank", 0);
}
if(alState == -1)
{
SetLeverStuckState("LEVER3", -1, true);
SetLocalVarInt("lever3bank", 1);
CheckFunction();
}
}
void CheckFunction() //custom function called each time a lever is correctly in place. when all are in place, the function continues.
{
if(GetLocalVarInt("lever1bank") == 1 && GetLocalVarInt("lever2bank") == 1 && GetLocalVarInt("lever3bank") == 1 && GetLocalVarInt("lever4bank") == 1)
{
SetLeverStuckState("LEVER1", 1, false);
SetLeverStuckState("LEVER2", 1, false);
SetLeverStuckState("LEVER3", -1, false);
SetLeverStuckState("LEVER4", 1, false);
GiveSanityBoost();
SetSwingDoorLocked("LEVERDOOR", false, true);
}
}
(01-15-2012, 11:28 AM)Shadowfied Wrote: You only added the 4 stuckstate lines at the end? (Just so I learn )
I did, but did it work?
PS. Statyk is truly an amazing scripter, he really has lived up to his rep(Posting freak)
PPS. I just player your hunter minimap in the 24 hour amnesia, loved it
(This post was last modified: 01-15-2012, 11:31 AM by Tripication.)