Minetest logo

IRC log for #minetest-mods, 2014-07-19

| Channels | #minetest-mods index | Today | | Google Search | Plaintext

All times shown according to UTC.

Time Nick Message
06:47 LazyJ joined #minetest-mods
11:25 Eivel joined #minetest-mods
11:26 Eivel hello
11:59 Someguy123 joined #minetest-mods
12:04 Someguy123 joined #minetest-mods
12:27 Eivel Could someone help me with a mod problem? I'm trying to make a player sit on command, but animation does not work (he still stands). Code fragment responsible for this is here: http://pastebin.com/A2019QzX
12:44 Someguy123 joined #minetest-mods
13:28 LazyJ Eivel, I don't know what the code is but the boats mod in minetest_game will have it.
13:28 LazyJ The players sit as soon as they punch the boat.
13:30 Eivel That's the problem. The only difference betwee my code and the boat's is attaching a player to a boat. The sit command is the same. I may try to attach player to an invisible node, but before I just wanted to ensure that this is the problem.
13:32 LazyJ May also depend where on the node you are trying to sit.
13:33 LazyJ As far as I know, two nodes can't exist in the same 1x1x1 space.
13:34 LazyJ So if you are trying to sit on a HomeDecor chair, for example, that won't work because the chair occupies the 1x1x1 space the player "node" (avatar) would have to sit.
13:35 LazyJ Another example would be the smallest, thinnest 1/4 microblock that MoreBlocks' saw produces.
13:35 LazyJ Even though that micro-panel is just a sliver it still occupies a 1x1x1 space and will hold back a water_source node.
13:36 Zefram_Fysh the player avatar isn't a "node".  it's an "entity"
13:36 LazyJ Well, you know what I was referring too at least. ;)
13:36 Eivel I thought that the sitting is only an animation. That the player entity doesn't really move itself.
13:36 Taoki joined #minetest-mods
13:37 Zefram_Fysh each 1x1x1 space is occupied by exactly one node, so nodes mutually exclude each other, but entities each have a position independent of other entities.  any number of entities may be in or close to a single node space, up to a configurable per-mapblock limit
13:37 Eivel Hm, so it's not the issue then.
13:38 LazyJ Ah. My assumption was wrong. Cool.
13:39 LazyJ I know that sounds odd, but I'm learning this stuff mostly by observation and trial-and-error.
13:39 Eivel Me too. Also I have no experience with LUA, so it hardens the process of learning
13:39 LazyJ So when solid info is learned, it's a good thing.
13:40 LazyJ Try sifting through the lua_api.txt in the docs directory.
13:40 LazyJ The details and examples are far too spartan for us beginners but it's better than nothing.
13:41 Eivel I surely will. As soon as I got my hands on the link on the #minetest, I started reading.
13:41 Eivel But what's troubling, my code seems to be right according to the docs
13:42 Eivel Zefram_Fysh: Maybe you have an idea what I may have missed?
13:44 Zefram_Fysh looking now.  I don't know for sure.  try adding a trace print instruction in the chatcommand callback function, to see whether it gets called and with what arguments.  suspect that you're not getting the player name parameter that you expect
13:45 Zefram_Fysh the example in lua_api.txt shows a chat command for which the player name is an explicit parameter to be entered as part of the command.  yours is trying to use the current player implicitly
13:47 Someguy123 joined #minetest-mods
13:50 Eivel Zefram_Fysh: I checked the name earlier and it correctly is "singleplayer" (I even tried to hardcode it). Also console output at the end is being shown, so the function is correctly called. Did you mean to edit player_set_animation function?
13:51 Zefram_Fysh no, you shouldn't edit player_set_animation
13:51 Zefram_Fysh aha, got it
13:52 Zefram_Fysh the globalstep function that sets the right animation for ordinary actions is very quickly overriding your setting of "sit"
13:52 Zefram_Fysh it affects all players that are not in the default.player_attached table
13:53 Zefram_Fysh you need to copy the line "default.player_attached[name] = true" from the boats code
13:53 Eivel Only this one? I don't have to actually specify what to attach to?
13:53 Zefram_Fysh you'll also need something to unattach the player when you want to stop sitting
13:54 Zefram_Fysh yes, player_attached is only a truth value
13:54 SoniEx2 joined #minetest-mods
13:54 Zefram_Fysh attaching a player to the boat is separate, the set_attach line
13:54 Eivel Oh, I'll use the other command to stand then. I'll try it out, thank you :)
13:55 Zefram_Fysh the player will still be able to move, as if walking, while sitting, unless you do something such as set_attach to prevent it
13:56 Eivel ok
13:58 Eivel It works :D
16:10 LazyJ joined #minetest-mods
18:32 rubenwardy joined #minetest-mods
19:18 rubenwardy joined #minetest-mods
19:18 rubenwardy joined #minetest-mods
19:55 Black_Kot joined #minetest-mods
19:56 Black_Kot left #minetest-mods
20:47 AndrOn joined #minetest-mods
20:48 AndrOn left #minetest-mods
20:49 AndrOn joined #minetest-mods
21:21 Someguy123 joined #minetest-mods

| Channels | #minetest-mods index | Today | | Google Search | Plaintext