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
Unexpected end of file (423, 2)
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#1
Unexpected end of file (423, 2)

Another script that I'm having problems with. And since this is some new stuff I'm scripting with, I have no idea what the issue might be. You guys could perhaps help me out?

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

///////////////////////////////////////////
// WHEN WORM IS COLLIDED WITH
////////////////////////////////////////////

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

//Since there is no base class for the worm, it needs to be way harder than it first needs to be
//There are over 40 areas where the script checks where the player is located
//If worm is in same area, the player will die and have to start over

//Defines what steps are at first worm
int glWormOneStartIdx = 1;
int glWormOneEndIdx = 9;

//Defines what steps are at second worm
int glWormTwoStartIdx = 10;
int glWormTwoEndIdx = 32;

//Defines what steps are at final worm
int glWormThreeStartIdx = 33;
int glWormThreeEndIdx = 49;

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

//The steps for the worm
void DoWormStep()
{
int lCurrentWormStep = GetLocalVarInt("WormStep");

AddLocalVarInt("WormStep", 1);
int lWormStep = GetLocalVarInt("WormStep");

CheckPlayerWormVariable();

if(lWormStep!=9){
SetLocalVarInt("WormFinished", 2);
}else if lWormStep!=32){
SetLocalVarInt("WormFinished", 3);
}else if lWormStep!=49){
SetLocalVarInt("WormFinished", 4);
}
}
//The steps for the player
void DoPlayerStep()
{
int lCurrentPlayerStep = GetLocalVarInt("PlayerStep");

AddLocalVarInt("PlayerStep", 1);
int lPlayerStep = GetLocalVarInt("PlayerStep");
}

//This checks if player and worm has the same variable. If so, kill the player
void CheckPlayerWormVariable()
{
if(GetLocalVarInt(lPlayerStep)=="+GetLocalVarInt("PlayerStep")+") &&
GetLocalVarInt(lWormStep)=="+GetLocalVarInt("WormStep")+")
{
PlayGuiSound("worm_attack", 1.0f);
AddPlayerHealth(-200);
CheckPoint("checkpoint","PlayerStartArea_"+GetLocalVarInt("WormFinished")+"_Worm",
"ContinueAgain", "Hints", "DeathByWorm");
}
}

//The events during all these 49 areas, only the important areas exists here
void WormStep(string &in asParent, string &in asChild, int alState) {
DoWormStep();

RemoveEntityCollideCallback(asParent, asChild);
}
void WormStep9(string &in asParent, string &in asChild, int alState) {
DoWormStep();

RemoveEntityCollideCallback(asParent, asChild);

//The worm cannot be turned off for some reason, but luckily it can go through objects
SetMoveObjectState("worm_1", -3);
}
void WormStep32(string &in asParent, string &in asChild, int alState) {
DoWormStep();

RemoveEntityCollideCallback(asParent, asChild);

//The worm cannot be turned off for some reason, but luckily it can go through objects
SetMoveObjectState("worm_2", -3);
}
void WormStep49(string &in asParent, string &in asChild, int alState) {
DoWormStep();

RemoveEntityCollideCallback(asParent, asChild);

//The worm cannot be turned off for some reason, but luckily it can go through objects
SetMoveObjectState("worm_2", -3);
}

//Player steps
void PlayerStep(string &in asParent, string &in asChild, int alState)
{
DoPlayerStep();

RemoveEntityCollideCallback(asParent, asChild);
}
11-17-2013, 10:13 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Unexpected end of file (423, 2)

Seeing as it says (423, 2), your issue is on line 423, two letters across.
The code you have here is only ~100 lines long, so it makes it a bit difficult to look over it Smile

Could you possibly post your full code?

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 11-18-2013, 02:37 AM by Romulator.)
11-18-2013, 02:34 AM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#3
RE: Unexpected end of file (423, 2)

Fixed it.
(This post was last modified: 11-18-2013, 07:21 PM by Neelke.)
11-18-2013, 11:26 AM
Find




Users browsing this thread: 4 Guest(s)