Multiple problems - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Multiple problems (/thread-8107.html) Pages:
1
2
|
Multiple problems - X4anco - 05-18-2011 Hello people I have 2 problems but I am sure you can help: Problem 1: I want text to appear when the player looks at something, but nothing happens Code: SetEntityPlayerLookAtCallback("1", "lookat1", false); Code: void lookat1(string &in entity, string &in type) Code: <Entry Name="look1">Lever 1</Entry> And problem 2 is: How would I get a variable to increase as they pull the levers in the right order but if they pull the wrong one the variable goes back to 0? Thank-you RE: Multiple problems - Acies - 05-18-2011 Lever: if(alState == -1) && GetLocalVarInt("LeverX")==0) // Correct pull { SetLeverStuckState("LeverName", asalState, false); AddLocalVarInt("LeverX", 1); PlayGuiSound("CorrectSound", 0.8f); return; } else if (alState == 1) && GetLocalVarInt("LeverX")==0) // Correct pull { SetLeverStuckState("LeverName", asalState, false); AddLocalVarInt("LeverX", 1); PlayGuiSound("CorrectSound", 0.8f); return; } else SetLocalVarInt("LeverX", 0); PlayGuiSound("WrongSound", 0.8f); //Reset levers to state 0? } If there was some way to reset the levers to state 0, that would be good to add. Looking: if(alState == -1); // not looking else if (alState == 1); // looking Example: void lookat1(string &in entity, string &in type) { if(alState == -1); // not looking else if (alState == 1) SetMessage("Message", "look1", 2); // looking } Not sure of the lever stuff. Almost sure something is wrong there. RE: Multiple problems - X4anco - 05-18-2011 (05-18-2011, 05:29 PM)Acies Wrote: Both of your questions can be answered with this part of a script: How would I get a variable to count RE: Multiple problems - Acies - 05-18-2011 Updated my first post to fit your script better RE: Multiple problems - X4anco - 05-18-2011 (05-18-2011, 05:57 PM)Acies Wrote: Updated my first post to fit your script better What function should I use RE: Multiple problems - Acies - 05-18-2011 Spoiler below!
However, there is more work to the script. It doesn't work as it is. RE: Multiple problems - X4anco - 05-18-2011 I'm getting Expected expression value error (73,19) (80,1) (87,1) RE: Multiple problems - Acies - 05-18-2011 Spoiler below!
This process has to be repeated for each lever. The difference will be the name as well as the variable "LeverX". LeverX decides the order - 0 for the first, 1 for the second, 2 for the third, 3 for the fourth. else if (alState == 1) && GetLocalVarInt("LeverX")==1) // Correct pull else if (alState == 1) && GetLocalVarInt("LeverX")==2) // Correct pull' Etc. As you may notice, my scripting is kind of blunt. RE: Multiple problems - X4anco - 05-18-2011 Now I am getting lots of errors, I think this is a bit too complex RE: Multiple problems - Acies - 05-18-2011 I will recreate it myself when I have the time hopefully someone talented may help you |