As we have several scripts, we need to use link messages
to pass data from one to another. The function llMessageLinked
is used to send a link message from one script to another. When a prim receives a link mesage, every script in that prim will have its link_message
For the purposes of this example, Linknum will be set to LINK_SET
. This means that every link message will be sent to every prim. This example is so small that any performance issues over doing it this way are insignificant.
All our data is going to be packed into the string variable, so num can be redundant. But in this example I'm going to use it as a method of identifiying link messages from YOUR scripts.. This has a couple of advantages.
Ability to mix your scripts with other peoples scripts
No error checking when used with other peoples scripts.
Possible public interface.
To do this, pick a number, call it your Company Channel. Use this value for num in all your link messages. In the link events, always check to see if the company channel is correct. If it is, you know that it is a message from one of your scripts, and the data will be in a expected format. Now, if you swap scripts with someone else doing the same thing with num, your scripts will not clash with each other as they wil have different nums. If you publish your link message formats and company channel, then others can buy your scripts, and use them via the link messages. This allows scripts to act like computer chips from different manufacturers all wired together.
The message containing the information on where to move is going to contain a mixture of data types. More than can be fit into one link message, and containing data types that the link message cannot handle. So we need a method of marshalling the data into a link message.
And there just happens to be a perfect example of how to do this on this wiki, ExampleArgumentMultiplexing
So for a "move to " message, we will probably want to send the following information.
A string contain the message type
A vector containing the target location
A float containing a speed
A float containing a range
Dropping all that in the multiplexing example's code:
integer company_channel = 250;//The channel number your scripts will use
float speed = 2; //How fast the object is to move
vector new_target = <100,23,45>;//Where the object should move to
float range = 0.5;//How near to the target the object should get.
llMessageLinked( LINK_SET, company_channel, llDumpList2String(command, "-=-"), "" );
In a similar way, this is how we get our data out. Note where the company channel is being checked.
This is the method that will be used throughout this example.
to the Create a flying pet home page
to the Script Library
Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah