Page 1 of 1

Better character API

Posted: Sat May 02, 2015 11:19 pm
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

Re: Better character API

Posted: Sun May 03, 2015 4:38 am
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.

Re: Better character API

Posted: Sun May 03, 2015 8:13 am
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.