Better character API

Things that already exist in the current mod API
Post Reply
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Better character API

Post by DaveMcW »

I would like more character actions exposed to Lua.

setcommand({type="gotolocation"}) - similar to Lua/Unit
selectedgunindex - make writeable
fire gun
throw capsule
mine
toggle item auto pick-up

Rseding91
Factorio Staff
Factorio Staff
Posts: 13213
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Better character API

Post by Rseding91 »

DaveMcW wrote:I would like more character actions exposed to Lua.

setcommand({type="gotolocation"}) - similar to Lua/Unit
selectedgunindex - make writeable
fire gun
throw capsule
mine
toggle item auto pick-up
entity.walkingstate will let you control the player's movement
selectedgunindex is already writeable
entity.miningstate will let you control the player's mining

As the others, those aren't bad ideas. I'll see what Kovarex says. If he's ok with them I could add them.
If you want to get ahold of me I'm almost always on Discord.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Better character API

Post by DaveMcW »

Rseding91 wrote:selectedgunindex is already writeable
Cool. You might want to put a bounds check on it. ;)
Rseding91 wrote:entity.walkingstate will let you control the player's movement
Seems like a waste to write my own pathfinding code when you already have an API for it.

Post Reply

Return to “Already exists”