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
Need some help with another script
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#1
Need some help with another script

I have another problem with a script, the error message is this:

main (300, 2) : ERR : Unexpected end of file.

Which means I'm missing a bracket or something. Can you guys help me with this? I'm so sick of fixing these problems.

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

////////////////////////////
// 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);
AddQuest("BrokenButtonsDownstairs", "BrokenButtonsDownstairs");
}
//Stuck piston levers on western side, this indicates that this puzzle don't need changes
void PistonLeverStuck(string &in entity)
{
SetMessage("Messages", "CorrectDownstairsLever", 0);
}
//Pick up the pipes that is missing in the pipe puzzle
void RemoveHelpLight03(string &in entity)
{
FadeLightTo("Pipe03_PointLight", 0, 0, 0, 0, -1, 2);
}
void RemoveHelpLight01(string &in entity)
{
FadeLightTo("Pipe01_PointLight", 0, 0, 0, 0, -1, 2);
}
void RemoveHelpLight02(string &in entity)
{
FadeLightTo("Pipe02_PointLight", 0, 0, 0, 0, -1, 2);
}
//-------------------------------

////////////////////////////
// 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");

SetEntityActive("block_box_1", false);
SetEntityActive("AreaDontHavePotion", false);
}
//-------------------------------

////////////////////////////
// BARRIER MACHINE
/////////////////////////

//Note: To fix the machine, theres two different rooms on the west and eastern side
//Each side has it's own problem, NOT THE SAME
//Western: Pipes
//Eastern: Piston Issue

////////////////////////////
// BARRIER MACHINE - WESTERN SIDE
/////////////////////////

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

void StickyAttachPipe(string &in asStickyArea, string &in asBodyName)
{
string sTemp = StringSub(asBodyName, 0, 13);

PlaySoundAtEntity("Attach"+asBodyName, "17_pipe_attach", asStickyArea, 0.0f, false);

/*I was lazy and didn't rename to avoid double stick...*/
FixSticky(asStickyArea, false);

/*Set Var to 1 as pipe correct*/
if(asStickyArea == "StickySmallArea_1" && sTemp == "playpipesmall")
SetLocalVarInt(sTemp, 1);
else if(asStickyArea == "StickySmallArea_4" && sTemp == "playpipehigh_")
SetLocalVarInt(sTemp, 1);

/*DO NOT Allow attach to same area and set Var to 1 as pipe correct*/
if(sTemp == "playpipelarge"){
SetEntityActive("StickySmallArea_3", false);
SetLocalVarInt(sTemp, 1);
}

/*DO NOT Allow attach large pipe at area where smallpipe can attach to*/
if(sTemp == "playpipesmall" && asStickyArea == "StickySmallArea_3")
SetEntityActive("StickyLargeArea_1", false);

/*Complete puzzle as all three pipes in correct position*/
if(GetLocalVarInt("playpipesmall") == 1 && GetLocalVarInt("playpipehigh_") == 1 && GetLocalVarInt("playpipelarge") == 1){
SetEntityInteractionDisabled("playpipesmall_part01", true);
SetEntityInteractionDisabled("playpipehigh_part02", true);
SetEntityInteractionDisabled("playpipelarge_part03", true);

PlaySoundAtEntity("SteamComp", "17_steam", "PipeDone", 3.0f, true);

CreateParticleSystemAtEntityExt("steamp6", "ps_steam", "SteamAreaPuzzle_6", true, 0.8, 0.4, 0.3, 1, true, 0.3f, 0.6f, 12.0f, 13.0f);

//Make the player being able to activate one of the machine pistons in the main room
SetEntityActive("button_simple_1", false);
SetEntityActive("button_simple_4", true);

AddTimer("dprog", 0.5f, "TimerDelayProg");
}

AddDebugMessage("Area: "+asStickyArea+" Body: "+asBodyName, false);
}

void StickyDetachPipe(string &in asStickyArea, string &in asBodyName)
{
string sTemp = StringSub(asBodyName, 0, 13);

PlaySoundAtEntity("Detach"+asBodyName, "17_pipe_detach", asStickyArea, 0.0f, false);

/*I was lazy and didn't rename to avoid double stick...*/
FixSticky(asStickyArea, true);

if(asStickyArea == "StickySmallArea_1" && sTemp == "playpipesmall")
SetLocalVarInt(sTemp, 0);
else if(asStickyArea == "StickySmallArea_4" && sTemp == "playpipehigh_")
SetLocalVarInt(sTemp, 0);

/*Allow attach small pipe at area where largepipe can attach to*/
if(sTemp == "playpipelarge"){
SetEntityActive("StickySmallArea_3", true);
SetLocalVarInt(sTemp, 0);
}

/*Allow attach large pipe at area where smallpipe can attach to*/
if(sTemp == "playpipesmall" && asStickyArea == "StickySmallArea_3")
SetEntityActive("StickyLargeArea_1", true);

AddDebugMessage("Area: "+asStickyArea+" Body: "+asBodyName, false);
}

/*So that two small pipes can't stick in same places*/
void FixSticky(string &in asStickyArea, bool bActive)
{
if(asStickyArea == "StickySmallArea_6")
SetEntityActive("StickySmallArea_1", bActive);
if(asStickyArea == "StickySmallArea_5")
SetEntityActive("StickySmallArea_2", bActive);
if(asStickyArea == "StickySmallArea_4")
SetEntityActive("StickySmallArea_3", bActive);

if(asStickyArea == "StickySmallArea_1")
SetEntityActive("StickySmallArea_6", bActive);
if(asStickyArea == "StickySmallArea_2")
SetEntityActive("StickySmallArea_5", bActive);
if(asStickyArea == "StickySmallArea_3")
SetEntityActive("StickySmallArea_4", bActive);
}
//-------------------------------

////////////////////////////
// ACTIVATE THE BARRIER PISTONS
/////////////////////////

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

//Western piston
void ActivateWestPiston(string &in asEntity)
{
SetMoveObjectState("barrier_piston_1", 0);
PlaySoundAtEntity("", "17_piston_move", "barrier_piston_1", 1.0f, false);
SetEntityInteractionDisabled("button_simple_4", true);

SetLocalVarInt("BarrierPistons", 1);
}
//Eastern piston
void ActivateEastPiston(string &in asEntity)
{
SetMoveObjectState("barrier_piston_2", 0);
PlaySoundAtEntity("", "17_piston_move", "barrier_piston_2", 1.0f, false);
SetEntityInteractionDisabled("button_simple_3", true);

SetLocalVarInt("BarrierPistons", 1);
}
//-------------------------------

////////////////////////////
// POUR POTION DOWN MACHINE
/////////////////////////

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

void PotionOnMachine(string &in asItem, string &in asEntity)
{
GiveSanityBoostSmall();
SetMessage("Messages", "PotionPouredDown", 0);
RemoveItem(asItem);

GiveItemFromFile("glass_container_1", "glass_container.ent");

//I was lazy and used the same LocalVarInt on all machine puzzles
SetLocalVarInt("BarrierPistons", 1);
}

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

////////////////////////////
// PROGRESS
/////////////////////////

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

void DoProgress(string &in asEntity)
{
if(GetLocalVarInt("BarrierPistons") == 3){
{
SetGlobalVarInt("PotionPouredDown", 1);
AddTimer("done1", 3.0, "TimerDone1");
}
}
void TimerDone1(string &in asTimer)
{
PlaySoundAtEntity("", "27_orb_implode", "Player", 0.0f, false);
StartScreenShake(0.2, 0.3, 4, 4);

FadeLightTo("PointLight_6", 0, 0, 0, 0, -1, 0.5);
FadeLightTo("PointLight_7", 0, 0, 0, 0, -1, 0.5);
FadeLightTo("PointLight_8", 0, 0, 0, 0, -1, 0.5);
FadeLightTo("PointLight_17", 0, 0, 0, 0, -1, 0.5);

SetLampLit("candlestick01_1", false, false);
SetLampLit("hanging_lantern_ceiling_6", false, false);
SetLampLit("hanging_lantern_ceiling_5", false, false);
SetLampLit("hanging_lantern_ceiling_4", false, false);

AddTimer("complete", 5.0, "TimerComplete");
}
void TimerComplete(string &in asTimer)
{
//Time to finish this shit
CompleteQuest("PotionPourDownManual", "PotionPourDownManual");
CompleteQuest("BrokenButtonsDownstairs", "BrokenButtonsDownstairs");

GiveSanityBoostSmall();
PlayMusic("27_puzzle_passage", false, 0.5f, 5, 0, false);
}

////////////////////////////
// Run first time starting map
void OnStart()
{
//Script testing
GiveItemFromFile("lantern_1", "lantern.ent");
}

////////////////////////////
// Run when entering map
void OnEnter()
{
//----USE ITEM----//
AddUseItemCallback("","glass_container_1", "AreaGetPotionBack", "PlayerGetPotionBackAgain", true);
AddUseItemCallback("","glass_container_mix_done", "AreaUsePotionToProceed", "PotionOnMachine", true);
}

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

}
05-26-2013, 12:04 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Need some help with another script

(05-26-2013, 12:04 PM)Neelke Wrote: void DoProgress(string &in asEntity)
{
if(GetLocalVarInt("BarrierPistons") == 3){
{
SetGlobalVarInt("PotionPouredDown", 1);
AddTimer("done1", 3.0, "TimerDone1");
}
}

I think this is your issue. You have an opening brace but no closing brace.

If you are using Notepad++, its on lines 249 - 256 Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
05-26-2013, 01:04 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#3
RE: Need some help with another script

Wrong section of the forum, moved to development support.
05-26-2013, 06:12 PM
Find




Users browsing this thread: 2 Guest(s)