Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Objects sending data?

Sanity Karuna
Registered User
Join date: 24 Jun 2004
Posts: 20
08-12-2004 21:50
Is it possible for an object to send data like a key or an integer to another object that is not linked?

like if I give the number 521 to a object it can then give it to another object across the room and keep it in the same integer?
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
08-12-2004 22:09
Well, you can do this, sort of.

Why would you not want to store it in a parameter of the same type as the value? Typecasting isnt all that bad :-)

If you really dont want to typecast, you dont have many options. You can send the integer as the parameter of llRezObject if the destination object is rezzed...

However, I think typecasting isnt all that bad, and when you use it, the solution to your problem is a bit more easy to see.

In your "sending" script, simply have:
llSay(1, (string) 512);

In your "recieving" script, simply have:
state_entry() {
llListen(1, "", NULL_KEY, "";);
}

listen(integer channel, string name, key id, string message) {
integer value = (integer) message;
}

With this, your sending script broadcasts the value "512" (512 converted to a string) on channel 1. The recieving script is "listening" on channel 1 (the handle was opened using llListen) and it recieves the sending script's data in its listen() event.

More information on object2object communications, can be found here:
http://www.badgeometry.com/wiki/communications
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
08-13-2004 00:06
For distances further than what llShout can cover, there's llEmail()/email(), but that gets complicated to manage.
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-13-2004 03:14
you can also use prim names for data, so that your prim that needs the data calls llKey2Name and repeatedly polling the prim name but this only works for 1 sim.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey