How to tell if a player is in a car?

Place to get help with not working mods / modding interface.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

How to tell if a player is in a car?

Post 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?
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

kovarex
Factorio Staff
Factorio Staff
Posts: 8194
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post by kovarex »

It is not possible now, but it can be added simply.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

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

Post 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:
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

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

Post 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.

kovarex
Factorio Staff
Factorio Staff
Posts: 8194
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post 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 :)

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

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

Post by FreeER »

nice, thank you :)
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

Post Reply

Return to “Modding help”