Selective add/remove tiles

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

Moderators: Lapo, Bax

Post Reply
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Selective add/remove tiles

Post by warhell »

Hi, I have a specific functionality that I'm having trouble implementing...

For my app, I have created my own custom add/remove function which basically dispatches mouse events to simulate removing/adding tiles. This allows me to remove tiles via function calls on the client side (I implemented these functions because this cannot be accomplish with the current Openspace Client API).

I have a scenario were I would like to be able to remove non-editable tiles via code (dispatching mouse events).
The reason for this is that I don't want the user to be able to remove specific tiles (a wall tile for example), but I (the client code) would like to be able to do this.

Basically, we have an app that contains walls (that the user cannot remove), and the user is able to place down doors. As soon as the user places down a door in front of a wall, the wall must be removed.
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Post by warhell »

After looking at a tile object through the debugger I notice that it has a mouseSensorActive variable, is it possible to change this at run-time on the client?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

I'm sorry, but what you are asking for can't be achieved.
Paolo Bax
The SmartFoxServer Team
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Post by warhell »

bax wrote:I'm sorry, but what you are asking for can't be achieved.
So is there any sort of validate function (similar for placing inventory items) that allows you to specify which inventory items can be moved and which inventory items cannot? I would like something like this in order to change which inventory items are editable (in the map) and not editable at run-time.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

When you create a map in the Editor, if you do not set the inventory id on a tile/supertile instance, that instance won't be removable.
Paolo Bax
The SmartFoxServer Team
Post Reply