Jump to content

Ruthven Willenov

Resident
  • Content Count

    434
  • Joined

  • Last visited

Community Reputation

95 Excellent

1 Follower

About Ruthven Willenov

  • Rank
    Advanced Member

Recent Profile Visitors

841 profile views
  1. Ruthven Willenov

    Touch start/end Animation Error Message?

    i typically try not to just give a complete script in the forums unless it's a modification of the OP script, but this seemed like a simple enough one. Just drop this into an object you wear that you want others to click. Drop in the animation you want to use, and type in the name at the top of the script. Pick it up and attach it. integer toggle; string animation = "";//add animation name default { attach(key id) { if(id) { llRequestPermissions(id,PERMISSION_TRIGGER_ANIMATION); } else { if(llGetPermissionsKey()) { toggle = 0; llStopAnimation(animation);//stops the animation if you detach the object } } } run_time_permissions(integer perms) { if(perms & PERMISSION_TRIGGER_ANIMATION) { llSetText("Touch me to make me animate",<0.0,0.0,1.0>,1.0); } } touch_start(integer total_number) { toggle = !toggle; if(toggle) { llStartAnimation(animation); llSetText("Touch me to stop animation",<0.0,0.0,1.0>,1.0); } else { llStopAnimation(animation); llSetText("Touch me to make me animate",<0.0,0.0,1.0>,1.0); } } }
  2. Ruthven Willenov

    Texture off set based on percentage?

    Like so? (edited above)
  3. Ruthven Willenov

    Texture off set based on percentage?

    good, you have the half texture already. There's a little math involved. If the split in the texture is vertical, you'll want to scale and offset the texture horizontally, and if the split is horizontal..... so the scale would just be half the offset would be the percentage as a decimal, divided in half, then subtract 0.25. here's an example script using a black/white texture with the split being vertical. You could use the same texture on either side and change the color accordingly as well as flip the texture by giving it a negative scale integer health = 100; default { touch(integer total_number) { if(health > 0) health--; float healthperc = (float)health/100.0; float offset = (healthperc*.5)-0.25; llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE,0,"blackwhitehalf",<-0.5,1.0,0.0>,<offset,0.0,0.0>,0.0, PRIM_TEXT,(string)((integer)(healthperc*100))+"%",<0.0,1.0,0.0>,1.0]); } }
  4. Ruthven Willenov

    Tossing attached ball : Script :

    This is because you're requesting permission to animate in the same function as the ball moving. The animation doesn't get triggered until the permissions event is triggered, but it can't do that until your function is finished.... You only need to request permissions once, then in your function, you can start the animation before moving the ball. Try this, i cleaned up your script a bit. If you still need a little more time before the ball moves after starting the animation, you'll need to put a sleep after triggering the animation myFunction() { llStartAnimation("backflip");//start the animation before starting the ball moving integer x = 0; for (x = 0; x <= 10; x++) //this loop moves the ball up { llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + < 0, 0.0, 0.05 > ]); //put command to increment prim's local position here llSleep(0.1); //put command for 0.1 sleep here } for (x = 0; x <= 10; x++) //this loop moves the ball down { llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_POS_LOCAL, llGetLocalPos() + < 0, 0.0, -0.05 > ]); //put command to decrement prim's local position here llSleep(0.1); //put command for 0.1 sleep here } } default { on_rez(integer rez_param) { if(llGetAttached())//checks to see if it's attached instead of being rezzed onto ground { llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION); } else//if not attached, timer is turned off so the ball doesn't move { llSetTimerEvent(0); } } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { llSetTimerEvent(3);//after we've got permission to play the animation, let's start the timer so the ball can bounce } } timer() { myFunction(); } }
  5. Ruthven Willenov

    Tossing attached ball : Script :

    basically the same thing as above, but done with 1 loop vector start; bounceball() { integer x; for(x = -10; x < 10; x++) { vector pos = start + <0,0,0.05*(llFabs(x)-10)>; llSay(0,(string)pos); llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POS_LOCAL,pos]); llSleep(0.1); } llSetPos(start); } integer onoff; default { state_entry() { start = llGetLocalPos(); } timer() { bounceball(); } touch_start(integer total_number) { llSay(0,"boing"); llSetTimerEvent(10*(onoff = !onoff)); if(onoff)bounceball(); } }
  6. Ruthven Willenov

    HUD bug?

    You may try making some other change to the prim, even one that wouldn't really be visible, such as adding and removing hover text in the same sequence in when it should move. That usually forces the viewer to redraw the prim and in which case it will move on the screen as desired
  7. Ruthven Willenov

    Initiating Scripts & Reading Group Profile Members - Advice?

    it will unsit them, and typically the furniture won't respond to them when they're no longer sitting on it
  8. Ruthven Willenov

    Initiating Scripts & Reading Group Profile Members - Advice?

    Certainly, that would be an easy enough script, here's a starting point (not tested) list whitelist = ["name 1"];//add the names of the people you want to allow, case sensitive default { changed(integer change) { if(change & CHANGED_LINK) { key id = llAvatarOnSitTarget(); if(id) { name = llKey2Name(id); integer index = llListFindList(whitelist,[name]); if(index == -1 && id != llGetOwner()) { llUnSit(id); } } } } }
  9. Ruthven Willenov

    quiz using random notecards

    I would start with the formatting of the card, for example: would become This way the question and answer key is always an even number line, separated by the pipe character, and the answers are always on an odd numbered line, separated by the pipe character then for the list of line numbers, first check the number of lines in the card, then build a list of line numbers, then randomize it: (typed up in the forum text box, not tested) integer numlines;//using llGetNumberOfNotecardLines //then build the list list linenumbers = []; buildlist() { integer i; for( i = 0; i < numlines; i+=2) { linenumbers += [i]; } linenumbers = llListRandomize(linenumbers,1); }
  10. Ruthven Willenov

    door/key script

    And I suppose you could also add the creator's key to the code, because even if you were to manage to find an object with the exact same creation time, it would be impossible to have the same creator
  11. Ruthven Willenov

    door/key script

    Here's a method using the creation time of the object. The key can't be cheated, and the worn object won't need to have a script in it for the door to check it. This snippet can be used in any script that will detect an avatar (touch, collision, sensor) in order to check they are wearing the key rez/create the key object you want to use, and paste this script into it. default { state_entry() { list details = llGetObjectDetails(llGetKey(),[OBJECT_CREATION_TIME]); llOwnerSay(llList2CSV(details)); llOwnerSay("Paste the above string into the door script where appropriate"); llRemoveInventory(llGetScriptName()); } } the "key" object will spit out a creation time string. then in the door script, to authenticate paste the above string where it says keycode string keycode = "PASTE KEY CREATION TIME HERE"; integer checkforkey(key id) { list attachments = llGetAttachedList(id);//gets the list of attachments the avatar is holding integer len = llGetListLength(attachments); integer i; for(i = 0; i < len; i++)//checks each attachment one by one and compares their creation time to the one pasted above { key attachment = llList2String(attachments,i); list details = llGetObjectDetails(attachment,[OBJECT_CREATION_TIME]); string time = llList2String(details,0); if(time == keycode)return TRUE; } return FALSE; } default { touch_start(integer total_number) { key id = llDetectedKey(0); string name = llGetDisplayName(id); integer haskey = checkforkey(id); if(haskey) { llSay(0,"Welcome " + name + "!"); //do door opening stuff } else { llSay(0, "Sorry " + name + ", but you need to holding (wearing) the key to open this door"); } } }
  12. Ruthven Willenov

    Derezz if avatar rezzes and Give Object If Object Rezzes

    Solution 1: use a non-zero integer in the last param of the rez command. The reason is, when an avatar rezzes an object, the on_rez event only receives a zero as the rezparam In rezzer script: llRezObject("object name",pos,velocity,rotation,a non zero integer); in the object being rezzed: on_rez(integer rezparam) { if(rezparam)//will test true if it's non-zero { //give contents or whatever } else//was rezzed by avatar { llDie(); } } solution 2: use this for the on_rez event in the object being rezzed on_rez(integer rezparam) { list details = llGetObjectDetails(llGetKey(),[OBJECT_REZZER_KEY]); key rezzer = llList2Key(details,0); if(rezzer != llGetOwner())//if rezzer doesn't equal the owner key, then it was rezzed by an object { //give contents or whatever } else { llDie(); } }
  13. Ruthven Willenov

    Derezz if avatar rezzes and Give Object If Object Rezzes

    The easiest solution, that requires planning in the rezzer script, is to use the final parameter in the llRezObject command. Use an integer other than 0. In the object being rezzed, in the on_rez(integer rezparam) event, check that rezparam is not 0 The other solution, if for some reason you can't access the script with the rez command, is in the on_rez event, use llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]); Then extract that key from the list, and compare it to the owner key, if they aren't a match, it was rezzed by an object
  14. Ruthven Willenov

    integer olf

    i looked at the revision history of that page. it looks like Lowell Fitzgerald contributed that example. If you're serious about figuring out what OLF means, maybe see if they're still around to ask? I know sometimes I'll get something in my head that seems insignificant to others, it'll still bother me until i figure it out lol. Like if you see a familiar face and can't figure out where you know them from.
  15. Ruthven Willenov

    integer olf

    one possible one that i found while searching google is "Overload Factor", but in this context maybe it's Open Loop Factor? I also saw one that said Open Loop Feedback, but not sure what the feedback in this context would be
×