Author | Message |
amilmand
Posts: 259
Location: --- Occupation: Age: V$: |
#138819 2018-03-13 03:21 |
You can but you would have to give the control of the players car away to a bot (only one controller can have control over a given car either player input or the bot) with a script like
Bot raceBot = new Bot( 0, 1, 1, 2.0, 2.0, 1.0); player.controller.command( "leave " + player.car.id() ); raceBot.car = player.car; raceBot.enterCar(raceBot.car); raceBot.brain.command( "AI_BeginRace 1.0" ); raceBot.followSplineTrack( SplineWidth, "maps\\RaceSpl\\temp_spl_"+bot_i+".spl", 0 );you would probably have to reset the camera aswell You could perhaps monitor player input in a track's handleevent or similar method and give back control to the player upon keypress raceBot.leaveCar(0);//traffic id should be 0 player.controller.command( "controllable " + player.car.id() ); |
|