Page 1 of 1

Turn Tile not Walkable in runtime

Posted: 24 Oct 2014, 13:14
by frcol
is there a way to turn a tile not walkable in runtime?

I´m dragging things into the tile and I don´t want the avatar to walk on it. The WALKABLE propertie is just read only.

Any help?

Re: Turn Tile not Walkable in runtime

Posted: 25 Oct 2014, 13:12
by Bax
I suppose you are talking about OpenSpace.
In order to drag items on a map, they must have been created in the Editor using the Inventory Items section.
An inventory item is made of one or more existing tiles: if those tiles have their "walkable" property set to false, when the item will be place on another tile, avatar movement will be prevented.
In other word you don't need to change the floor tile walkability, just configure it on the item being dragged.

Re: Turn Tile not Walkable in runtime

Posted: 25 Oct 2014, 18:16
by frcol
Hi Bax,
And if we want to use a customized inventory?
We created a drag´n´drop item system that doesn´t need to enter in the "Edit mode", we needed it.

Is there a way to tell the tile that it´s not walkable?

[]s

Re: Turn Tile not Walkable in runtime

Posted: 27 Oct 2014, 09:35
by Bax
This is not possible, sorry. The reason is that the "walkability" isn't a client-only property. In fact it affects the pathfinding algorithms, which run on the server side.
The default Edit Mode of OpenSpace collects the changes made to the map by the user and sends them to the server, which in turn updates the map, rebuilds the data structures required by the pathfinder and sends a notification to all the users on that map that a reload is needed.
This is why the walkability can't be changed on the client without entering the Edit Mode.

Re: Turn Tile not Walkable in runtime

Posted: 27 Oct 2014, 12:44
by frcol
Ok, I understood.

So, wich is the best way to create "avatar´s home", as the map is for all users?

I´m creating dynamic roons and setiting the var _os_mapId to load the map, and I would save the itens position out of the map (into the DB) for each avatar.

Could you give me a direction, links to search how is the best way to create "Avatar´s home".

thanks

Re: Turn Tile not Walkable in runtime

Posted: 27 Oct 2014, 15:53
by Bax
Please read the implementation notes in the documentation of the server-side sendAvatarToMap method:
http://openspace-engine.com/static/serv ... atarToMap2