|
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
|
10-11-2006 07:34
ok i have been thru the wiki and just either i am to dumb to know what to look for or it is over my head.
i am making something that will (on a timer) give out a command. (that part i have figured out how to do)
the part i am having trouble with is that i want it to display the numer if times the command has been recieved. let me clarify this a bit more. i know how to get it to display the information i just dont know how to get it to add +1 and then display the new information.
does this make sense.??
|
|
Matt Newchurch
Registered User
Join date: 6 Jan 2006
Posts: 215
|
10-11-2006 07:40
Have a counter variable and add one each time the command is run, then llSay the variable when you want the output.
_____________________
Are you an executive furry, and not a weirdo furry? Join the brand-new "Executive Furries" group!
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
10-11-2006 19:55
integer event_fired;
default { touch_start(integer t) { ++event_fired; llOwnerSay("I have been touched " + (string) event_fired + " times"); } }
http://lslwiki.com/lslwiki/wakka.php?wakka=Unary
|
|
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
|
10-12-2006 05:01
does this remian in memory when deatach and rerezzed. cause that is what ia m looking for. thanks for the help this is what i was looking for.
|
|
Trevor Langdon
Second Life Resident
Join date: 20 Oct 2004
Posts: 149
|
10-12-2006 08:00
Bizcut--
As long as the above script is not Reset within the object, it will retain the counter value across detach/re-attach and/or Rez/Take/Take Copy actions.
A script Reset would re-initialize the "event_fired" value back to 0.
So, as long as you do not Reset the script, it should do just what you want.
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
10-12-2006 10:29
From: Bizcut Vanbrugh does this remian in memory when deatach and rerezzed. cause that is what ia m looking for. thanks for the help this is what i was looking for. Are you making an attachment? If I remember correctly, attachment states are not always saved as expected when detaching. My experiences with this are confusing and inconclusive.
|
|
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
|
10-12-2006 18:45
well yes it is going to be an attachment and so far is working nicely. i am using it for a dwell meter in my sim. a shouter give the event_fired command and ups the counter by 1. so it is going to be very useful. i did have a time (because i am not a real scripter) getting the shouter to communicate with the reciver. but that is all worked out and i only have a few items to add to it and some formatting to make it look better. i thank you all for your help.
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
10-12-2006 20:39
From: Llauren Mandelbrot Are you making an attachment? If I remember correctly, attachment states are not always saved as expected when detaching. My experiences with this are confusing and inconclusive. ive had this happen when dealing with states (states in lsl not memory snapshot type states) like when a state changes from default to state two right at detach memory should keep just fine on a detach ... altho im not saying its gonna be 100%, 100% of the time, you never really know what funky goodness the SL servers could come up with if you need failsafe small data storage inworld theres a long list of ll functions that effectivly punch in numbers, things like the discription feild of an object can be set via script, in the discription feild you have upto 127 (?) charaters, or maby like texture rotation which gives you a integer range tween -180 and 180 ...
|