Frictional Games Forum (read-only)

Full Version: Puzzle Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
(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?
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
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.
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

}
}
(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
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
(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!: )