// KHAOS-II-core - An OpenSim version of ZHAO-II-core - Kayaker Magic, 2020-07-14 // // AO main engine script that works just like the ZHAO core engine but better on OpenSim. //Works with any 07 ZHAO interface script. //Works with your existing ZHAO notecards. //Use it just like the ZHAO AO. // The otherwise excelent ZHAO script suffered under a terrilble design flaw in Second Life itself: //There was no way in SL for a script to know if the system changed animations so ZHAO had to poll //continuously (tens of times a second) to detect changes, USING UP CPU CYCLES LIKE MAD! //(are you sitting yet? are you sitting yet? are you sitting yet? are you sitting yet? are you sitting yet?) //This meant that AOs like this one typically used more CPU time than any other script, causing //lag in regions where many avatars arrived with their AO on. // FORTUNATELY, OpenSimulator has a way to fix this, the changed event is called with //CHANGED_ANIMATION whenever the avatar changes one animation for another, so polling is //no longer necessary. // AO's in Second Live need to know ASAP that the animation has changed, so they hooked //into many other events like collision() that are often called many times a second. //This is no longer necessary, so I'm whacking out all the collision events. // ZHAO also hooked into controls to watch the CONTROL_BACK and CONTROL_FWD keys //but CHANGED_ANIMATION makes this test unnecessary so I removed all the control code. // // I made these changes to the ZHAO 07/07 script, using CHANGED_ANIMATION instead of polling //and slowing the timer way down to only check for updating the standing fidget animations. //Now this AO is gentile on the servers, not hogging lots of CPU time. // I changed the name to KHAOS for Kayaker's ZHAO, the S on the end just for fun! // --Kayaker Magic // Modification History // date what // 2020-07-14 Whacked out all the collision events. // 2020-07-13 Removed all the control event code // 2020-07-07 Whacked out the printFreeMem display, meaningless on OpenSim // Used llGetTime to prevent llGetAnimationList from being called when events come in rapidly. // 2020-07-05 Switched to using CHANGED_ANIMATION instead of polling // ZHAO-II-core - Ziggy Puff, 07/07 ///////////////////////////////////////////////////////////////////////////////////////////////////// // Main engine script - receives link messages from any interface script. Handles the core AO work // // Interface definition: The following link_message commands are handled by this script. All of // these are sent in the string field. All other fields are ignored // // ZHAO_RESET Reset script // ZHAO_LOAD| Load specified notecard // ZHAO_NEXTSTAND Switch to next stand // ZHAO_STANDTIME|