You are not logged in.    Login    New User    Forum Home    Search

Location:
JBPLAY  \  Meteor 2  \  Help and Guidance  \  Scripting problem

Back to Threads

Viewing Thread: Scripting problem

 

shockdrop

Joined: 01 March 2005
Posts: 236
03 April 2005 23:14 (UK time)

I'm making a mod for M2 but i cant get my .sc files to work i keep getting Line <unknown line> Error No. 1. im sure have the lines right.

You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
04 April 2005 03:44 (UK time)

First, make sure you have the ";" at the end of the line where there needed (i.e. in script "export" commands, you dont need one at the end of the line).

Also, ALL commands are case sensitive. Be sure to have capital letters where it shows capital letters in the turtorial.

If it still doesnt work, show your Script file here (just copy/paste the contents).

You need to login to create posts in this thread.

shockdrop

Joined: 01 March 2005
Posts: 236
04 April 2005 04:35 (UK time)

i Already have the ; at the end like i should. this the the .sc file:
#title ""
#author "Matt Beard"

#include meteor2

// tell M2 which functions it can use
export OnMapStart;

// export events
export OnEntervehicle_3;
export OnWaypointReached_14;



void OnMapStart()
{
// bind badguys to waypoint
SC_BindObjectToWaypoint(15,15);
SC_BindObjectToWaypoint(19,17);
SC_BindObjectToWaypoint(20,18);
SC_BindObjectToWaypoint(23,21);
SC_BindObjectToWaypoint(22,22);
SC_BindObjectToWaypoint(21,23);

// make key object indestructible
SC_SetObjectIndestructible(3,1); // Osprey
}



// events


// ash gets in osprey
void OnEnterVehicle_3()
{
// bind Osprey to waypoint
SC_BindObjectToWaypoint(3,0);

// set osprey speed
SC_SetObjectMaxSpeed(3,8);
}

// Osprey reaches edge of map
void OnWaypointReached_14(int ObjectId)
{
// run Desert Strike level
SC_RunMap("05_05_Desertstrike.map";)
}


You need to login to create posts in this thread.

Dave Man

Joined: 19 October 2003
Posts: 374
04 April 2005 13:24 (UK time)

You have the "Export OnEntervehicle_3;" done wrongly. Correctly it should say "Export OnEnterVehicle_3;"-notice the capital V. When the game trys to export that command it can't find it's counterpart because you have the "Void OnEnterVehicle_3();" capitalized correctly in the event code and therefore the game can't find the label "OnEntervehicle". Crazy, Huh. That's probably the main source of your problems.

Edited: 04 April 2005 13:31


You need to login to create posts in this thread.

shockdrop

Joined: 01 March 2005
Posts: 236
04 April 2005 21:52 (UK time)

it still dosen't work. i keep getting Line <Unknown Line>, Error No.1. i fixed the problems you told me dave man but it still won't work.

You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
05 April 2005 01:04 (UK time)

Ahh yes. See, its cas sensitve. But thats only half of the problem. Export commands SHOULDN'T have ";" at the end of them, and you do. Yes, this was confusing at first for me, it wasnt until i read the export commands on the readme and how they didnt have the semicolons and when i looked at Swallow Lake's *.SC file until i figured it out.


EDIT: Also make sure that the line starting the script on you maps says "run OnEnterVehicle" (or whatever you want to run), otherwise the game wont know what to run from your sc file.

Edited: 05 April 2005 01:05


You need to login to create posts in this thread.

shockdrop

Joined: 01 March 2005
Posts: 236
05 April 2005 02:53 (UK time)

ive checked over everything 10 times but it still wont work im still getting error no. 1. heres the file again.ive changed the object ids because i used that fix all ids thing in the advanced map properties.Copy the line thats wrong and correct it.

#title ""
#author "Matt Beard"

#include meteor2

// tell M2 which functions it can use
export OnMapStart;

// events
export OnEnterVehicle_2;
export OnWaypointReached_14;



void OnMapStart()
{
// bind badguys to waypoint
SC_BindObjectToWaypoint(17,16);
SC_BindObjectToWaypoint(18,17);
SC_BindObjectToWaypoint(19,18);
SC_BindObjectToWaypoint(20,23);
SC_BindObjectToWaypoint(21,22);
SC_BindObjectToWaypoint(22,21);
SC_BindObjectToWaypoint(54'24);

// make key object indestructible
SC_SetObjectIndestructible(2, 1); // Osprey
}



// events


// ash gets in osprey
void OnEnterVehicle_2()
{
// bind Osprey to waypoint
SC_BindObjectToWaypoint(2,0);

// set osprey speed
SC_SetObjectMaxSpeed(2,8);
}

// Osprey reaches edge of map
void OnWaypointReached_14(int ObjectId)
{
// run Desert Strike level
SC_RunMap("05_05_Desertstrike.map";);
}


You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
05 April 2005 22:40 (UK time)

Ok you HAVENT been listining! You CANNOT have ";" after export commands! It would help you ALOT if you opend up another level's SC file and looked at how those work!

Here is your problem (sence the beginning):

// events
export OnEnterVehicle_2<b><u>;</u></b>

export OnWaypointReached_14<b><u>;</b></u>



You MUST remove those ";"!

<b>Only SC commands have the ";" at the end of them!</b>

Edited: 05 April 2005 22:41


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
06 April 2005 00:07 (UK time)

Also there is a problem with the comma "," in this line...

SC_BindObjectToWaypoint(54'24);


You need to login to create posts in this thread.

shockdrop

Joined: 01 March 2005
Posts: 236
06 April 2005 00:45 (UK time)

thanks james and assasin.

You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
07 April 2005 02:19 (UK time)

YW :). Try, try again ;).

You need to login to create posts in this thread.



Forums system (C) 1999-2023 by James Bunting.

Terms of Use