MMOItem Room Triggers?

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Ninjaoninja2
Posts: 204
Joined: 22 Sep 2013, 23:33

MMOItem Room Triggers?

Postby Ninjaoninja2 » 26 Mar 2016, 11:53

[quote="Ninjaoninja2"]Hi there,
So I was wondering how to go about making an MMOItem trigger a room change, for instance you click a door and then you walk into a new room environment, and I was reading in to this and I saw that the USER_ENTER or USER_EXIT functions do not work in MMORooms, so I'm completely clueless how this could ever work, do you mind at least pointing me on the right direction, I could figure it out from there if I get a taste of how you guys would set this up.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MMOItem Room Triggers?

Postby Lapo » 26 Mar 2016, 16:31

Hi,
let's start from the two events you have mentioned: USER_ENTER and USER_EXIT.
In an MMORoom we don't need to know about every player entering or leaving the place, in fact many players could be physically too far away from us (i.e. outside the AoI) that we don't need the notification.

Instead the PROXIMITY_UPDATE event substitutes those two and provides information about changes within our AOI.

As regards using the MMOItem as a trigger this should be pretty simple. At any time you know what items are within your AOI so you can handle a collision (or any other form of interaction) and send a request to be "teleported" somewhere else (i.e. join another Room)

In other words: your client knows the list of MMOItems around you, so you can render them appropriately (e.g. as doors, buttons, levers etc...)
Then you handle such interaction / click / collision and decide what you want to do.

Also each MMOItem carries its own data (MMOItemVariables) so they can be customized to indicate the room to join or whatever other information is needed.

Makes sense?
Lapo
--
gotoAndPlay()
...addicted to flash games
Ninjaoninja2
Posts: 204
Joined: 22 Sep 2013, 23:33

Re: MMOItem Room Triggers?

Postby Ninjaoninja2 » 21 Apr 2016, 16:47

Lapo wrote:Hi,
let's start from the two events you have mentioned: USER_ENTER and USER_EXIT.
In an MMORoom we don't need to know about every player entering or leaving the place, in fact many players could be physically too far away from us (i.e. outside the AoI) that we don't need the notification.

Instead the PROXIMITY_UPDATE event substitutes those two and provides information about changes within our AOI.

As regards using the MMOItem as a trigger this should be pretty simple. At any time you know what items are within your AOI so you can handle a collision (or any other form of interaction) and send a request to be "teleported" somewhere else (i.e. join another Room)

In other words: your client knows the list of MMOItems around you, so you can render them appropriately (e.g. as doors, buttons, levers etc...)
Then you handle such interaction / click / collision and decide what you want to do.

Also each MMOItem carries its own data (MMOItemVariables) so they can be customized to indicate the room to join or whatever other information is needed.

Makes sense?

Yes, thanks Lapo

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 46 guests