Time Nick Message 11:12 kilbith is there any way to get a ServerActiveObject starting from a ISceneNode? 11:31 celeron55 no because ISceneNode is a client-side thing and ServerActiveObject is a server-side thing 11:33 kilbith I know but I imagined that we could get an ID from ISceneNode and use it from ServerActiveObject 11:34 kilbith or there's another way? 11:55 kilbith something like: get the ISceneNode's ID -> get an ActiveObject from the server environment 11:55 kilbith or there's no relationship at all possible? 12:58 kilbith success: http://codepad.org/9ADd1x70 12:59 kilbith `cam->getSelectedNodeID()` is the ISceneNode's ID 13:07 kilbith looks like I've been lucky and getActiveObject actually expects a peer's ID 13:32 kilbith Krock: you did talk about shared IDs between client/server, can you tell me more? 13:54 Krock kilbith: the server has to update the CAO's position somehow, right? so there's an ID that must match 13:56 Krock ClientEnvironment::addActiveObject is what you need to check. there's an "id" parameter which originates from the server 13:57 kilbith so I've got this: https://www.youtube.com/watch?v=DsGd1X9RlOE 13:57 Krock however, the smoke puff is a bit special. it doesn't have a server ID 13:57 kilbith the scene node (= the player) is picked through a raycast made up from the screen coordinates of a mouse click (note: irrlicht modification necessary) 13:57 Krock what if it's a touch screen? they could point anywhere 13:57 kilbith so basically (in gaming terms) you can left-click a player to select it, right-click to select a position on the map and the player would move to this target (exactly like in a RTS game) 13:58 kilbith I'm not handling touch screen (and won't) 13:58 rubenwardy Touchscreen fakes a mouse click 13:58 Krock rubenwardy: but I believe the selection raycast differs 13:59 rubenwardy By faking a mouse click 13:59 rubenwardy Basically, it sets the position to where the user taps and emits an event 13:59 Krock oh right. the desktop cursor is centered too, so that's at least consistent 13:59 rubenwardy The selection raycast differs because the "mouse" position isn't necessarily centered 14:00 rubenwardy Also, remember that we support touchscreen on desktop too 14:01 rubenwardy Not that you'd want to use it 14:01 rubenwardy Also, I imagine with a camera API you might allow unlocking the mouse on desktop too 14:19 kilbith Krock: I'm thinking of another way around 14:19 kilbith https://github.com/minetest/minetest/blob/master/src/client/content_cao.cpp#L769 14:19 kilbith all CAO are init with an of -1 (the third param (the ID) is always ignored) 14:20 kilbith * with an ID of -1 14:20 kilbith so the idea is to add a 3rd param with the peer_id 14:20 kilbith so I can get a peer ID from any ISceneNode 14:27 kilbith do note that the raycast only can get a ISceneNode since it's in irrlicht 14:57 kilbith so the 3rd param is actually `m_id` and it does work 17:16 celeron55 https://github.com/minetest/minetest/pull/12690 17:16 celeron55 i'd like someone to test and confirm that this performs reasonably now 17:17 celeron55 i'll clean it up a bit once it does