Frictional Games Forum (read-only)
[SCRIPT] Puzzle Help - 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] Puzzle Help (/thread-16496.html)



Puzzle Help - SilentHideButFine - 06-25-2012

Hello , i wanna make an puzzle that gonna work like this

if you put a stone in a special place or any other entity you need to place two more entitys but they are on different locations


RE: Puzzle Help - Cruzore - 06-25-2012

i would suggest a simple collide callback. Can't tell more, since there's not enough information on how exactly you want it to look.


RE: Puzzle Help - SilentHideButFine - 06-25-2012

(06-25-2012, 08:22 PM)FastHunteR Wrote: i would suggest a simple collide callback. Can't tell more, since there's not enough information on how exactly you want it to look.



A simple puzzle with 3 entitys and 3 plates = place 1 stone on plate 1 then you have 2 more to fix you understand more?


RE: Puzzle Help - GoranGaming - 06-25-2012

Do you know how to script or do you want help? You can either do like FastHunter says, Collide callbacks, or you could use LocalVarInt variables


RE: Puzzle Help - Cruzore - 06-25-2012

1st one:
make a script area to where the stone should go.
Add a Collide callback for the stone touching the script area, the called function should set the stone inactive and should set a fixed, non-movable stone at the right place active.
Do the same with the rest.
Not too hard, ain't it? You can of course add sounds, special effects or something like that.


RE: Puzzle Help - GoranGaming - 06-25-2012

void OnStart()
{
AddEntityCollideCallback("Stone1", "Stone1Area", "CollideStoneArea1", false, 0);
AddEntityCollideCallback("Stone2", "Stone2Area", "CollideStoneArea2", false, 0);
AddEntityCollideCallback("Stone3", "Stone3Area", "CollideStoneArea3", false, 0);

}

void CollideStoneArea1(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("Stone1", 1);

//THIS CHECKS IF THE PUZZLE IS FINISHED
if(GetLocalVarInt("Stone1") == 1 && GetLocalVarInt("Stone2") == 1 && GetLocalVarInt("Stone3") ==1){
//FINISH THE PUZZLE, DO WHATEVER YOU WANT

}
}


void CollideStoneArea2(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("Stone2", 1);

//THIS CHECKS IF THE PUZZLE IS FINISHED
if(GetLocalVarInt("Stone1") == 1 && GetLocalVarInt("Stone2") == 1 && GetLocalVarInt("Stone3") ==1){
//FINISH THE PUZZLE, DO WHATEVER YOU WANT

}
}


void CollideStoneArea3(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("Stone3", 1);

//THIS CHECKS IF THE PUZZLE IS FINISHED
if(GetLocalVarInt("Stone1") == 1 && GetLocalVarInt("Stone2") == 1 && GetLocalVarInt("Stone3") ==1){
//FINISH THE PUZZLE, DO WHATEVER YOU WANT

}
}


RE: Puzzle Help - SilentHideButFine - 06-25-2012

(06-25-2012, 08:35 PM)GoranGaming Wrote: Do you know how to script or do you want help? You can either do like FastHunter says, Collide callbacks, or you could use LocalVarInt variables



i dont know how to script with Var's :S


RE: Puzzle Help - GoranGaming - 06-25-2012

There you go, if you need more script help, contact me Smile

Note that this is jut a quick version of the puzzle, you need to add sound and other effects to make it look cool Smile


RE: Puzzle Help - SilentHideButFine - 06-25-2012

(06-25-2012, 08:44 PM)GoranGaming Wrote: There you go, if you need more script help, contact me Smile



Note that this is jut a quick version of the puzzle, you need to add sound and other effects to make it look cool Smile



TY!!! Smile Going to try it out now!: )