Jump to content

ohn

Resident
  • Posts

    73
  • Joined

  • Last visited

Posts posted by ohn

  1. i posted this to the other discussion ... but

    couldn't you do it like the dance balls in a club? when you are animated by one of those, you can move around where you want. There's an old script in the library for a dance ball, maybe you could use it: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryDanceBall

     

    not like the little pose balls that you sit on and dance, but the other ones that are often over the dance floor like a disco ball that you click and allow them to animate you while you are standing.

  2. couldn't you do it like the dance balls in a club? when you are animated by one of those, you can move around where you want. There's an old script in the library for a dance ball, maybe you could use it: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryDanceBall

     

    edit: not like the little pose balls that you sit on and dance, but the other ones that are often over the dance floor like a disco ball that you click and allow them to animate you while you are standing.

  3. hi!

    i am doing something wrong and have been trying for hours to figure out what it is. I have two prims that i want to talk to each other, BASE and SAT. Each have a script in them and each have the same notecard in them. the notecard defines the listen channel, the object name of the BASE and the object name of the SAT. I modified scripts, which I believe I had found in the wiki, so that they were supposed to read the configs from the notecard. If either is touched, it should send a message to the other object. when either object hears a message sent to it from the other object, it should chat the message it received ... "should" that is, if i were doing it right.

    It appears that both are successfully reading the notecard, as at one point i added llOwnerSay to check (now removed) and each appeared to correctly read the needed configs.

    Any ideas? The notecard, SAT script, and BASE script are below:

    //NOTECARD "config"
    CHANNEL=93829488
    SATNAME=SAT
    BASENAME=BASE

     

    //SAT script
    //NOTECARD VARIABLES
    integer line;
    string ConfigurationFile = "config";
    key readLineId;
    
    
    integer listen_handle; 
    integer listen_channel;
    string base_name;
    
    
    initialize()
    {
        //NOTECARD INITIALIZATION
         
        // make sure the file exists and is a notecard
        if(llGetInventoryType(ConfigurationFile) != INVENTORY_NOTECARD)
        {
            // notify owner of missing file
            llOwnerSay("Missing inventory notecard: " + ConfigurationFile);
            return; // don't do anything else
        }
     
        // initialize to start reading from first line
        line = 0;
     
        // read the first line
        readLineId = llGetNotecardLine(ConfigurationFile, line++);
    
    }
    
    processConfiguration(string data)
    {
        // if we are at the end of the file
        if(data == EOF)
        {
            // notify the owner
            llOwnerSay("We are done reading the configuration");
     
            // do not do anything else
            return;
        }
     
        // if we are not working with a blank line
        if(data != "")
        {
            // if the line does not begin with a comment
            if(llSubStringIndex(data, "#") != 0)
            {
                // find first equal sign
                integer i = llSubStringIndex(data, "=");
     
                // if line contains equal sign
                if(i != -1)
                {
                   
                    // get configs
                    list temp = llParseString2List(data, ["="], []);
                    if(llGetListLength(temp) == 2) {
                        
                        if( llList2String(temp, 0) == "CHANNEL") {
                            
                            listen_channel = (integer) llList2String(temp, 1);
                           
                        }
                       
                        if( llList2String(temp, 0) == "BASENAME") {
                            
                            base_name = llList2String(temp, 1);
    
                        }
                       
    
                    }
    
                 
                }
                else  // line does not contain equal sign
                {
                    llOwnerSay("Configuration could not be read on line " + (string)line);
                }
    
            }
        }
     
        // read the next line
        readLineId = llGetNotecardLine(ConfigurationFile, line++);
     
    }
    
    
    
    default
    {
        state_entry() {
            initialize();
            listen_handle = llListen(listen_channel, base_name, "", "");
        
        
        }
    
        on_rez(integer start_param) {
            initialize();
        }
    
         touch_start(integer total_number)
        {
           
             llRegionSay(listen_channel,"msg TO base\n");
            
        }
    
        changed(integer change)
        {
         if(change & CHANGED_INVENTORY) initialize();
         if(change & CHANGED_OWNER) initialize();
    
        }
    
        listen( integer listen_channel, string name, key id, string message )
        {
               llSay(0, "MSG FROM BASE:" + message + "\n");
               
              
            
            
        }
    
         dataserver(key request_id, string data)
        {
            if(request_id == readLineId)
                processConfiguration(data);
     
        }
    
    }

     

    //BASE script
    //NOTECARD VARIABLES
    integer line;
    string ConfigurationFile = "config";
    key readLineId;
    
    integer listen_handle;
    integer listen_channel;
    string sat_name;
    
    
    
    initialize()
    {
        //NOTECARD INITIALIZATION
         
        // make sure the file exists and is a notecard
        if(llGetInventoryType(ConfigurationFile) != INVENTORY_NOTECARD)
        {
            // notify owner of missing file
            llOwnerSay("Missing inventory notecard: " + ConfigurationFile);
            return; // don't do anything else
        }
     
        // initialize to start reading from first line
        line = 0;
     
        // read the first line
        readLineId = llGetNotecardLine(ConfigurationFile, line++);
    
    }
    
    processConfiguration(string data)
    {
        // if we are at the end of the file
        if(data == EOF)
        {
            // notify the owner
            llOwnerSay("We are done reading the configuration");
     
            // do not do anything else
            return;
        }
     
        // if we are not working with a blank line
        if(data != "")
        {
            // if the line does not begin with a comment
            if(llSubStringIndex(data, "#") != 0)
            {
                // find first equal sign
                integer i = llSubStringIndex(data, "=");
     
                // if line contains equal sign
                if(i != -1)
                {
                   
                    // get configs
                    list temp = llParseString2List(data, ["="], []);
                    if(llGetListLength(temp) == 2) {
                        
                        if( llList2String(temp, 0) == "CHANNEL") {
                            
                            listen_channel = (integer) llList2String(temp, 1);
                            
                        }
                        
                        if( llList2String(temp, 0) == "SATNAME") {
                            
                            sat_name = llList2String(temp, 1);
                        }
                    }
    
                 
                }
                else  // line does not contain equal sign
                {
                    llOwnerSay("Configuration could not be read on line " + (string)line);
                }
              
    
            }
        }
     
        // read the next line
        readLineId = llGetNotecardLine(ConfigurationFile, line++);
     
    }
    
    
    default
    {
        state_entry()
        {
            initialize();
            listen_handle = llListen(listen_channel, sat_name, "", "");
           
        }
        
        on_rez(integer start_param) {
            initialize();
        }
    
    
        touch_start(integer total_number)
        {
           
             llRegionSay(listen_channel,"msg TO SAT");
            
        }
        
          changed(integer change)
        {
         if(change & CHANGED_INVENTORY) initialize();
         if(change & CHANGED_OWNER) initialize();
    
        }
        
        listen( integer channel, string name, key id, string message )
        {
           
    
               llSay(0, "MSG FROM SAT: " + message);    
          
           
        }
         dataserver(key request_id, string data)
        {
            if(request_id == readLineId)
                processConfiguration(data);
     
        }
    
    }

     

×
×
  • Create New...