Turn Tile not Walkable in runtime

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

User avatar
frcol
Posts: 96
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Turn Tile not Walkable in runtime

Postby frcol » 24 Oct 2014, 13:14

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?
Fabio Colombini
Brazil
User avatar
Bax
Site Admin
Posts: 4390
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Turn Tile not Walkable in runtime

Postby Bax » 25 Oct 2014, 13:12

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.
Paolo Bax
The SmartFoxServer Team
User avatar
frcol
Posts: 96
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: Turn Tile not Walkable in runtime

Postby frcol » 25 Oct 2014, 18:16

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
Fabio Colombini
Brazil
User avatar
Bax
Site Admin
Posts: 4390
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Turn Tile not Walkable in runtime

Postby Bax » 27 Oct 2014, 09:35

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.
Paolo Bax
The SmartFoxServer Team
User avatar
frcol
Posts: 96
Joined: 22 Aug 2010, 09:26
Location: Brazil
Contact:

Re: Turn Tile not Walkable in runtime

Postby frcol » 27 Oct 2014, 12:44

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
Fabio Colombini
Brazil
User avatar
Bax
Site Admin
Posts: 4390
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Turn Tile not Walkable in runtime

Postby Bax » 27 Oct 2014, 15:53

Please read the implementation notes in the documentation of the server-side sendAvatarToMap method:
http://openspace-engine.com/static/serv ... atarToMap2
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 2 guests