Jump to content

Cid Jacobs

Resident
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Cid Jacobs

  1. Cid Jacobs

    llMUX

    By request, this update allows for removal of individual channels: // llMUX // Copyright (C) 2020 Cid Jacobs // Created by: Cid Jacobs // Original by: Cid Jacobs // Created: 06-17-20 // Last Updated: 06-17-20 // // //--------------------Notes //llMUX is a method which allows multiple signals to be combined (multiplexing) into one signal fed through a timer event. The aim is to share a scarce resource. In this case, timer event calls. // // //--------------------License // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // A copy of the GNU General Public License is available at http://www.gnu.org/copyleft/gpl.html // // //--------------------Support // I do not guarantee to support this script or any modifications of this script. // // //--------------------Features // - Supports 16 "channel" dual encoded events. // - Easily outputs to linked message events. // - Allows for removal of chanels individually. // // //--------------------Contraints // - Only allows for frequency values as integers. // - Only allows for period values as integers. // - FIFO (First in first out) if "channels" beyond 16 are created. // // //--------------------Credits // I would like to thank the following for beta testing. // NightCatsMeow (rebecca.wendell) // // //--------------------Change Log //V0.1.1 - Release // - Added boolean for removing channels individually //V0.1.0 - Release // - Added encoding and linkNumber mapping //V0.0.1 - Non-Release // - Added channel switching //V0.0.0 - Non-Release // - Added MUX frequency and signal plexing // // //--------------------Globals integer gPeriod = 60;//Interval to raise timer library call integer gDMX; integer gToggle; list gFrequencyList; list gLinkList; list gChannelList; list gSignalList; list gEncodingList; //--------------------User Defined Functions //Causes llDMX to trigger at rate of (Frequency * Period) per second. Multiplex Channel, Signal and Encoding to members of link set identified by linkNumber. linkNumber is either a linked number (available through llGetLinkNumber) or a LINK_* constant. llMUX(integer frequency, integer linkNumber, integer channel, string signal, key encoding, integer toggle) { if(toggle) { gFrequencyList += frequency; gLinkList += linkNumber; gChannelList += channel; gSignalList += signal; gEncodingList += encoding; if(llGetListLength(gSignalList) > 16) { gFrequencyList = llDeleteSubList(gFrequencyList,0,0); gLinkList = llDeleteSubList(gLinkList,0,0); gChannelList = llDeleteSubList(gChannelList,0,0); gSignalList = llDeleteSubList(gSignalList,0,0); gEncodingList = llDeleteSubList(gEncodingList,0,0); } } else { integer sortIndex = llListFindList(gFrequencyList, [frequency]); if(sortIndex != -1) { gFrequencyList = llDeleteSubList(gFrequencyList,sortIndex,sortIndex); gLinkList = llDeleteSubList(gLinkList,sortIndex,sortIndex); gChannelList = llDeleteSubList(gChannelList,sortIndex,sortIndex); gSignalList = llDeleteSubList(gSignalList,sortIndex,sortIndex); gEncodingList = llDeleteSubList(gEncodingList,sortIndex,sortIndex); } } } llDMX() { ++gDMX; integer c = 0; for(;c < llGetListLength(gSignalList);++c) { integer frequency = llList2Integer(gFrequencyList,c); integer linkNumber = llList2Integer(gLinkList,c); integer channel = llList2Integer(gChannelList,c); string signal = llList2String(gSignalList,c); key encoding = llList2Key(gEncodingList,c); if(gDMX%frequency == 0) { llMessageLinked(linkNumber,channel,signal,encoding); } } } // // //--------------------States //Required Default State default { state_entry() { llSetTimerEvent((float)gPeriod); } touch_start(integer num) { if(gToggle) { llMUX(1,LINK_SET,100,"Hello, world.",llGetOwner(),FALSE); } else { llMUX(1,LINK_SET,100,"Hello, world.",llGetOwner(),TRUE); } gToggle = !gToggle; } timer() { llDMX(); } link_message(integer linkNumber,integer channel,string signal,key encoding) { llOwnerSay((string)linkNumber + "|" + (string)channel + "|" + signal + "|" + (string)encoding); } }
  2. Cid Jacobs

    llMUX

    // llMUX // Copyright (C) 2020 Cid Jacobs // Created by: Cid Jacobs // Original by: Cid Jacobs // Created: 06-17-20 // Last Updated: 06-17-20 // // //--------------------Notes //llMUX is a method which allows multiple signals to be combined (multiplexing) into one signal fed through a timer event. The aim is to share a scarce relinkNumber. In this case, timer event calls. // // //--------------------License // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // A copy of the GNU General Public License is available at http://www.gnu.org/copyleft/gpl.html // // //--------------------Support // I do not guarantee to support this script or any modifications of this script. // // //--------------------Features // - Supports 16 "channel" dual encoded events. // - Easily outputs to linked message events. // // //--------------------Contraints // - Only allows for frequency values as integers. // - Only allows for period values as integers. // - FIFO (First in first out) if "channels" beyond 16 are created. // // //--------------------Credits // I would like to thank the following for beta testing. // NightCatsMeow (rebecca.wendell) // // //--------------------Change Log //V0.1.0 - Release // - Added encoding and linkNumber mapping //V0.0.1 - Non-Release // - Added channel switching //V0.0.0 - Non-Release // - Added MUX frequency and signal plexing // // //--------------------Globals integer gPeriod = 60;//Interval to raise timer library call integer gDMX; list gFrequencyList; list gLinkList; list gChannelList; list gSignalList; list gEncodingList; //--------------------User Defined Functions //Causes llDMX to trigger at rate of (Frequency * Period) per second. Multiplex Channel, Signal and Encoding to members of link set identified by linkNumber. linkNumber is either a linked number (available through llGetLinkNumber) or a LINK_* constant. llMUX(integer frequency, integer linkNumber, integer channel, string signal, key encoding) { gFrequencyList += frequency; gLinkList += linkNumber; gChannelList += channel; gSignalList += signal; gEncodingList += encoding; if(llGetListLength(gSignalList) > 16) { gFrequencyList = llDeleteSubList(gFrequencyList,0,0); gLinkList = llDeleteSubList(gLinkList,0,0); gChannelList = llDeleteSubList(gChannelList,0,0); gSignalList = llDeleteSubList(gSignalList,0,0); gEncodingList = llDeleteSubList(gEncodingList,0,0); } } llDMX() { ++gDMX; integer c = 0; for(;c < llGetListLength(gSignalList);++c) { integer frequency = llList2Integer(gFrequencyList,c); integer linkNumber = llList2Integer(gLinkList,c); integer channel = llList2Integer(gChannelList,c); string signal = llList2String(gSignalList,c); key encoding = llList2Key(gEncodingList,c); if(gDMX%frequency == 0) { llMessageLinked(linkNumber,channel,signal,encoding); } } } // // //--------------------States //Required Default State default { state_entry() { llMUX(1,LINK_SET,100,"Hello, world.",llGetOwner()); llSetTimerEvent((float)gPeriod); } timer() { llDMX(); } link_message(integer linkNumber,integer channel,string signal,key encoding) { llOwnerSay((string)linkNumber + "|" + (string)channel + "|" + signal + "|" + (string)encoding); } }
  3. Albert Fool - He taught me a lot about scripting, but he ended up leaving Second Life a month later. Frank Vogel - Watching him build a motorcycle in Morris my first day inspired me to actually stay with Second Life. Jillian Callahan - She taught me a sense of community here that made me stay longer than most people do.
  4. It depends on what type of fuel you are using firstly. You need to figure out it's energy production per unit after you determine the type of fuel. Then you need to figure out your engine efficiency at certain stages, or come up with a formula based on velocity. Then you should have an adjustment value based on the mass of the vehicle + passengers. Don't forget you also consume fuel while idling, so you may want to include that as well.
  5. As for the average, it really was fairly random, but usually it would hit large "patches" in the 8MPS range for a while, and in the 15MPS range for a while, but this may have been due to pseudo random number generation rather than any sort of pattern.
  6. I think most of the weather info on the wiki page is already authored by me, and I doubt anyone would be interested in raw data. The numbers appear random, but actually use the equations I mentioned before, just on a much larger scale. And I have not put the minimum and maximum just because it has not been "100%" verified yet. If someone can get Andrew to confirm that it is capped at 32, that would be great. Right now I am only 99.9% sure it is.
  7. I did a lot of experiments on wind years ago, and as far as I know it still uses the same Jos Stam's Navier-Stokes equations. Over the course of several months the fastest wind I ever recorded, while polling every 15 minutes or so in multiple locations, was 31.800045 MPS, the slowest was 0.000440 MPS. I believe their is some pseudo-math to cap the maximum value for wind at 32 MPS to keep the wind from becoming unstable, this is based solely on interactions with Andrew Linden where he said that he was not "100% sure."
×
×
  • Create New...