getTileTriggers()

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

Moderators: Lapo, Bax

Post Reply
DeLo
Posts: 5
Joined: 09 Mar 2011, 13:29
Location: Lithuania

getTileTriggers()

Post by DeLo »

I need to get Trigger objects (and their params) associated with certain Tile.
There's this static method "getTileTriggers" mentioned in docs (http://www.openspace-engine.com/static/ ... index.html), however I haven't found it using the API. Is it implemented?

This is what i'm trying to achieve:

There's an avatarStop trigger added to all the tiles near the doors.
When avatar already stands near the door, and clicks on the skin, representing the door, avatarMove event won't work because I'm already standing on the destination tile.. (i.e I've just entered interior and wanna go outside at once) So, avatarStop trigger on the tile won't be triggered too.
I need to get params, attached to the tile's tiggers, so that client would know what room to load or action to perform after I click the door (skin) while already standing on the tile, which would only trigger avatarStop event.

How do I accomplish that using OpenSpace2 API, when I have the reference to the proper Tile object?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

You can't retrieve the triggers associated with a tile. They are only available in the event parameters.
Anyway when the avatar is created, the ENTER_TILE event is fired, so you might add triggers to that event too.
Paolo Bax
The SmartFoxServer Team
DeLo
Posts: 5
Joined: 09 Mar 2011, 13:29
Location: Lithuania

Post by DeLo »

Thx for the reply.

However, Tile.getTileTriggers would be helpful - would save a bunch of work in the editor so I suggest to implement this read-only feature in future, that just couldn't hurt :)
Post Reply