Page 1 of 1

How to tell if a player is in a car?

Posted: Fri May 03, 2013 9:05 pm
by FreeER
I'm working on a mod for the wiki that creates a bomber, you can look at it here. I haven't actually posted any code for it though lol
Anyways what I would like to do is to check for spawners (and maybe creepers) under the bomber, if it finds any then it 'drops' a bomb to kill the spawner. However, I do not want the game to be constantly checking if it is on top of a spawner, only when the player is in a bomber...Does anyone know of a way to do this?

Re: How to tell if a player is in a car?

Posted: Fri May 03, 2013 9:17 pm
by kovarex
It is not possible now, but it can be added simply.

Re: How to tell if a player is in a car?

Posted: Fri May 03, 2013 9:28 pm
by FreeER
I was afraid of that lol. I go to make a mod to show what can be done with Factorio and the main portion can't actually be done yet! :lol:

Re: How to tell if a player is in a car?

Posted: Sat May 04, 2013 11:03 am
by ficolas
Im not sure about this, but it may work.

Firstly, check the player position.
Then check the entities arround the place, and if there isnt a entity called player, the player is inside the vehicle.

Re: How to tell if a player is in a car?

Posted: Sat May 04, 2013 1:04 pm
by kovarex
ficolas wrote:Im not sure about this, but it may work.

Firstly, check the player position.
Then check the entities arround the place, and if there isnt a entity called player, the player is inside the vehicle.
That is nice workaround, as the player is not actually on the map :)

Re: How to tell if a player is in a car?

Posted: Sat May 04, 2013 6:09 pm
by FreeER
nice, thank you :)