Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Machine puzzle and other things
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#27
RE: Machine puzzle and other things

tYou forgot to declare some thing try this:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("BatSound", "player", "PlayBatSound", false, 1);
AddUseItemCallback("Usedsteam", "SteamRod", "MachineScript_1", "Elevator", true);
AddUseItemCallback("Usedflow" ,"FlowRod", "MachineScript_2", "Elevator_1", true);
AddUseItemCallback("Usedkey" ,"KeyRod", "MachineScript_3", "SafetyOpen", true);
}

void PlayBatSound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Bat", "general_bat.snt", "BAtSound", 0.1f, false);
}
void SafetyOpen (string &in asItem, string &in asEntity)
{
SetEntityActive("KeyRod_static", true);
PreloadSound("rod_in.snt");
PreloadSound("17_piston_move.snt");
RemoveItem("KeyRod");
SetMoveObjectState("safety_normal_vert_1", 1.0f);
SetMoveObjectState("safety_normal_vert_2", 1.0f);
SetMoveObjectState("safety_normal_vert_3", 1.0f);
SetMoveObjectState("safety_normal_vert_4", 1.0f);
SetMoveObjectState("safety_normal_vert_5", 1.0f);
SetMoveObjectState("safety_normal_vert_6", 1.0f);
}
void Elevator (string &in asItem, string &in asEntity)
{
SetEntityActive("SteamRod_static", true);
PreloadSound("rod_in.snt");
RemoveItem("SteamRod");
AddLocalVarInt("ElevatorWork", 1);
func_check();
}

void Elevator_1 (string &in asItem, string &in asEntity)
{
SetEntityActive("FlowRod_static", true);
PreloadSound("rod_in.snt");
RemoveItem("FlowRod");
AddLocalVarInt("ElevatorWork", 1);
func_check();
}

void func_check()
{
if (GetLocalVarInt("ElevatorWork") == 2)
{
PreloadSound("13_flow_done.snt");
SetEntityConnectionStateChangeCallback("elevator_lever_1", "Map");
}
}

void Map (string &in asEntity, int alState)
{
if (alState == 1)
{
FadeOut(4);
ChangeMap("00_Buda.map", "PlayerStartArea_1", "14_elevator_activate.snt", "elevator_move_normal.snt");
}
}


CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
11-14-2012, 09:02 PM
Find


Messages In This Thread
RE: Machine puzzle and other things - by Adny - 11-04-2012, 07:59 PM
RE: Machine puzzle and other things - by Steve - 11-04-2012, 08:15 PM
RE: Machine puzzle and other things - by Steve - 11-07-2012, 05:19 PM
RE: Machine puzzle and other things - by Steve - 11-14-2012, 09:02 PM



Users browsing this thread: 1 Guest(s)