Jump to content

Estelle Pienaar

Resident
  • Posts

    143
  • Joined

  • Last visited

Reputation

58 Excellent

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello, I have made a user defined function that does not bring the same result as writing the function each time separately in the script. I might have made a mistake but don't see what it could be. The script snippet should cycle through a list by deleting the first value of a list and then adding it to the end of the list. In this example this is done with two separate lists at the same time: list content1 = ["1","2","3","4","5"]; list content2 = ["a","b","c","d","e"]; default { state_entry() { llSetTimerEvent(5); } timer() { //script cycles the first list if(llGetListLength(content1) > 0) { //script saves the first entry of the list string first_entry = llList2String(content1, 0); //script deletes the first entry of the list content1 = llDeleteSubList(content1, 0, 0); //script adds deleted first entry to the end of the list content1 += first_entry; llOwnerSay("Debugging. New list order is: " + llList2CSV(content1)); } //script cycles the the list if(llGetListLength(content1) > 0) { //script saves the first entry of the list string first_entry = llList2String(content2, 0); //script deletes the first entry of the list content2 = llDeleteSubList(content2, 0, 0); //script adds deleted first entry to the end of the list content2 += first_entry; llOwnerSay("Debugging. New list order is: " + llList2CSV(content2)); } } touch_end( integer num_detected ) { llSetTimerEvent(0); } } This snippet works as expected. Then I have made a user defined function but here the script will only delete the first entry of the list and put it at the end of the list at the very first iteration. After that, the list gets "stuck" and is not changed anymore at each timer event. cycleList (list c_list) { if(llGetListLength(c_list) > 0) { string first_entry = llList2String(c_list, 0); c_list = llDeleteSubList(c_list, 0, 0); c_list += first_entry; llOwnerSay("Debugging. New list order is: " + llList2CSV(c_list)); } } list content1 = ["1","2","3","4","5"]; list content2 = ["a","b","c","d","e"]; default { state_entry() { llSetTimerEvent(5); } timer() { //script cycles the first list cycleList (content1); //script cycles the the list cycleList (content2); } touch_end( integer num_detected ) { llSetTimerEvent(0); } } Can anyone spot the mistake, that I am making? I don't get it.
  2. Ok, I found this and it answers the question negatively. I really think that ending an animation while it is playing is ugly and makes the Second Life experience worse. But there is nothing that can be done.
  3. I am planning to script an animation overrider. It would be great to let each animation play exactly as long as it is and not interrupt them after an x amount of time. However I cannot find any way to find out how long an animation is. Neither by script nor by any other means. That is certainly a big oversight by the Lab and the information certainly is available with the saved animation on the servers, but it does not get visible to the users. Or is there a way to make it visible?
  4. Thanks, it works like a charm, once my scripting was correct. 😁
  5. This script will switch on and off a projector. In order for the light to act like projector, the value for PRIM_FULLBRIGHT should be FALSE (unlike with point light): integer isLightTurnedOn; default { state_entry() { llSetPrimitiveParams([ PRIM_PROJECTOR, "TextureName", 3, 10, 0.5 ]); } touch_start(integer total_number) { isLightTurnedOn = !isLightTurnedOn; vector COLOR_White = <1.00, 1.00, 1.00>; if (isLightTurnedOn){ llSetPrimitiveParams([ PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, TRUE, COLOR_White, 1.0, 10.0, 0.6]); } else{ vector COLOR_White = <1.00, 1.00, 1.00>; llSetPrimitiveParams([ PRIM_FULLBRIGHT, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, COLOR_White, 1.0, 10.0, 0.6]); } } }
  6. Thank you for your ideas. I will try and see if I can "switch on" a projector via a script event by first making it a point light and then defining a projector flag in a second step.
  7. I am looking into projectors at the moment and the only LSL command that I can find is llSetPrimitiveParams and the flag [ PRIM_PROJECTOR ]. Unlike the flag [ PRIM_POINT_LIGHT ] the prim_projector flag does not contain a boollean for FALSE or TRUE. Does that mean that there is no way to switch on or off a projector via touch and the only way to change it is by editing the object and do it in the edit window via the features tab? This would be a serious problem IMHO, now that PBR will look more dynamic and interesting by placing more projectors. But maybe I am overlooking something?
  8. Thank you very much for your replies and sorry for my late answer. I was travelling and couldn't come back earlier. Now I am happy to look into it. Yay!
  9. Hello, I cannot find a function call that would change the access list of a parcel. However the existence of this script seems to suggest that it should be possible? Second Life Marketplace - Total Land Access! Prevent people ENTERING your land! My dream would be to script an object that checks if I am home and then restricts access to my parcel but allows access to anyone when I am not in the parcel. Doing this manually is a pain.
  10. Just one update: Everything works find apart from playing animations when getting from the Animation State "Standing" to Animation State "Turning", despite the animation being priority 5 and it being displayed in Animation info. Also I can not reproduce what I said before. It is not working in all viewers, there is no more difference between SL or BD viewer. I think I will open a JIRA.
  11. This is for smiles, not a serious discussion! Who cannot relate?
  12. So after some more testing, my experience has been that it seems to be the contrary. The animations need to be stopped by the script, even if they should continue to run in another state and then be called again. That makes it much more reliable. If I do not stop the previous (same) animation from another animation state, it will often time not play in the new animation state (even if it is a higher priority). Moreover: If I test with the script with llGetAnimationList( key avatar ); , I will get a positive response saying that the animation is still playing, but it is not. One more remark: It is strange, that I can check for playing animations only by their keys while I can start animations only by the string name. Or is there a way to start an animation by its key and not its name? But this question is at this point rather theoretical, since the function llGetAnimationList seems not to be reliable anyway. I have given up on that step. I just stop the old animation and call for it in every animation state update, even if that is quite inefficient. But it works (for about 95% of animation state changes).
  13. I am still playing around and changing the script, but I have not been able to fix this particular part. As soon as I think that the script cannot be changed anymore, I will make a full perm version of script and animations for you available, so that you can test yourself. It is very well possible that the difference stems from the lower threshhold before playing the turn.
×
×
  • Create New...