Bot recording sync
#1


EDIT: Found a way to sync traffic lights easily.


If you want your driver bot to sync to the red and green lights on the streets, this is all you have to do.

First - You make a recording of your choice (Ex. City Bus). Make a vehicle recording in a vehicle of your choice ( id 437 is a coach bus). Drive through your city, stop at bus stops(if thats what you want to do).Stop at red lights. You can make right on reds, but not a left. Go on green as soon as it turns green. And DO NOT RUN ANY YELLOW LIGHTS !

Second - DO NOT ADD YOUR NPC under OnGameModeInit !!

Instead, do it like this..

Код:
public OnGameModeInit()
{
	SetTimer("BotConnect",30000, 0);
// rest of your normal stuff goes here...
}
Then add the forward
Код:
forward BotConnect();
And last but not least, add the Public
Код:
public BotConnect()
{
  ConnectNPC("Driver","citybus");
  print("BotTimerFinished");
}
This will sync the recording traffic lights to your live in-game traffic lights. The recording will be MAX 3 seconds behind, but thanks the the buffering inbetween the light change, the worse you can do is run a yellow light. (Thats if you CLEARLY dont run a yellow light in your original recording).

Easy and it works, hope you can all benefit from it !

Jason

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)