Grand Theft Loco

User avatar
Sektor
Boss
Boss
Posts: 1426
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Grand Theft Loco

Post by Sektor »

1 player train control example for bil.gmp/bil.sty:

[mis]
PLAYER_PED p = (140.0, 64.0 , 255.0) 10 180

COUNTER intrain
COUNTER true = 1
CAR_DATA carriage
CAR_DATA loco

SET_STATION_INFO (trak12, 3 , 0 , 0)

LEVELSTART

WHILE_EXEC (true = 1)

GIVE_WEAPON (p,ROCKET_LAUNCHER,1)
GIVE_WEAPON (p,WEAPON_13,1)

IF (IS_CHARACTER_IN_MODEL (p, TRAIN))
IF (intrain = 0)
SET intrain = 1
STORE_CAR_CHARACTER_IS_IN (p , carriage)
WHILE_EXEC(NOT(CHECK_CAR_MODEL(carriage,TRAINCAB)))
SET carriage = (carriage + 188)
ENDWHILE
SET loco = (carriage + 0)
TAKE_REMOTE_CONTROL_OF_CAR (p, loco)
ENDIF

// Suicide is the only way to escape remote control
IF (CHECK_CHAR_CURR_WEAPON (p , WEAPON_13))
KILL_CHAR (p)
ENDIF
ENDIF

IF (NOT(IS_CHARACTER_IN_ANY_CAR (p)))
SET intrain = 0
ENDIF

ENDWHILE

LEVELEND
[/mis]

Weirdness: If you have freight carriages, they change to passenger carriages when you change direction.
When you take over a train, if the train is moving when you suicide then the game will crash if the train makes it to another station.
Even after dying, I don't know how to give the AI control of the train again. I tried putting drivers in there and making it a DUMMY but once it gets taken by a player, only players can control it. I tried occupation DRIVER, maybe there is a more suitable occupation for the train but I didn't see one.

I didn't put CAR_BOMB in this example because for some reason vehicle weapons weren't appearing in the train even though they work in my full Loco script.
Post Reply