Re: Waypoints (paths) for cars I made a quick test on the small island map, the path recording works great! Maybe we should start sharing waypoint files? Here's mine, if anyone wants it
Re: Waypoints (paths) for cars I'm not psychic and I cant find out what kind of error you got. Maybe, you can attach the screenshot?
Re: Waypoints (paths) for cars Your computer wizardry amazes me, keep up the good work. So if the bot misses a waypoint does it turn around and try to get to it? Also, I hope to see the advancement of this mod where eventually we can see races and cars reacting to others...
Re: Waypoints (paths) for cars Yes, but now I'm testing the skip point function. That is, if the bot missed the fifth point (for example, flew off the track) and him closer to go to the seventh point, then he will not go back to the fifth, and immediately run to the seventh point.
Re: Waypoints (paths) for cars I'm having fun challenging the AI to follow me along rough paths. They only occasionally have weird logic and go in circles. Great Fun. Thanks Incognito.
Re: Waypoints (paths) for cars Update (27.08.2013): Added skipping points. Fix to work with the latest version.
Re: Waypoints (paths) for cars Hi, this is pretty cool and I've been trying to get all the AI cars to start at the same time using the code below. I've got 2 AI cars id nos 1&2 I've loaded the waypoints for AI no 1 then run the command wayPoints.runCars() I get the following error: Attempting to run all cars Attempting to run car 0 Attempting to run car 1 ERR fatal lua error: lua/system/waypoints.lua:483: attempt to index global 'CarCanRun' (a nil value) Stack Traceback ========== (2) lua field 'runCars' at file 'lua/system/waypoints.lua:483 ^local variables ^ (for index) = number 1 ^ (for limi <i'm guessing there should be something after this but nothing is printed What's wrong? - < Problem solved CanCarRun[carId] should be canCarRun[carId] - stupid case sensitive variables! Code: local function runCars() print("Attempting to run all cars") for carId = 0 , 2 do print("Attempting to run Car "..carId) if ( wayPoints[carId] ~= nil ) then CanCarRun[carId] = 1 print("Car "..carId.." was run!") end end end
Re: Waypoints (paths) for cars Your mistake: the use of an array CarCanRun, that is not declared. I assume you would need to use an array canCarRun. Cars can be more than three, so use a loop with a fixed number of steps is not very good. - - - Updated - - - So it will be better: Code: local function runCars() print("Attempting to run all cars") for key in pairs(wayPoints) do runCar(key) end end
Re: Waypoints (paths) for cars Awesome, that code is so much better, although I've no idea how the pairs command works! I wanted to make it so that I could load the waypoints for a level into all AI at the same time, then run them at the same time instead of doing it one at a time. Is there a way of finding out how many cars there are on a level and which one is the player? Thanks for the help.
Re: Waypoints (paths) for cars Roughly speaking, the "wayPoints" table - is a dictionary (key-value) where the key is the index of the vehicle. pairs() iterates over all keys (and indexes, as ipairs()) in a table.
Re: [WIP] Waypoints (paths) for cars what the hell is the carid for the grand marshall because when i try to do it i type wayPoints.addPoint(fullsize,20) and it does nothing i dont understand this
Re: [WIP] Waypoints (paths) for cars Attentively read documentation. Use wayPoints.printCurrentCarId() to get the current vehicle id.
Re: Waypoints (paths) for cars i need a bit of help. heres a video witch will explain everything. - - - Updated - - - u wanna turn up the volume tough. my mic was acting weird so its not very loud
Re: Waypoints (paths) for cars To save/load paths, need to specify just file name, no "game_folder/Waypoints/SomeWay". Just a: Code: wayPoints.loadWayPoints(1, "SomeWay") Where SomeWay - the name of the file that is in the game_folder/WayPoints .
Re: Waypoints (paths) for cars Does not work. When I try to record LUA in console there is a message that waypoints is a nil value. I've pasted evertyhing from Waypoints1.02 archive and still nothing. Does it work with enable ai mod?