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

Location:
James' Games Site  \  Meteor 2  \  Editing  \  Question

Back to Threads

Viewing Thread: Question

 

shockdrop

Joined: 01 March 2005
Posts: 236
16 May 2005 03:54 (UK time)

how would you make the player get out of a vehicle to follow a waypoint but the vehicle isnt a specific one, just any of the ones you can get in? I know how to make him follow the waypoint.

Edited: 16 May 2005 03:57


You need to login to create posts in this thread.

Assain

Joined: 02 November 2003
Posts: 979
16 May 2005 20:35 (UK time)

I think you can only do it by doing intensive scripting on all of the possible objects that the player can enter...

You need to login to create posts in this thread.

mike323
Joined: 23 January 2005
Posts: 745
16 May 2005 23:49 (UK time)

Hmm...I'm assuming you're reaching a sector to activate the playergetoutofvehicle and bindobjecttowaypoint triggers

You need to find out how to get a script in the .sc file to activate on a sector trigger because I can't find an OnSectorReached command. Then, you can call up the player's ID and use it to bind the vehicle onto a waypoint, because the vehicle's ID will be returned, making any vehicle eligible

You need to login to create posts in this thread.

Dave Man

Joined: 19 October 2003
Posts: 374
17 May 2005 13:27 (UK time)

You don't need on SC_OnSectorReached, in fact if I'm not mistaken, if you use the SC_GetPlayerObjectId(int) when the player is in the vechile the code will return the id of the vechile the player is in. Then by using a run command in a sector like: Run SectorOne and placing this code in the script;
void OnMapStart()
{
// Object 2 is a player look alike that can be used to fake the player when you put it on a waypoint
SC_SetObjectHidden(2,1);
SC_SetObjectIndestcutible(2,1);
}
void SectorOne()
{
// I'm not sure on the correct commands here
SC_PlayerGetOutOfVechile(SC_GetPlayerObjectId,1);
SC_PlayerGetInVechile(2//fake player//,1);
SC_BindObjectToWaypoint(FAKE_PLAYER,Waypoint);
}

This code will find the vechile and when it crosses over a sector with the Run SectorOne command it will disembark the player and put it into a player look alike that the player can't control and then move the player lookalike until you disembark the player and destory the look alike (confusing but works).

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1302
17 May 2005 23:58 (UK time)

Yes it seems in this case that you would want a sector trigger rather than coding an event for every vehicle on the map. Also as event triggers will run every time you get out (if you see what I mean). The sector trigger method is fine as long as you can pin this down to reaching a certain location on the map.

Dave is quite right (although his code is not exact, his logic is perfect).

SC_PlayerGetOutOfVehicle() accepts one paremeter (M2 knows everything else it needs) which is used to determine whether the player is placed in the centre (under) or next to the vehicle. For example SC_PlayerGetOutOfVehicle(0); will place the player next to the vehicle.

SC_GetPlayerObjectId() will return the ID of the vehicle while the player is in it. In later versions of M2 this will work fine <b>accept</b> for ride on vehicles where the player is a seperate object attached to the top of the vehicle object. Ride on vehicles are not implemented in the current beta so don't worry too much about this.

So the exact syntax to make the vehicle drive away would be.

void MySectorCode()
{
int id;

id = SC_GetPlayerObjectId();
SC_PlayerGetOutOfVehicle(0);
SC_BindObjectToWaypoint( id, 1); // substitute for your WaypointId
}


James

Edited: 17 May 2005 23:59


You need to login to create posts in this thread.

Dave Man

Joined: 19 October 2003
Posts: 374
18 May 2005 13:29 (UK time)

Will there be any code to disallow the player to move the character, making it so that only a script can move the character until the player is given control (so you could make cut scenes.)?

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1302
18 May 2005 20:50 (UK time)

I think that if the player is bound to a waypoint then you loose control but that may not affect weapons too.

I need to add something proper here. I will add this thread to the todo list.

James

You need to login to create posts in this thread.



Forums system (C) 1999, 2017 by James Bunting.

Terms of Use