Frictional Games Forum (read-only)

Full Version: Script for 3 rods
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Any help about the scripting for 3 rods? I have nothing to see from other video about this tutorial. Sad
I don't understand? Can you kinda give me some insight on this? I certainly can't make a script with just "3 rods".
I mean the rod puzzle. The 3 rods must be put in a hole just like from machine room in ATDD.
I need to know this kind of script.
Oh. So if the three rods is inserted something happens? I assume that's the case.
Spoiler below!

//Rods_* are the rods
//TouchArea_* are the script areas. They must be put where the holes are.
void OnStart()
{
for(int = b; b == 3; b++) AddEntityCollideCallback("Rods_*", "TouchArea_*", "RodsInsert", true, 1);
SetLocalVarInt("Rods", 0);
}

void RodsInsert(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Rods", 1);
RodsCheck();
}

void RodsCheck()
{
if(GetLocalVarInt("Rods") == 3)
{
//...Do something...//
}

else if(GetLocalVarInt("Rods") < 3)
{
}
}

You right. 3 rods must be put in the case.

My question is did you know how to script on it?
What JustAnotherPlayer put in the Spoiler is the appropriate script for it. However in the part where it says //...Do something...//, you code what you want to happen, like, a door somewhere else opens, or something turns on, etc.
ok i got your point. So i will try it.