MMORoom: Send Message from server to users in MMOItem AOI

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Tenzoru
Posts: 4
Joined: 02 Sep 2021, 09:00

MMORoom: Send Message from server to users in MMOItem AOI

Postby Tenzoru » 02 Sep 2021, 09:12

Hello everyone.

I have a MMORoom with MMOItems (which are enemies in my game).
I send updates of the enemy movements to clients using MMOApi.setMMOItemVariables

However, I'd like to know what would be the best way of telling the clients that an enemy is attacking or doing certain actions.

Is it the best way to retrieve the users of the enemy (MMOItem) AOI using getProximityList(), and then sending each of those users a message from the server?

If so, how could I do that? How can I send a message from the server to a list of users?

Thanks in advance!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MMORoom: Send Message from server to users in MMOItem AOI

Postby Lapo » 03 Sep 2021, 14:28

Hi,
you could use the ItemVariables themselves, and setting one (or more) attribute that tells the client that this particular foe is attacking.

When you receive the VariableUpdate on the client side you can always check what are the variables that were changed in this particular update, so if the "attack" variable was changed you know the enemy is shooting or throwing stones or whatever :)

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 66 guests