Re: Extracting car speed and gas

David Savinkoff <[email protected]> Sat, 7 Oct 2017 01:06:34 -0600 (MDT)
Newsgroups gmane.games.torcs.general
Message-ID <1734181808.11745288.1507359994291.JavaMail.zimbra@mailid.telus.net>
----- Gal Israeli wrote:
> Hi,
> I've been using your great simulator for testing an algoirthm.
> 
> We are trying to find out where we can get the current car speed every loop
> simulation, and no success so far. can you please direct us to the file?
> 
> Also after that I need to publish a new gas to the car.
> 
> Thank you

See:
car->pub.speed
in:
torcs/src/drivers/human/human.cpp :: static void common_drive(int index, tCarElt* car, tSituation *s)

car->pub.speed can be used in a similar fashion anywhere.
Just do it the same as in human.cpp

To find pub.speed in the source code, type:
find . -type f -print0 | xargs -0 grep -i pub.speed
in a terminal from:
torcs/src/modules
or elsewhere if desired.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot