Frictional Games Forum (read-only)
[SCRIPT] "Water Wheelpanel" - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] "Water Wheelpanel" (/thread-13632.html)



"Water Wheelpanel" - Alento - 02-27-2012

Okey, hi everyone!

This drives me crazy!.. I've been stuck at the same place for hours and days..

What I want is this panel -> [attachment=2611] + 2 more panels (same panel) to make an "safety door" to go up.

for example: I want the "Panel1" to , let's say, If "panel1" is on state 1, and "panel2" state 2 and finally "panel3" state on 0, the door will go up, else, it's closed..

I really trying to figure it out.. but it's very tricky, If you have any ideas, please help me out! Smile

PS. If any of this is not understandable, I'll try to explain more Tongue

Thank you!


RE: "Water Wheelpanel" - SilentStriker - 02-27-2012

try using localVars



RE: "Water Wheelpanel" - Alento - 02-27-2012

(02-27-2012, 08:16 PM)SilentStriker Wrote: try using localVars
hm, The problem is, I've never used it, and I don't know how those works.


RE: "Water Wheelpanel" - Your Computer - 02-27-2012

(02-27-2012, 08:17 PM)Alento Wrote: hm, The problem is, I've never used it, and I don't know how those works.

If you understand how script variables work, then that is all the knowledge you need to understand map variables.


RE: "Water Wheelpanel" - Alento - 02-27-2012

(02-27-2012, 08:33 PM)Your Computer Wrote:
(02-27-2012, 08:17 PM)Alento Wrote: hm, The problem is, I've never used it, and I don't know how those works.

If you understand how script variables work, then that is all the knowledge you need to understand map variables.
Yeah, I read about it now, and, I think I understand it.
(02-27-2012, 08:33 PM)Your Computer Wrote:
(02-27-2012, 08:17 PM)Alento Wrote: hm, The problem is, I've never used it, and I don't know how those works.

If you understand how script variables work, then that is all the knowledge you need to understand map variables.
void OnStart()
{

SetMultiSliderCallback("panel1", "set1");
SetMultiSliderCallback("panel2", "set2");
SetMultiSliderCallback("panel3", "set3");
AddTimer("SCheck", 0.1f, "CheckState");
SetGlobalVarInt("State", 0);
}

void set1(string &in asEntity, int alState)
{
if (asEntity == "panel1")
{
if(alState == 1){
AddGlobalVarInt("State", 1);
}
}
}

void set2(string &in asEntity, int alState)
{
if (asEntity == "panel2")
{
if(alState == -1){
AddGlobalVarInt("State", 1);
}
}

}

void set3(string &in asEntity, int alState)
{
if (asEntity == "panel3")
{
if(alState == 1){
AddGlobalVarInt("State", 1);
}
}

}

void CheckState(string &in asTimer)
{
if (GetGlobalVarInt("State") == 3)
{
InteractConnectPropWithMoveObject("","CheckState", "garage", true, false, 0);
}
}


Okey, this is my script now, should that probably work?
And if it should, I've got another problem... The panels are stuck at the smallest cogwheel, and can't be changed?? why? i have stuck state? In LevelEditor, the stuck state is on "0"?

Why is it stuck?! :S