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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need to fix something with this script, need help
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#1
I need to fix something with this script, need help

I've made a script that aint working properly, it sais "Unexpected end of file 170, 2". Can somebody help me since I cannot find the problem?

//-------------------------------

////////////////////////////
// INTERACTIONS
/////////////////////////

//-------------------------------

//Player interacts with missing pipe
void InteractMissingPipe(string &in entity)
{
SetMessage("Messages", "PotionFailedToReach", 0);
AddQuest("PotionPourDownManual", "PotionPourDownManual");
}
//Player interacts potion pool
void PlayerNeedsPotionBack(string &in entity)
{
SetMessage("Messages", "PotionOnFloor", 0);
}
//Player tries to get down to puzzle area, but hasn't received the potion yet
void DontHavePotion(string &in entity)
{
SetMessage("Messages", "DoesntHavePotion", 0);
}
//Locked forever door, with an extra message tied on to it
void LockedForeverExtra(string &in entity)
{
if(GetSwingDoorLocked("cellar_wood01_1") == true)
{

SetMessage("Messages", "InteractLockedForeverExtra", 0);

}
}
//Player finds interacts with barrier machine, where he is supposed to pour potion
void InteractUsePotionMachine(string &in entity)
{
SetMessage("Messages", "InteractBarrierMachineManual", 0);
}
//Player interacts with broken buttons that needs to be fixed
void InteractBrokenButton(string &in entity)
{
SetMessage("Messages", "BrokenButtons", 0);
}

//-------------------------------

////////////////////////////
// PLAYER GETS POTION BACK
/////////////////////////

//-------------------------------

void PlayerGetPotionBackAgain(string &in asItem, string &in asEntity)
{
GiveSanityBoostSmall();
SetMessage("Messages", "ReceivePotionAgain", 0);

RemoveItem(asItem);
GiveItemFromFile("glass_container_mix_done", "glass_container_mix_done.ent");

}
//-------------------------------

////////////////////////////
// PUZZLES
/////////////////////////

//-------------------------------

//The lever combination for eastern piston
void StateChangePistonLever(string &in asEntity, int alState)
{
SetLocalVarInt(asEntity, alState+1);

/*Piston position values for the 8 levers on min/max*/
float[] aL1 = {-0.075f,0.0f,0.05f};
float[] aL2 = {0.025f,0.0f,-0.03f};
float[] aL3 = {0.025f,0.0f,-0.025f};
float[] aL4 = {-0.075f,0.0f,0.05f};
float[] aL5 = {-0.075f,0.0f,0.05f};
float[] aL6 = {0.025f,0.0f,-0.03f};
float[] aL7 = {0.025f,0.0f,-0.025f};
float[] aL8 = {-0.075f,0.0f,0.05f};

/*The value for the lever positions*/
float fMove = aL1[GetLocalVarInt("p_lever_1")] + aL2[GetLocalVarInt("p_lever_2")]
+ aL3[GetLocalVarInt("p_lever_3")] + aL4[GetLocalVarInt("p_lever_4")];
+ aL5[GetLocalVarInt("p_lever_5")] + aL6[GetLocalVarInt("p_lever_6")];
+ aL7[GetLocalVarInt("p_lever_7")] + aL8[GetLocalVarInt("p_lever_8")];

SetMoveObjectState("piston", fMove);

if(alState != 0){
PlaySoundAtEntity("piston"+fMove, "17_piston_move", "piston", 1.0f, false);
CreateParticleSystemAtEntityExt("pistonp"+fMove, "ps_steam_piston_move", "Area_piston", false, 0.8, 0.4, 0.3, 1, true, 0.3f, 0.6f, 12.0f, 13.0f);
}

/*Complete the puzzle if all the 8 levers has been moved to its correct spot*/
if(GetLocalVarInt("p_lever_1") == 2 && GetLocalVarInt("p_lever_2") == 2 &&
GetLocalVarInt("p_lever_3") == 2 && GetLocalVarInt("p_lever_4") == 0){
GetLocalVarInt("p_lever_5") == 0 && GetLocalVarInt("p_lever_6") == 2){
GetLocalVarInt("p_lever_7") == 2 && GetLocalVarInt("p_lever_8") == 0){

if(GetLocalVarInt("FirstPuzzleSolved")==0)
{
SetLocalVarInt("FirstPuzzleSolved", 2);
}

for(int i=3;i<6;i++){
CreateParticleSystemAtEntityExt("steamp"+i, "ps_steam", "SteamAreaPuzzle_"+i, true, 0.8, 0.4, 0.3, 1, true, 0.3f, 0.6f, 12.0f, 13.0f);
PlaySoundAtEntity("steamps"+i, "17_steam_quiet", "SteamAreaPuzzle_"+i, 1.0f, true);
}

PlaySoundAtEntity("PistonComp", "17_piston_correct", "PistonDone", 3.0f, true);

for(int i=1;i<5;i++){
RemoveEntityCollideCallback("p_lever_"+i, "L_Up_Area_"+i);
RemoveEntityCollideCallback("p_lever_"+i, "L_Down_Area_"+i);
}

PlaySoundAtEntity("pistondone", "17_piston_done", "piston", 0.0f, false);

SetLeverStuckState("p_lever_1", -1, false);
SetLeverStuckState("p_lever_2", 1, false);
SetLeverStuckState("p_lever_3", 1, false);
SetLeverStuckState("p_lever_4", -1, false);
SetLeverStuckState("p_lever_5", -1, false);
SetLeverStuckState("p_lever_6", 1, false);
SetLeverStuckState("p_lever_7", 1, false);
SetLeverStuckState("p_lever_8", -1, false);

for(int i=1;i<5;i++)
SetEntityPlayerInteractCallback("p_lever_"+i, "InteractFixedLevers", false);
}

AddDebugMessage("Entity: "+asEntity+" State: "+alState+" Value: "+fMove, false);
}
//-------------------------------
////////////////////////////
// Run first time starting map
void OnStart()
{

}

////////////////////////////
// Run when entering map
void OnEnter()
{
///////////////////////////
// UseItem
AddUseItemCallback("", "glass_container_1", "AreaGetPotionBack", "PlayerGetPotionBackAgain", false);

///////////////////////////
// Collide Callbacks
AddEntityCollideCallback("p_lever_"+i, "L_Up_Area_"+i, "", false, 1);
AddEntityCollideCallback("p_lever_"+i, "L_Down_Area_"+i, "", false, 1);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
05-03-2013, 05:29 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#2
RE: I need to fix something with this script, need help

Maybe this is not your error, but...
Those +i you have in OnEnter()
where are they declared?

05-03-2013, 05:49 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#3
RE: I need to fix something with this script, need help

(05-03-2013, 05:49 PM)Amn Wrote: Maybe this is not your error, but...
Those +i you have in OnEnter()
where are they declared?

^Yeah, that might be it.

Or this:

PHP Code: (Select All)
if(GetLocalVarInt("p_lever_1") == && GetLocalVarInt("p_lever_2") == && 
GetLocalVarInt("p_lever_3") == && GetLocalVarInt("p_lever_4") == 0){
GetLocalVarInt("p_lever_5") == && GetLocalVarInt("p_lever_6") == 2){
GetLocalVarInt("p_lever_7") == && GetLocalVarInt("p_lever_8") == 0){ 
(This post was last modified: 05-04-2013, 05:11 AM by Tomato Cat.)
05-03-2013, 06:16 PM
Find




Users browsing this thread: 2 Guest(s)