Tile.walkable is read-only !?

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

Moderators: Lapo, Bax

Post Reply
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Tile.walkable is read-only !?

Post by ffourcad »

While the doc says that the walkable property is read-write, I have a compiler error, when I try to change its value.
Is that a bug ?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

The setter of that property can be accessed by OpenSpace internal classes only. The documentation generator still sees the setter, so it marks the property as read-write, but actually it isn't.
Tile walkability can't be changed at runtime.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Post by ffourcad »

Actually, I wanted to make a tile walkable, as soon as I have picked up the object on it. I want the tile to be unwalkable while an object is on it, and then become walkable as soon, as there is no more object. How can I achieve that ?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

As the item you can remove from the map is a tile itself, if it is non-walkable but the tile below is walkable, when you remove it the avatar will be able to walk on that place.
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Post by ffourcad »

When I said, remove the object, I meant make a removeChild on the Skin object. How can I remove a tile ?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

If you remove a skin manually, then you can't make the tile walkable. Also it would be impossible to persist that map change: on map reload you will still have that skin in that tile.
To remove a tile you have to enter "edit mode" (supposed you are using OpenSpace 2).
Paolo Bax
The SmartFoxServer Team
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Post by ffourcad »

The map is like a game level, so i don't want to permanently remove the object. It's just in the course of the game. It's weird, that I make the object disappear, and then, the avatar still make a "detour" to go to a tile on the other side.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Even if you could change the walkable property, nothing would change, as the OpenSpace extension should re-build the pathfinding nodes to make the avatar able to walk that tile.
I'm sorry but maybe OpenSpace has a different target than the game you are trying to make it fit.
Paolo Bax
The SmartFoxServer Team
laxersaz
Posts: 50
Joined: 30 Nov 2009, 16:19
Contact:

Post by laxersaz »

Isn't there any way at all to alter anything on the map dynamically through api calls (not through manual changes during edit mode) and notify the OpenSpace extension about a map change? I think this is crucial for creating games of virtually any kind.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

laxersaz wrote:Isn't there any way at all to alter anything on the map dynamically through api calls (not through manual changes during edit mode) and notify the OpenSpace extension about a map change? I think this is crucial for creating games of virtually any kind.
OpenSpace was not born to create any kind of game. The scope of this product has always been avatar chats. We are glad developers can find new ways of using it, but of course there are limitations.
Making realtime map changes as you are asking for is not trivial, due to user interaction concurrency problems, server-side performance in continuous pathfinder nodes rebuilding, etc. We will do our best to improve OpenSpace, but this specific request can't be satisfied in the near future.
Paolo Bax
The SmartFoxServer Team
Post Reply