Page 1 of 2

[mod]emote[WIP] Make your character model do emotes! +API

PostPosted: Sun Jan 08, 2017 19:48
by sofar
The emote mod adds an API and several commands to allow your character model to do new gestures!

The emotes implemented currently are:

  • /sit - sit down
  • /sleep - sleep as like in a bed
  • /lay - lay down, just like sleeping
  • /freeze - character stops moving as if frozen while walking
  • /point - raise hand out to signal a direction
  • /wave - do a quick hand wave
  • /stand - used to revert back from other emotes

Moreover, the API provides a way for other mods to use these interaction in their code.

The API is documented in the https://github.com/minetest-mods/emote/blob/master/README.md

Mods can use this API to make players able to sit on their nodes, sleep on custom beds or perform an emote like /point when interacting with a node (e.g. /wave when using a chest).

An example of how to make a player sit on a node is provided: https://github.com/minetest-mods/emote/blob/master/sit-on-stairs.patch

Code: https://github.com/minetest-mods/emote
Download: https://github.com/minetest-mods/emote/ ... master.zip
License: LGPL-2.1

Image

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Sun Jan 08, 2017 22:50
by paramat
I love what you're doing here.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 00:16
by TumeniNodes
This is pretty cool. Now I can sit down and do nothing (not only in real life...) but in MT too! :D

(For some reason I was expecting to see facial expressions thinking emoticons :P ) which would also be cool

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 01:03
by sofar
FYI the next item on the list is attachment to entities, so we can have a generic implementation allowing people to ride carts/boats with this code.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 01:57
by TheReaperKing
Would that be so they could ride animals too? By the way the kids are going to FLIPPPPPPP when they see this :) Thanks for making it!

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 02:48
by sofar
TheReaperKing wrote:Would that be so they could ride animals too? By the way the kids are going to FLIPPPPPPP when they see this :) Thanks for making it!


Yes, the idea is that this API can be used by other mods to do attachment and pose. It will then be a lot easier for mods to implement vehicles since that code is already done, and they can just let this API do that work.

boats, carts, horses, pigs, helicopters, etc.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 02:59
by TumeniNodes
sofar wrote:
TheReaperKing wrote:Would that be so they could ride animals too? By the way the kids are going to FLIPPPPPPP when they see this :) Thanks for making it!


Yes, the idea is that this API can be used by other mods to do attachment and pose. It will then be a lot easier for mods to implement vehicles since that code is already done, and they can just let this API do that work.

boats, carts, horses, pigs, helicopters, etc.

Hmm..., do you think you might be able to create a way for the player to grab onto something, while jumping up, and then letting go at a certain point by using this API?
The player could basically be attaching to the vine? (or does this sound dumb?)

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 05:18
by sofar
TumeniNodes wrote: Hmm..., do you think you might be able to create a way for the player to grab onto something, while jumping up, and then letting go at a certain point by using this API?
The player could basically be attaching to the vine? (or does this sound dumb?)


If you get within interact range of a node that allows attachment using this API, then yes, you can "hang on" to a node that way. But releasing would make you just fall straight down.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 05:24
by TumeniNodes
sofar wrote:
TumeniNodes wrote: Hmm..., do you think you might be able to create a way for the player to grab onto something, while jumping up, and then letting go at a certain point by using this API?
The player could basically be attaching to the vine? (or does this sound dumb?)


If you get within interact range of a node that allows attachment using this API, then yes, you can "hang on" to a node that way. But releasing would make you just fall straight down.


Maybe there will be some way of using: pressing W while right click, to release and drop at an angle, or something once this API is finished?
It will be interesting to experiment with, I'm sure modders will exploit this new feature fully ; )

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 06:33
by Byakuren
Can mods extend emote with new emotes?

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 08:05
by sofar
TumeniNodes wrote: Maybe there will be some way of using: pressing W while right click, to release and drop at an angle, or something once this API is finished?
It will be interesting to experiment with, I'm sure modders will exploit this new feature fully ; )


No, if I do something like that then I'd make a callback hook for on release. The mod then can do any specific release behavior themselves.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 08:07
by sofar
Byakuren wrote:Can mods extend emote with new emotes?


Yes, but it does not make any sense. Any emote has to come from the existing player character animations, so if you can find a new one, I'll add it to this mod immediately.

If we want to radically add new player animations (/dance) someone will have to make these player animations in blender. Possible, but that would make the character model non-standard, and result in other issues with other mods.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 10:49
by ExeterDad
sofar wrote:
Byakuren wrote:Can mods extend emote with new emotes?


Yes, but it does not make any sense. Any emote has to come from the existing player character animations, so if you can find a new one, I'll add it to this mod immediately.

If we want to radically add new player animations (/dance) someone will have to make these player animations in blender. Possible, but that would make the character model non-standard, and result in other issues with other mods.


Sofar is it possible to "inject" animation files that were created in Blender? I know this is possible in other games. I wish I knew what keywords to search for to learn more about it. I remember during the brief time of playing Second Life, simple and sometime very sophisticated animations could be played with the players character model.
With the acceptation of moving bones via lua, our player models animations are hard coded within them. I've wondered about this for a while.
Hopefully I'm making sense as I've only been awake for like 5 minutes :)

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 11:38
by lightonflux
Head movement would be nice. So you have a visual yes and no:

/nod
/shake

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 18:02
by azekill_DIABLO
sofar wrote:The emote mod adds an API and several commands to allow your character model to do new gestures!

The emotes implemented currently are:

  • /sit - sit down
  • /sleep - sleep as like in a bed
  • /lay - lay down, just like sleeping
  • /freeze - character stops moving as if frozen while walking
  • /point - raise hand out to signal a direction
  • /wave - do a quick hand wave
  • /stand - used to revert back from other emotes

Moreover, the API provides a way for other mods to use these interaction in their code.

The API is documented in the https://github.com/minetest-mods/emote/blob/master/README.md

Mods can use this API to make players able to sit on their nodes, sleep on custom beds or perform an emote like /point when interacting with a node (e.g. /wave when using a chest).

An example of how to make a player sit on a node is provided: https://github.com/minetest-mods/emote/blob/master/sit-on-stairs.patch

Code: https://github.com/minetest-mods/emote
Download: https://github.com/minetest-mods/emote/ ... master.zip
License: LGPL-2.1

Image

+fun²

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 18:56
by TheReaperKing
We are having the error:
2017-01-09 13:49:17: ERROR[Main]: ServerError: Lua: Runtime error from mod 'emote' in callback on_chat_message(): ...ktop/minetest4.15experimental/bin/../mods/emote/init.lua:97: attempt to concatenate a nil value
2017-01-09 13:49:17: ERROR[Main]: stack traceback:
2017-01-09 13:49:17: ERROR[Main]: ...ktop/minetest4.15experimental/bin/../mods/emote/init.lua:97: in function 'start'
2017-01-09 13:49:17: ERROR[Main]: ...ktop/minetest4.15experimental/bin/../mods/emote/init.lua:186: in function 'func'
2017-01-09 13:49:17: ERROR[Main]: ...est4.15experimental/bin/../builtin/game/chatcommands.lua:29: in function <...est4.15experimental/bin/../builtin/game/chatcommands.lua:17>
2017-01-09 13:49:17: ERROR[Main]: ...inetest4.15experimental/bin/../builtin/game/register.lua:412: in function <...inetest4.15experimental/bin/../builtin/game/register.lua:392>

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 19:54
by sofar
ExeterDad wrote:Sofar is it possible to "inject" animation files that were created in Blender?


Fairly sure it would require an engine change, and a protocol change as well in minetest in order to do that.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 19:55
by sofar
lightonflux wrote:Head movement would be nice. So you have a visual yes and no:

/nod
/shake


Yes, but that would require:

1) bone manipulation
2) synchronization over time to make the head movement correct if the player moves around while doing this emote

So, way too complex for now, sorry.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Mon Jan 09, 2017 20:02
by sofar
TheReaperKing wrote:We are having the error:
2017-01-09 13:49:17: ERROR[Main]: ServerError: Lua: Runtime error from mod 'emote' in callback on_chat_message(): ...ktop/minetest4.15experimental/bin/../mods/emote/init.lua:97: attempt to concatenate a nil value
2017-01-09 13:49:17: ERROR[Main]: stack traceback:
2017-01-09 13:49:17: ERROR[Main]: ...ktop/minetest4.15experimental/bin/../mods/emote/init.lua:97: in function 'start'
2017-01-09 13:49:17: ERROR[Main]: ...ktop/minetest4.15experimental/bin/../mods/emote/init.lua:186: in function 'func'
2017-01-09 13:49:17: ERROR[Main]: ...est4.15experimental/bin/../builtin/game/chatcommands.lua:29: in function <...est4.15experimental/bin/../builtin/game/chatcommands.lua:17>
2017-01-09 13:49:17: ERROR[Main]: ...inetest4.15experimental/bin/../builtin/game/register.lua:412: in function <...inetest4.15experimental/bin/../builtin/game/register.lua:392>


This happened with `/stand`. I've pushed a fix to the repository to fix, please try that and let me know if there are additional problems!

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Tue Jan 10, 2017 00:06
by TheReaperKing
Thank you so much and sorry I couldn't post more info, I have a class of 18 kids so things have to be done quickly haha. We are using the latest version of minetest, but not the newest dev if that helps at all. We'll be sure to test tomorrow and thanks again!

As a note we were mostly having the crash when we were trying /wave

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Tue Jan 10, 2017 18:41
by Kosmos
Great, very great!!!
But can you make some more emotes (like cry; be angry; clap hands; fasepalm; make a somersault)?
:)

-Kosmos

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Tue Jan 10, 2017 19:08
by TumeniNodes
I do notice... and I am just as guilty as others here, of it...
and I'm just pointing this out as a "hehe" sort of thing... just poking fun at our human nature... :P

so, someone does a bunch of work to introduce a wicked cool new feature..., and we all say "cool"... "can you make it better?" :P

just something I noticed for a while here..., and in life in general :D

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Tue Jan 10, 2017 22:36
by sofar
Kosmos wrote:can you make some more emotes (like cry; be angry; clap hands; fasepalm; make a somersault)?


Not without doing animation work and breaking tons of mods that rely on the character model that we have right now.

Maybe later?

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Tue Jan 10, 2017 22:39
by sofar
TumeniNodes wrote:so, someone does a bunch of work to introduce a wicked cool new feature..., and we all say "cool"... "can you make it better?"


That's why I made it. First to explore how far we can take it (how many emotes can we already make with the default animations we have?), but also how can we make mods use these easily.

One of the things I'd like to do is attach these animations to e.g. the furnace, chests, and doors, so that when players use these nodes by right clicking them, an animation is shown - instead of a player just standing still.

That's why it's an API as well - so more nodes can then use the ideas in this mod easily, and the whole game is uplifted another level of refinement.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Tue Jan 10, 2017 22:43
by TumeniNodes
sofar wrote:
TumeniNodes wrote:so, someone does a bunch of work to introduce a wicked cool new feature..., and we all say "cool"... "can you make it better?"


That's why I made it. First to explore how far we can take it (how many emotes can we already make with the default animations we have?), but also how can we make mods use these easily.

One of the things I'd like to do is attach these animations to e.g. the furnace, chests, and doors, so that when players use these nodes by right clicking them, an animation is shown - instead of a player just standing still.

That's why it's an API as well - so more nodes can then use the ideas in this mod easily, and the whole game is uplifted another level of refinement.


Funny you mention some of these things... I'm working on animated chests... and some other things.
Yep, some bling, or visual-brain-candy, is definitely needed

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Wed Jan 11, 2017 00:54
by TheReaperKing
Seems to not be crashing since your update, thanks!! The point worked but I didn't see my character waving. I'll have to test more. Great job on this!

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Sat Jan 28, 2017 20:10
by tinoesroho
This mod doesn't work with playeranim. Perhaps Rui can help with a merge patch?

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Sat Jan 28, 2017 20:53
by TheReaperKing
I was going to try to see if there is a way to write a script to do a series of the commands so that you can set up dancing and especially "break dances" haha.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Wed Feb 15, 2017 01:25
by texmex
This has great potential! First thing I'd want to do if I knew how would be to have players sit down whenever they're using the crafting formspec.

Re: [mod]emote[WIP] Make your character model do emotes! +AP

PostPosted: Wed Feb 15, 2017 21:41
by sofar
tinoesroho wrote:This mod doesn't work with playeranim. Perhaps Rui can help with a merge patch?


The problem is that the interfaced used by playeranim are minetest_game player.lua API's ... and they're terrible.

Plus head animation should be a client-side modding thing, not server-side. So I actually don't even want to spend time on that right now.