Newbie on a mission!
|
|
Beedge Stratten
Registered User
Join date: 20 Jan 2009
Posts: 7
|
02-05-2009 03:58
Hi all,
I am a web developer that has been asked to develop an application that interacts with second life. My expertise (such as it is!) lies in PHP / MySQL / Javascript / CSS.
For the purposes of this project I am learning Linden script. But, I have a very tight deadline, so I plan to try and utilise as many resources as are available to me!
Firstly, is this the best place to ask for scripting/programming help or are the other dedicated forums?
Thanks in advance,
Beedge
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
02-05-2009 04:33
This is a good place for getting help on scripting with LSL. You can also checkout the LSL wiki for more info: http://www.lslwiki.netIntegrating between LSL and external web-systems is fairly straightforward. Commonly you use the LSL function "llHTTPRequest" to request a page from an external system, using HTTP parameters (GET or POST) to send data, and receiving data back in the response. It's quite limited in terms of data capacity though... you have to work small! You can also send/receive email using LSL, receive XMLRPCs, and (hopefully) soon you'll be able to setup a mini-webserver in LSL as well. (That last one is apparently still in beta... not sure when it's going live on the main grid.)
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
02-05-2009 05:05
Please note, however, if your goal is to get/hire someone to do the scripts for you, you're best off posting in the "Products Wanted" forum.
This forum tends to be for "what am I doing wrong?" type questions.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Beedge Stratten
Registered User
Join date: 20 Jan 2009
Posts: 7
|
02-05-2009 07:53
nope, plan to do it all myself.. but will need a place to ask silly questions
have already gotten an object to talk to an external php script so pretty happy that Ill get that working
first silly question: whats the function for giving someone a notecard?
Thanks
Beedge
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
02-05-2009 08:30
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
|
02-05-2009 08:50
/me wonders if Beedge has come across lsleditor yet: http://www.lsleditor.org/(LSL IDE) .
|
|
Beedge Stratten
Registered User
Join date: 20 Jan 2009
Posts: 7
|
02-05-2009 09:06
Thanks for that, I got it working fine, and beedge most certainly had not come across lsleditor.. thanks!!  Beedge
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
02-05-2009 09:12
Depending on what exactly you're doing, the new webserver-on-a-prim stuff may (or may not) be interesting to you. It's only on the beta grid for now.. See http://jira.secondlife.com/browse/SVC-1086 .
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Beedge Stratten
Registered User
Join date: 20 Jan 2009
Posts: 7
|
02-05-2009 12:23
Ok next question
I want my Object to get details of the user interacting with it:
name, age and key.
and I could do a key2name() I think, but whats the quickest way to get the age of a user (BTW, whats the correct term for someone in Second Life? is user right?).
I have come across llRequestAgentData( key id, integer data ); but I dont want to have to wait for dataserver event.
is there a neat and quick way of doing what I want?
apologise if my questions are a bit ,uhm, silly but as I said before, this is all new to me!
Thanks,
Beedge
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
02-05-2009 13:14
Nope, no other way to get the Born on date, I assume that is what you mean by age. As for name and key, llDetect functions are great for that, if in the right event.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
02-05-2009 17:30
"Users" are the people behind (in front of? whatever) the computer screens. "Residents" are the accounts they use to access Second Life. "Avatars" are the things in-world that (usually) have hair and arms and legs and stuff. "Agents" (which you'll sometimes find reference to in the LSL wikis and function names and such) supposedly have to do with everything related to the resident's presence that does not deal with the visual or physical representation (the avatar). However, in reality (even in the LSL API) "agent" and "avatar" are used pretty interchangeably in scripting materials, and "agent" is almost never used in other places. People in practice also often use "resident" and "avatar" pretty interchangeably, though in scripting-oriented discussions we'll often deal with the "avatar" as a mere object/prim/whatever, so we more often make the distinction than others do I think. Also in practice, we almost never refer to "users" unless we are talking about the security context in which people using alternate accounts to avoid being banned from the grid or from a particular location. So usually we refer to "residents" rather than "users". In summary, use "resident" most of the time, and use "avatar" when you're talking about the size, position, and appearance of the thing you see, and you should be fine. That's my understanding anyway. 
|
|
Beedge Stratten
Registered User
Join date: 20 Jan 2009
Posts: 7
|
02-06-2009 03:34
From: Hewee Zetkin "Users" are the people behind (in front of? whatever) the computer screens. "Residents" are the accounts they use to access Second Life. "Avatars" are the things in-world that (usually) have hair and arms and legs and stuff. "Agents" (which you'll sometimes find reference to in the LSL wikis and function names and such) supposedly have to do with everything related to the resident's presence that does not deal with the visual or physical representation (the avatar). However, in reality (even in the LSL API) "agent" and "avatar" are used pretty interchangeably in scripting materials, and "agent" is almost never used in other places. People in practice also often use "resident" and "avatar" pretty interchangeably, though in scripting-oriented discussions we'll often deal with the "avatar" as a mere object/prim/whatever, so we more often make the distinction than others do I think. Also in practice, we almost never refer to "users" unless we are talking about the security context in which people using alternate accounts to avoid being banned from the grid or from a particular location. So usually we refer to "residents" rather than "users". In summary, use "resident" most of the time, and use "avatar" when you're talking about the size, position, and appearance of the thing you see, and you should be fine. That's my understanding anyway.  Thank you very much! very informative!  now next question.. llDetectedKey(0); <- if I have an object with this in a script in touch start. Does it return the key of last resident to touch the object?
|
|
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
|
02-06-2009 05:02
That depends on how you define last.
If only one person touched it then yes it returns the key of that person, If more than one person touched it at the same time it returns the key of the person that touched it first (not sure that makes sense). The wiki probably explains it better or someone more articulate than me will be along soon
For most practical purposes it will detect the key of the person that last touched it (assuming they havent left the sim before you try to detect it)
To be totaly foolproof you need to iterate between 0 and the num_detected parameter from the touch event. However the odds of more than one touch at the same time are small.
|
|
Beedge Stratten
Registered User
Join date: 20 Jan 2009
Posts: 7
|
02-06-2009 05:42
so if I understand you correctly,
(0) is the first person to touch it (unless they have left teh sim) (1) would be the second person and so on?
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
02-06-2009 05:54
Think of the Avatar as a marionette puppet, and the "Agent" as an invisible prim that all the strings attach to.
The avatar is phantom, the agent is not.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
|
02-06-2009 06:28
From: Beedge Stratten so if I understand you correctly,
(0) is the first person to touch it (unless they have left teh sim) (1) would be the second person and so on? Correct but, (how do i explain it) if three people touch it at the same tim, then 0 is first 1 is second 2 is third. However if someone touches it after that the history is lost and they are 0
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
02-06-2009 06:39
From: Beedge Stratten so if I understand you correctly,
(0) is the first person to touch it (unless they have left teh sim) (1) would be the second person and so on? If more touches in the same touch event you can't relay on them coming in order. Consider them coming 'at the same time'
_____________________
From Studio Dora
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
02-06-2009 09:05
From: Dora Gustafson If more touches in the same touch event you can't relay on them coming in order. Consider them coming 'at the same time' Right. And really they could have happened at somewhat different times, especially if you have increased the minimum time between events using llMinEventDelay() or you are using functions which impose significant script delay. Any touch events that pile up in the queue before an actual event handler can be fired will come in on the same event. Including multiple touches from the same resident, so it is quite possible to miss touches if someone's getting impatient for the script to respond and clicking away. I believe the same is true for all touch, collision, and maybe llSensor()/llSensorRepeat() as well. See http://www.lslwiki.net/lslwiki/wakka.php?wakka=llMinEventDelay
|
|
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
|
02-23-2009 22:58
From: Beverly Ultsch Correct but, (how do i explain it) if three people touch it at the same tim, then 0 is first 1 is second 2 is third.
However if someone touches it after that the history is lost and they are 0 If your object need to respond just with first avatar , just make a jump to another state on the same script and then compare the first avatar key ( ina diferent state already) with th second avatar key, and give some message like " sorry but im in use by Xxxxx Xxxx rigth now please try again later" And when the first user finish the transaction come back to the state where another avatar can use the object( i use that option on my ATM) So in this way your ATM allways is working listening or what ever with the first toucher.
|
|
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
|
02-26-2009 04:39
really, though, you want to get that agent's data right then, when they touch it..no need in this instance to go back later and try to get it from the touch history. You can get age info with an http call, check out Jana Kamachi's snippet at http://wiki.secondlife.com/wiki/User:Jana_Kamachi/Profile. That same snippet of code will show how to gather information from the profile of the toucher agent, including the "Born on" date.
|