Page 1 of 1

Selective add/remove tiles

Posted: 05 May 2010, 18:53
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.

Posted: 05 May 2010, 22:39
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?

Posted: 06 May 2010, 08:01
by Bax
I'm sorry, but what you are asking for can't be achieved.

Posted: 13 May 2010, 20:37
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.

Posted: 14 May 2010, 07:15
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.