Difference between revisions of "Link message/it"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{LSL_Event|event_id=29|event_delay|event=link_message |p1_type=integer|p1_name=sender_num|p1_desc=The link number of the prim that contained the script that called [[llMessageLi…")
 
(Undo revision 1161421 by Violet Hammerer (Talk))
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{LSL_Event|event_id=29|event_delay|event=link_message
{{LSL_Event|event_id=29|event_delay|event=link_message
|p1_type=integer|p1_name=sender_num|p1_desc=The link number of the prim that contained the script that called [[llMessageLinked]].
|p1_type=integer|p1_name=sender_num|p1_desc=Il numero di collegamento del prim che contiene lo script che ha chiamato [[llMessageLinked]].
|p2_type=integer|p2_name=num|p2_desc=Second parameter of the llMessageLinked call.
|p2_type=integer|p2_name=num|p2_desc=Secondo parametro della chiamata llMessageLinked.
|p3_type=string|p3_name=str|p3_desc=Third parameter of the llMessageLinked call.
|p3_type=string|p3_name=str|p3_desc=Terzo parametro della chiamata llMessageLinked.
|p4_type=key|p4_name=id|p4_desc=Fourth parameter of the llMessageLinked call.
|p4_type=key|p4_name=id|p4_desc=Quarto parametro della chiamata llMessageLinked.
|event_desc=Triggered when the script receives a link message that was sent by a call to [[llMessageLinked]]. llMessageLinked is used to send messages from one script to another.
|event_desc=Lanciato quando lo script riceva un messaggio collegato che è stato mandato da una chiamata a [[llMessageLinked]]. llMessageLinked viene usato per inviare messaggi da uno script a un altro.
|event_footnote='''id''' is often used as a second string field (in LSL the [[key]] type is implemented as a [[string]] with just custom operators). [[typecast|Typecasting]] between [[string]] and [[key]] types has no effect on the data contained. The sizes of '''str''' and '''id''' are only limited by available script memory.
|event_footnote='''id''' viene usato spesso come secondo campo stringa (in LSL il tipo [[key]] è implementato come una [[string]] con operatori personalizzati). [[typecast|La trasformazione]] tra i tipi [[string]] e [[key]] non ha effetti sui dati in essi contenuti. Le dimensioni di '''str''' e '''id''' sono limitate solamente dalla memoria script disponibile.
|constants
|constants
|spec
|spec
|caveats=*64 link_message events can queue, past that, they are silently dropped! Don't do too much in the event if they might be coming in fast.
|caveats=*Si possono accodare 64 eventi link_message, superati i quali, vengono scartati silenziosamente! Non fate troppe cose nell'evento se questi potrebbero arrivare velocemente.
*'''sender_num''' does not reflect how a message was sent, there is no way to know if it was sent with a LINK_* flag or the [[llGetLinkNumber|specific link number]].
*'''sender_num''' non rispecchia il modo in cui è stato mandato un messaggio, non c'è modo di sapere se è stato inviato col flag LINK_* o il [[llGetLinkNumber|numero specifico di collegamento]].
*If '''str''' and '''id''' are bigger than available memory the script will crash with a Stack-Heap Collision.
*Se '''str''' e '''id''' sono più grandi della memoria disponibile, lo script crasherà silenziosamente con una Collisione Stack-Heap.
|examples=
|examples=
<lsl>
<lsl>
//This is just an example script, you shouldn't handle touches within single script this way.
// Questo è solo uno script di esempio, non dovreste gestire il tocco in questo modo all'interno di un unico script.


default
default
Line 23: Line 23:
     link_message(integer source, integer num, string str, key id)
     link_message(integer source, integer num, string str, key id)
     {
     {
         llWhisper(0, str + " (" + (string)id + ") touched me!");
         llWhisper(0, str + " (" + (string)id + ") mi ha toccato!");
     }
     }
}
}
Line 29: Line 29:
|helpers=
|helpers=
<lsl>
<lsl>
// This is just an example script, you shouldn't handle link message within single script this way.
// Questo è solo uno script di esempio, non dovreste gestire i messaggi collegati in questo modo all'interno di un unico script.


default
default
{       // To propagate an unlimited number of arguments of any type.
{  
// Presumed, the separator string isn't used in any source string!
    // Per diffondere un numero illimitato di argomenti di qualsiasi tipo.
    // Presupposto, la stringa separatrice non viene utilizzata in nessuna stringa sorgente!
     state_entry()  
     state_entry()  
     {  
     {
         list my_list = [1, 2.0, "a string", <1, 2, 3>, <1, 2, 3, 4>, llGetOwner()];   
         list mia_lista = [1, 2.0, "una stringa", <1, 2, 3>, <1, 2, 3, 4>, llGetOwner()];   
         string list_parameter = llDumpList2String(my_list, "|"); // Typecast list to a string
         string parametro_lista = llDumpList2String(mia_lista, "|"); // Converte la lista in una stringa
         llMessageLinked(LINK_THIS, 0, list_parameter, NULL_KEY)
         llMessageLinked(LINK_THIS, 0, parametro_lista, "")
     }
     }
 
     link_message(integer sender_num, integer num, string list_argument, key id)  
     link_message(integer sender_num, integer num, string list_argument, key id)  
     {
     {
         list re_list = llParseString2List(list_argument, ["|"], [""]); // Typecast string back to a list
         list ri_elenca = llParseString2List(parametro_lista, ["|"], []); // elabora nuovamente la stringa in una lista
     }  
     }
}
}
</lsl>
</lsl>
|also_header
|also_header
|also_events
|also_events
|also_functions={{LSL DefineRow||[[llMessageLinked]]}}
|also_functions={{LSL DefineRow||[[llMessageLinked/it]]}}
|also_articles
|also_articles
|also_footer
|also_footer
|notes=A script can hear its own link messages.
|notes=Uno script può ascoltare i propri messaggi.
|mode
|mode
|cat1=Link
|cat1=Link

Latest revision as of 10:57, 16 August 2012

Description

Event: link_message( integer sender_num, integer num, string str, key id ){ ; }

Lanciato quando lo script riceva un messaggio collegato che è stato mandato da una chiamata a llMessageLinked. llMessageLinked viene usato per inviare messaggi da uno script a un altro.

• integer sender_num Il numero di collegamento del prim che contiene lo script che ha chiamato llMessageLinked.
• integer num Secondo parametro della chiamata llMessageLinked.
• string str Terzo parametro della chiamata llMessageLinked.
• key id Quarto parametro della chiamata llMessageLinked.

id viene usato spesso come secondo campo stringa (in LSL il tipo key è implementato come una string con operatori personalizzati). La trasformazione tra i tipi string e key non ha effetti sui dati in essi contenuti. Le dimensioni di str e id sono limitate solamente dalla memoria script disponibile.

Caveats

  • Si possono accodare 64 eventi link_message, superati i quali, vengono scartati silenziosamente! Non fate troppe cose nell'evento se questi potrebbero arrivare velocemente.
  • sender_num non rispecchia il modo in cui è stato mandato un messaggio, non c'è modo di sapere se è stato inviato col flag LINK_* o il numero specifico di collegamento.
  • Se str e id sono più grandi della memoria disponibile, lo script crasherà silenziosamente con una Collisione Stack-Heap.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> // Questo è solo uno script di esempio, non dovreste gestire il tocco in questo modo all'interno di un unico script.

default {

   touch_start(integer c)
   {
       llMessageLinked(LINK_THIS, 0, llDetectedName(0), llDetectedKey(0));
   }
   link_message(integer source, integer num, string str, key id)
   {
       llWhisper(0, str + " (" + (string)id + ") mi ha toccato!");
   }

} </lsl>

Useful Snippets

<lsl> // Questo è solo uno script di esempio, non dovreste gestire i messaggi collegati in questo modo all'interno di un unico script.

default {

   // Per diffondere un numero illimitato di argomenti di qualsiasi tipo.
   // Presupposto, la stringa separatrice non viene utilizzata in nessuna stringa sorgente!
   state_entry() 
   {
       list mia_lista = [1, 2.0, "una stringa", <1, 2, 3>, <1, 2, 3, 4>, llGetOwner()];  
       string parametro_lista = llDumpList2String(mia_lista, "

Notes

Uno script può ascoltare i propri messaggi.

See Also

Functions

•  llMessageLinked/it

Deep Notes

Signature

event void link_message( integer sender_num, integer num, string str, key id );