Jump to content

Script intercomunication without "listtening"


BuriedRabbit
 Share

You are about to reply to a thread that has been inactive for 1161 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I wish to know if it's possible to do the next scenenario:

  • I have an object attatched on myself with a script with the click event, and a variable that counts the "clicked_times" count.
  • I have a script at another avatar who clicks me with the variable "clicker_times".

What I wish to do, is to increase the variable "clicker_times" on the Avatar who made the click on me, and also the "clicked_times" on me by knowing the variables and script names that I create on the two avatars.

Link to comment
Share on other sites

9 minutes ago, BuriedRabbit said:

I fear that somebody captures the communication to hack the minigame that I wish to do.

Is it possible to comunicate two scripts on the same avatar to change the value of a variable on the other script?

You can send a message using llRegionSayTo, which will takes the key of the target to receive the message. If the target is an avatar, only the avatar's attachments can hear the message. If the target is a single attachment on an avatar, only that attachment will hear the message.

Your minigame can start by sending a message to the avatar, and then the script that belongs to your game would respond to it, making the other script aware of its key. The two scripts would record each other's keys and use llRegionSayTo to communicate privately, in a way that no other objects can listen.

But be aware that the object keys change every time they rez/attach.

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

12 hours ago, Qie Niangao said:

Just checking: This game will all be within a region, right? (If not, there are other possible approaches, but they're way more complicated.)

I thought to do it avaiable for everywhere.

The players should know if the sim where they play accepts it or not.

Link to comment
Share on other sites

Sorry, I think I asked the wrong question. If players will only compete/interact with others in the same region, then the simple listen / llRegionSayTo approach is fine, even if there are lots of separate games going on in many different regions. The potential issue I meant to ask about only arises if players interact with others in other regions, requiring the communications to span sims. (In that case, instead of listen/say we'd use http or Experience "key-value pair" or a combination, depending on whether all locations could enable the same land-scope Experience, or the availability of an http server either off-grid or at a dynamically resolvable in-world address. It gets a little hairy.)

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1161 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...