• Register

The near future: Trains are no longer controlled by humans. Instead, artificial intelligence is used to handle traffic. Program the best AI, beat challenges on various maps and watch it fight other AIs in live, online matches!

Forum Thread
  Posts  
no train.dir at ai.foundPassengers (Games : TrAInsported : Forum : General AI questions : no train.dir at ai.foundPassengers) Locked
Thread Options
Apr 24 2013 Anchor

I've got a quite annoying problem with my pathfinding. I want to calculate the route at the moment i pick up a passenger, but the train var you get from foundPassengers doesn't includes the direction and next position. since i can only work in functions, i can't just wait for the next square my train i moving and compare the position to the one before :(

is there a possibility to find out in what way my train is moving at the moment of picking up a passenger?

I didn't red the whole source code, and i wouldn't even understand 1/2 of it, but would this work:
htt p://www .file-upload.net/download-7512508/ai.lua.html

I just changed line 376... would help me a lot...

Apr 26 2013 Anchor

function ai.foundPassenger(train, passengers)
dir = train.dir
end

Apr 26 2013 Anchor

Oh...
Oh...

Ok, thank you! I...just..., I don't know, I think I did a huge mistake... :S

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.