Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| avatars:avatars [2025/05/24 13:09] – kaahupahau | avatars:avatars [2026/08/28 20:21] (current) – [Facial Expressions System] kaahupahau | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| Our first models was made in the size of 28 mm scale (tabletop figurines). On average, we found that the " | Our first models was made in the size of 28 mm scale (tabletop figurines). On average, we found that the " | ||
| By now, we try to prepare the packages more thoroughly. As a result, you should always check an avatars pages instructions. In case you're unsure, try importing the mesh parts in OpenSim, find out the perfect settings for your needs, and only then upload them in Second Life. \\ | By now, we try to prepare the packages more thoroughly. As a result, you should always check an avatars pages instructions. In case you're unsure, try importing the mesh parts in OpenSim, find out the perfect settings for your needs, and only then upload them in Second Life. \\ | ||
| + | Scaling issues affect only the Avatars from Ironwood115 (Shark & Lion; Scaling factor x10) and from Silverim ( Dark Dragon and Light Dragon, scaling factor should be fixed ). | ||
| Other steps typically include:\\ | Other steps typically include:\\ | ||
| Line 32: | Line 33: | ||
| And yes, it is like this because we somehow made an error and gave up trying to fix it in March 2024. Rotating the image is easy enough and just works. | And yes, it is like this because we somehow made an error and gave up trying to fix it in March 2024. Rotating the image is easy enough and just works. | ||
| - | ==== Facial Expressions System ==== | + | |
| + | ====== Shork Industries Scripts ====== | ||
| + | |||
| + | These scripts are the most up-to-date versions of the scripts we actively use: | ||
| + | |||
| + | ===== EarFlick Script - Left ===== | ||
| + | < | ||
| + | // Earflick / Sliding Door Script (with Euler-degree default rotation) | ||
| + | // Author: Nebadon Izumi (modified 2026 for Earflick function by Yavannah Halostar @ OSGrid & @ Kitely) | ||
| + | // Purpose: Accept object-editor Euler rotation in degrees and restore it on startup. | ||
| + | // Notes: | ||
| + | // - Provide the default rotation as an Euler vector in degrees exactly as shown | ||
| + | // in the object editor (format: <pitch, yaw, roll> | ||
| + | // - The script converts that Euler-degree vector to an LSL quaternion rotation | ||
| + | // using llEuler2Rot and applies it at state_entry so the object always | ||
| + | // | ||
| + | |||
| + | // --------------------------- CONFIGURATION --------------------------- | ||
| + | |||
| + | // Rotation to apply when " | ||
| + | // For right Ear, use these values: | ||
| + | float RotationAngle = 45.0; // degrees to rotate | ||
| + | vector RotationAxis = <-1, 0, 1>; // rotation axis | ||
| + | |||
| + | // For left Ear, comment the above and uncomment these two lines instead: | ||
| + | // float RotationAngle = 45.0; // degrees to rotate | ||
| + | // vector RotationAxis = <0, -1, 1>; // rotation axis for left ear | ||
| + | |||
| + | float Timer = 1.0; // how long the ear stays " | ||
| + | |||
| + | // Sound settings (leave empty string "" | ||
| + | string OpenSound = ""; | ||
| + | float OpenVol = 1.0; // opening volume | ||
| + | string CloseSound = ""; | ||
| + | float CloseVol = 1.0; // closing volume | ||
| + | |||
| + | // --------------------- DEFAULT ROTATION OPTIONS ---------------------- | ||
| + | // Provide the default rotation as Euler angles in degrees exactly as shown | ||
| + | // in the object editor. Example: <0.0, 0.0, 90.0> | ||
| + | // | ||
| + | // Set UseHardcodedDefault = TRUE to use DefaultEulerDeg below. | ||
| + | // Set UseHardcodedDefault = FALSE to auto-detect the current rotation at startup. | ||
| + | integer UseHardcodedDefault = TRUE; // TRUE = use DefaultEulerDeg; | ||
| + | |||
| + | // Paste the editor Euler vector here (pitch, yaw, roll in degrees). | ||
| + | // Example for 90 degrees around Z axis as shown in the editor: <0.0, 0.0, 90.0> | ||
| + | vector DefaultEulerDeg = <0.0, 0.0, 90.0>; | ||
| + | |||
| + | // --------------------------- INTERNALS ------------------------------- | ||
| + | rotation StartRot; | ||
| + | rotation RotationOffset; | ||
| + | integer Open = 0; // 0 = closed, 1 = open | ||
| + | |||
| + | // Helper: degrees to radians | ||
| + | float DEG2RAD = 3.14159265359 / 180.0; | ||
| + | |||
| + | default | ||
| + | { | ||
| + | state_entry() | ||
| + | { | ||
| + | // Determine StartRot from either the hardcoded Euler degrees or the current rotation | ||
| + | if (UseHardcodedDefault) | ||
| + | { | ||
| + | // Convert the editor-style Euler degrees to radians and then to a quaternion | ||
| + | // llEuler2Rot expects a vector of radians in the order <pitch, yaw, roll>. | ||
| + | StartRot = llEuler2Rot(DefaultEulerDeg * DEG2RAD); | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | // Auto-detect the current local rotation and treat it as the default | ||
| + | StartRot = llGetLocalRot(); | ||
| + | // Keep DefaultEulerDeg consistent for debugging; convert StartRot back to Euler | ||
| + | // Note: llRot2Euler returns radians; convert to degrees for DefaultEulerDeg | ||
| + | DefaultEulerDeg = llRot2Euler(StartRot) / DEG2RAD; | ||
| + | } | ||
| + | |||
| + | // Immediately set the object' | ||
| + | // This ensures that if the script was interrupted mid-rotation, | ||
| + | // the object will be restored to its intended default on initialization. | ||
| + | llSetLocalRot(StartRot); | ||
| + | |||
| + | // Pre-calc the rotation offset to apply when opening. | ||
| + | RotationOffset = llAxisAngle2Rot(RotationAxis, | ||
| + | |||
| + | // Ensure the " | ||
| + | Open = 0; | ||
| + | } | ||
| + | |||
| + | // Touch toggles the ear open/ | ||
| + | touch_start(integer num) | ||
| + | { | ||
| + | Open = !Open; // toggle state | ||
| + | |||
| + | if (Open) | ||
| + | { | ||
| + | if (OpenSound != "" | ||
| + | // Apply the offset relative to the stored StartRot (default). | ||
| + | llSetLocalRot(StartRot * RotationOffset); | ||
| + | llSetTimerEvent(Timer); | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | if (CloseSound != "" | ||
| + | // Return to the stored StartRot (default). | ||
| + | llSetLocalRot(StartRot); | ||
| + | llSetTimerEvent(0); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | // Collision also toggles the ear open/ | ||
| + | collision_start(integer num) | ||
| + | { | ||
| + | Open = !Open; | ||
| + | |||
| + | if (Open) | ||
| + | { | ||
| + | if (OpenSound != "" | ||
| + | llSetLocalRot(StartRot * RotationOffset); | ||
| + | llSetTimerEvent(Timer); | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | if (CloseSound != "" | ||
| + | llSetLocalRot(StartRot); | ||
| + | llSetTimerEvent(0); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | // When rezzed, reset the script so state_entry runs and the object | ||
| + | // is restored to the default rotation. | ||
| + | on_rez(integer param) | ||
| + | { | ||
| + | llResetScript(); | ||
| + | } | ||
| + | |||
| + | // Timer closes the ear after Timer seconds | ||
| + | timer() | ||
| + | { | ||
| + | if (CloseSound != "" | ||
| + | llSetLocalRot(StartRot); | ||
| + | llSetTimerEvent(0); | ||
| + | Open = 0; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== EarFlick Script - Right ===== | ||
| + | < | ||
| + | // Earflick / Sliding Door Script (with Euler-degree default rotation) | ||
| + | // Author: Nebadon Izumi (modified 2026 for Earflick function by Yavannah Halostar @ OSGrid & @ Kitely) | ||
| + | // Purpose: Accept object-editor Euler rotation in degrees and restore it on startup. | ||
| + | // Notes: | ||
| + | // - Provide the default rotation as an Euler vector in degrees exactly as shown | ||
| + | // in the object editor (format: <pitch, yaw, roll> | ||
| + | // - The script converts that Euler-degree vector to an LSL quaternion rotation | ||
| + | // using llEuler2Rot and applies it at state_entry so the object always | ||
| + | // | ||
| + | |||
| + | // --------------------------- CONFIGURATION --------------------------- | ||
| + | |||
| + | // Rotation to apply when " | ||
| + | // For right Ear, use these values: | ||
| + | float RotationAngle = 45.0; // degrees to rotate | ||
| + | vector RotationAxis = <1, 0, -1>; // rotation axis | ||
| + | |||
| + | // For left Ear, comment the above and uncomment these two lines instead: | ||
| + | // float RotationAngle = 45.0; // degrees to rotate | ||
| + | // vector RotationAxis = <0, -1, 1>; // rotation axis for left ear | ||
| + | |||
| + | float Timer = 1.0; // how long the ear stays " | ||
| + | |||
| + | // Sound settings (leave empty string "" | ||
| + | string OpenSound = ""; | ||
| + | float OpenVol = 1.0; // opening volume | ||
| + | string CloseSound = ""; | ||
| + | float CloseVol = 1.0; // closing volume | ||
| + | |||
| + | // --------------------- DEFAULT ROTATION OPTIONS ---------------------- | ||
| + | // Provide the default rotation as Euler angles in degrees exactly as shown | ||
| + | // in the object editor. Example: <0.0, 0.0, 90.0> | ||
| + | // | ||
| + | // Set UseHardcodedDefault = TRUE to use DefaultEulerDeg below. | ||
| + | // Set UseHardcodedDefault = FALSE to auto-detect the current rotation at startup. | ||
| + | integer UseHardcodedDefault = TRUE; // TRUE = use DefaultEulerDeg; | ||
| + | |||
| + | // Paste the editor Euler vector here (pitch, yaw, roll in degrees). | ||
| + | // Example for 90 degrees around Z axis as shown in the editor: <0.0, 0.0, 90.0> | ||
| + | vector DefaultEulerDeg = <0.0, 0.0, 90.0>; | ||
| + | |||
| + | // --------------------------- INTERNALS ------------------------------- | ||
| + | rotation StartRot; | ||
| + | rotation RotationOffset; | ||
| + | integer Open = 0; // 0 = closed, 1 = open | ||
| + | |||
| + | // Helper: degrees to radians | ||
| + | float DEG2RAD = 3.14159265359 / 180.0; | ||
| + | |||
| + | default | ||
| + | { | ||
| + | state_entry() | ||
| + | { | ||
| + | // Determine StartRot from either the hardcoded Euler degrees or the current rotation | ||
| + | if (UseHardcodedDefault) | ||
| + | { | ||
| + | // Convert the editor-style Euler degrees to radians and then to a quaternion | ||
| + | // llEuler2Rot expects a vector of radians in the order <pitch, yaw, roll>. | ||
| + | StartRot = llEuler2Rot(DefaultEulerDeg * DEG2RAD); | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | // Auto-detect the current local rotation and treat it as the default | ||
| + | StartRot = llGetLocalRot(); | ||
| + | // Keep DefaultEulerDeg consistent for debugging; convert StartRot back to Euler | ||
| + | // Note: llRot2Euler returns radians; convert to degrees for DefaultEulerDeg | ||
| + | DefaultEulerDeg = llRot2Euler(StartRot) / DEG2RAD; | ||
| + | } | ||
| + | |||
| + | // Immediately set the object' | ||
| + | // This ensures that if the script was interrupted mid-rotation, | ||
| + | // the object will be restored to its intended default on initialization. | ||
| + | llSetLocalRot(StartRot); | ||
| + | |||
| + | // Pre-calc the rotation offset to apply when opening. | ||
| + | RotationOffset = llAxisAngle2Rot(RotationAxis, | ||
| + | |||
| + | // Ensure the " | ||
| + | Open = 0; | ||
| + | } | ||
| + | |||
| + | // Touch toggles the ear open/ | ||
| + | touch_start(integer num) | ||
| + | { | ||
| + | Open = !Open; // toggle state | ||
| + | |||
| + | if (Open) | ||
| + | { | ||
| + | if (OpenSound != "" | ||
| + | // Apply the offset relative to the stored StartRot (default). | ||
| + | llSetLocalRot(StartRot * RotationOffset); | ||
| + | llSetTimerEvent(Timer); | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | if (CloseSound != "" | ||
| + | // Return to the stored StartRot (default). | ||
| + | llSetLocalRot(StartRot); | ||
| + | llSetTimerEvent(0); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | // Collision also toggles the ear open/ | ||
| + | collision_start(integer num) | ||
| + | { | ||
| + | Open = !Open; | ||
| + | |||
| + | if (Open) | ||
| + | { | ||
| + | if (OpenSound != "" | ||
| + | llSetLocalRot(StartRot * RotationOffset); | ||
| + | llSetTimerEvent(Timer); | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | if (CloseSound != "" | ||
| + | llSetLocalRot(StartRot); | ||
| + | llSetTimerEvent(0); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | // When rezzed, reset the script so state_entry runs and the object | ||
| + | // is restored to the default rotation. | ||
| + | on_rez(integer param) | ||
| + | { | ||
| + | llResetScript(); | ||
| + | } | ||
| + | |||
| + | // Timer closes the ear after Timer seconds | ||
| + | timer() | ||
| + | { | ||
| + | if (CloseSound != "" | ||
| + | llSetLocalRot(StartRot); | ||
| + | llSetTimerEvent(0); | ||
| + | Open = 0; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Tailwiggle Bunny ===== | ||
| + | |||
| + | < | ||
| + | // Tail Wiggle Script for OpenSimulator | ||
| + | // Default rotation: < | ||
| + | // Random wiggles every 30...120 seconds | ||
| + | // Touch = interrupt and excited wagging | ||
| + | |||
| + | rotation gBaseRot; | ||
| + | |||
| + | integer gBusy = FALSE; | ||
| + | integer gTouched = FALSE; | ||
| + | |||
| + | float DEG2RAD = PI / 180.0; | ||
| + | |||
| + | // | ||
| + | |||
| + | rotation RotOffset(float x, float y, float z) | ||
| + | { | ||
| + | return llEuler2Rot(< | ||
| + | } | ||
| + | |||
| + | // | ||
| + | |||
| + | ResetTimer() | ||
| + | { | ||
| + | llSetTimerEvent(10.0 + llFrand(50.0)); | ||
| + | } | ||
| + | |||
| + | // | ||
| + | |||
| + | SetBaseRotation() | ||
| + | { | ||
| + | llSetRot(gBaseRot); | ||
| + | } | ||
| + | |||
| + | // | ||
| + | |||
| + | RotateRelative(float x, float y, float z) | ||
| + | { | ||
| + | llSetRot(gBaseRot * RotOffset(x, | ||
| + | } | ||
| + | |||
| + | // | ||
| + | |||
| + | DoNormalSequence() | ||
| + | { | ||
| + | integer horizontal = (llFrand(2.0) < 1.0); | ||
| + | |||
| + | integer angle; | ||
| + | |||
| + | if (llFrand(2.0) < 1.0) | ||
| + | angle = 15; | ||
| + | else | ||
| + | angle = 30; | ||
| + | |||
| + | if (horizontal) | ||
| + | { | ||
| + | integer i; | ||
| + | |||
| + | for(i=0; | ||
| + | { | ||
| + | if(gTouched) return; | ||
| + | |||
| + | RotateRelative(0, | ||
| + | llSleep(0.18); | ||
| + | |||
| + | if(gTouched) return; | ||
| + | |||
| + | RotateRelative(0, | ||
| + | llSleep(0.18); | ||
| + | } | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | integer i; | ||
| + | |||
| + | for(i=0; | ||
| + | { | ||
| + | if(gTouched) return; | ||
| + | |||
| + | RotateRelative(angle, | ||
| + | llSleep(0.22); | ||
| + | |||
| + | if(gTouched) return; | ||
| + | |||
| + | RotateRelative(-angle, | ||
| + | llSleep(0.22); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | SetBaseRotation(); | ||
| + | } | ||
| + | |||
| + | // | ||
| + | |||
| + | DoTouchSequence() | ||
| + | { | ||
| + | integer i; | ||
| + | |||
| + | for(i=0; | ||
| + | { | ||
| + | RotateRelative(0, | ||
| + | llSleep(0.12); | ||
| + | |||
| + | RotateRelative(0, | ||
| + | llSleep(0.12); | ||
| + | } | ||
| + | |||
| + | SetBaseRotation(); | ||
| + | } | ||
| + | |||
| + | // | ||
| + | |||
| + | default | ||
| + | { | ||
| + | state_entry() | ||
| + | { | ||
| + | gBaseRot = llEuler2Rot(< | ||
| + | |||
| + | SetBaseRotation(); | ||
| + | |||
| + | ResetTimer(); | ||
| + | } | ||
| + | |||
| + | on_rez(integer n) | ||
| + | { | ||
| + | llResetScript(); | ||
| + | } | ||
| + | |||
| + | timer() | ||
| + | { | ||
| + | if(gBusy) | ||
| + | return; | ||
| + | |||
| + | gBusy = TRUE; | ||
| + | gTouched = FALSE; | ||
| + | |||
| + | DoNormalSequence(); | ||
| + | |||
| + | gTouched = FALSE; | ||
| + | gBusy = FALSE; | ||
| + | |||
| + | ResetTimer(); | ||
| + | } | ||
| + | |||
| + | touch_start(integer total_number) | ||
| + | { | ||
| + | gTouched = TRUE; | ||
| + | |||
| + | SetBaseRotation(); | ||
| + | |||
| + | gBusy = TRUE; | ||
| + | |||
| + | DoTouchSequence(); | ||
| + | |||
| + | gTouched = FALSE; | ||
| + | gBusy = FALSE; | ||
| + | |||
| + | ResetTimer(); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | ====== Facial Expressions System | ||
| Facial expressions are provided by a scripted component, named " | Facial expressions are provided by a scripted component, named " | ||
Last modified: le 2025/05/24 13:09
