• Bitte schaltet eure Ad Blocker aus. SLinfo kann nur betrieben werden, wenn es durch Werbung Einnahmen erzielt. Vielen Dank!!
  • Wir freuen uns, wenn du dich in unserem Forum anmeldest. Bitte beachte, dass die Freigabe per Hand durchgeführt wird (Schutz vor Spammer). Damit kann die Freigabe bis zu 24 Stunden dauern.
  • Wir verwenden Cookies, um Inhalte und Anzeigen zu personalisieren, Funktionen für soziale Medien anbieten zu können und die Zugriffe auf unsere Website zu analysieren. Sie geben Einwilligung zu unseren Cookies, wenn Sie unsere Webseite weiterhin nutzen.

Scripted Schach gesucht

Eulenguru

Nutzer
Hey, ich hätte gern auf meiner Opensim ein scripted Schach und hab auch schon das alte opensource Xy Chess ausprobiert allerdings lässt es sich in Opensim nicht kompilieren.
Ich würde also entweder ein fertiges Schach suchen oder einen netten scripter der dem Xy chess opensimisch beibringt :)
Bei Interesse meldet euch bitte mit Preisvorstellung per email unter opensimeule@gmx.de
Eure Opensim Eule :)
 
Huhu danke für die Antwort :) ja es ist ein LSL script aber es arbeitet halt in OS nicht :-( und meine scriptkünste reichen da leider bei weitem nicht aus.
 
Es sind ca 20 scripte in einem Schachtisch :) ich kann dir das Ding in Sl geben oder ich leg dir eben einen Ava bei mir an dann kannst du es dir ansehen wenn du möchtest.
Die meisten Scripte gehen, nur 4 oder 5 lassen sich nicht kompilieren, ich schätze es ist der bug mit den Werten vor dem Default aber ich kriegs nicht hin :-(
Danke schon mal :)

https://marketplace.secondlife.com/p/Chess-with-Chairs-from-Rita-Munroboxed/421450

Das ist das Teil, es ist halt eigentlich opensource das früher auf xstreet für 0 L und FP zu kriegen war.
 
ja, eigentlich ist genau der Tisch Open Source und eigentlich Free.
Hab eben auch geschaut und viele verkaufen den auf dem marketplace.....
 
Mir gings ja nur um das Bild, die meisten kennen das Teil ja :) Ich hab den mal auf Xstreet als Freebie und FP gekauft und hätte ihn halt gern in meiner OS :)
 
Also im wesentlichen bekomm ich immer die gleiche Fehlermeldung, als Beispiel hier mal eines der Skripte das nicht geht.

PHP:
///////////////////////////////////////////////////////////////////////////////////////////
// Button Script
//
// Copyright (c) 2004 Xylor Baysklef
//
// This file is part of XyChess.
//
// XyChess 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.
//
// XyChess 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.
//
// You should have received a copy of the GNU General Public License
// along with XyChess; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
///////////////////////////////////////////////////////////////////////////////////////////

/////////////// CONSTANTS ///////////////////
// Color enumeration.
integer WHITE           = 8;
integer BLACK           = 16;

// Interface messages.
integer AVATAR_IN_CHAIR         = 8000;

integer NONE            = -1;

// Game messages.
integer NEW_GAME                = 16000;
///////////// END CONSTANTS ////////////////

///////////// GLOBAL VARIABLES ///////////////
// Dialog box info.
integer gDialogCallback = NONE;
integer gDialogChannel  = NONE;

// Keys of players.
key     gWhitePlayer;
key     gBlackPlayer;
/////////// END GLOBAL VARIABLES ////////////

GiveConfirmationDialogBox(key id) {
    // First remove the old callback.
    if (gDialogCallback != NONE)
        llListenRemove(gDialogCallback);
                        
    // First start listening on a random channel for the
    // return from this dialog box.
    gDialogChannel  = llRound(llFrand(1.0) * 2000000000) + 1;
    gDialogCallback = llListen(gDialogChannel, "", "", "");
            
    // Give the dialog box.
    llDialog(id, "This will end the current game, are you sure you want to reset the board?", 
            ["Yes", "No"], gDialogChannel);
}

default {
    state_entry() {
    }
    
    touch_start(integer num_detected) {
        // Only process touches from owner or a player.
        key Toucher = llDetectedKey(0);
        if (Toucher != llGetOwner() &&
            Toucher != gWhitePlayer &&
            Toucher != gBlackPlayer)
            return;
            
        GiveConfirmationDialogBox(Toucher);
    }
        
    listen(integer channel, string name, key id, string mesg) {  
        if (channel == gDialogChannel) {
            // Remove the timeout and the callback.
            llListenRemove(gDialogCallback);
            gDialogCallback = NONE;
            //llSetTimerEvent(0.0);
            
            // If they confirmed, then make a new game.
            if (mesg == "Yes")
                llMessageLinked(LINK_SET, NEW_GAME, "", "");
            
            return;
        }
    }
    
    link_message(integer sender, integer channel, string data, key id) {
        if (channel == AVATAR_IN_CHAIR) {
            integer Color = (integer) data;
            
            if (Color == WHITE)
                gWhitePlayer = id;
            else
                gBlackPlayer = id;
                                
            return;
        }
    }
}
Und da erhalte ich die Fehlermeldung die Fehlermeldung:
Error CSO236: A field initializer cannot reference the nonstatic field, methode or property Second Life Scripte NONE
Für folgende Zeilen:
integer gDialogCallback = NONE;
integer gDialogChannel = NONE;
 
Hallo,

probier es doch mal bitte mit folgendem:

Code:
///////////////////////////////////////////////////////////////////////////////////////////
// Button Script
//
// Copyright (c) 2004 Xylor Baysklef
//
// This file is part of XyChess.
//
// XyChess 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.
//
// XyChess 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.
//
// You should have received a copy of the GNU General Public License
// along with XyChess; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
///////////////////////////////////////////////////////////////////////////////////////////

/////////////// CONSTANTS ///////////////////
// Color enumeration.
integer WHITE           = 8;
integer BLACK           = 16;

// Interface messages.
integer AVATAR_IN_CHAIR         = 8000;

integer NONE            = -1;

// Game messages.
integer NEW_GAME                = 16000;
///////////// END CONSTANTS ////////////////

///////////// GLOBAL VARIABLES ///////////////
// Dialog box info.
integer gDialogCallback = -1;
integer gDialogChannel = -1;

// Keys of players.
key     gWhitePlayer;
key     gBlackPlayer;
/////////// END GLOBAL VARIABLES ////////////

GiveConfirmationDialogBox(key id) {
    // First remove the old callback.
    if (gDialogCallback != NONE)
        llListenRemove(gDialogCallback);
                        
    // First start listening on a random channel for the
    // return from this dialog box.
    gDialogChannel  = llRound(llFrand(1.0) * 2000000000) + 1;
    gDialogCallback = llListen(gDialogChannel, "", "", "");
            
    // Give the dialog box.
    llDialog(id, "This will end the current game, are you sure you want to reset the board?", 
            ["Yes", "No"], gDialogChannel);
}

default {
    state_entry() {
    }
    
    touch_start(integer num_detected) {
        // Only process touches from owner or a player.
        key Toucher = llDetectedKey(0);
        if (Toucher != llGetOwner() &&
            Toucher != gWhitePlayer &&
            Toucher != gBlackPlayer)
            return;
            
        GiveConfirmationDialogBox(Toucher);
    }
        
    listen(integer channel, string name, key id, string mesg) {  
        if (channel == gDialogChannel) {
            // Remove the timeout and the callback.
            llListenRemove(gDialogCallback);
            gDialogCallback = NONE;
            //llSetTimerEvent(0.0);
            
            // If they confirmed, then make a new game.
            if (mesg == "Yes")
                llMessageLinked(LINK_SET, NEW_GAME, "", "");
            
            return;
        }
    }
    
    link_message(integer sender, integer channel, string data, key id) {
        if (channel == AVATAR_IN_CHAIR) {
            integer Color = (integer) data;
            
            if (Color == WHITE)
                gWhitePlayer = id;
            else
                gBlackPlayer = id;
                                
            return;
        }
    }
}



Gruß
 
So das war leider mein Fehler, sorry. Ich hab deinen Code im Linkset versucht, also einfach das Skript über verknüpfte Teile bearbeiten aufgemacht, alles drin gelöscht und den neuen Code reinkopiert, und das wollte er nicht.
Ich hab es jetzt nochmal in einem neutralen Prim versucht und da geht es, ich werd jetzt mal alle Skipte die spinnen so umarbeiten dass ich die Variablen mit den Werten austausch, mal sehen was er sagt und ob es zu einem Schach führt :)
Vielen dank schon mal für deine Hilfe :)
 
Das nächste Problem, seufzt :-(
Ich hab jetzt erstmal die Variablen mit den zugehörigen Werten ausgetauscht, jetzt bleibt noch die Fehlermeldung in folgendem Skript:

PHP:
///////////////////////////////////////////////////////////////////////////////////////////
// Chair Manager Script
//
// Copyright (c) 2004 Xylor Baysklef
//
// This file is part of XyChess.
//
// XyChess 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.
//
// XyChess 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.
//
// You should have received a copy of the GNU General Public License
// along with XyChess; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
///////////////////////////////////////////////////////////////////////////////////////////

/////////////// CONSTANTS ///////////////////
string  CHAIR_OBJECT    = "Chess Table - Chair";
string  CHAIR_DATA      = "Chair Data";

// Chair Commands.
string  PING            = "ping";
string  PONG            = "pong";
string  CHAIR_DIE       = "chr_die";
string  AVATAR_CHANGE   = "av_chng";

// Chair data line numbers.
integer WHITE_CHAIR_POSITION_LINE   = 1;
integer WHITE_CHAIR_ROTATION_LINE   = 3;
integer BLACK_CHAIR_POSITION_LINE   = 5;
integer BLACK_CHAIR_ROTATION_LINE   = 7;
integer NONE                        = -1;

// Interface message.
integer AVATAR_IN_CHAIR         = 8000;

// Seperator to use instead of comma.
string  FIELD_SEPERATOR = "~!~";
///////////// END CONSTANTS ////////////////

///////////// GLOBAL VARIABLES ///////////////
integer gChairChannel;
integer gCallback = -1;

// Chair data
vector      gWhiteChairPosition;
rotation    gWhiteChairRotation;
vector      gBlackChairPosition;
rotation    gBlackChairRotation;

// Current line number in notecard we are on.
integer     gLineNumber;
// Query ID to check against.
key         gQueryID;
/////////// END GLOBAL VARIABLES ////////////

vector GetRootPos() {
    // If this object is not linked, or if it is the
    // root object, just return llGetPos
    integer LinkNum = llGetLinkNumber();
    
    if (LinkNum == 0 || LinkNum == 1)
        return llGetPos();
        
    // Otherwise take local position into account.
    return llGetPos() - llGetLocalPos();
}

rotation GetRootRot() {
    // If this object is not linked, or if it is the
    // root object, just return llGetRot
    integer LinkNum = llGetLinkNumber();
    
    if (LinkNum == 0 || LinkNum == 1)
        return llGetRot();
        
    // Otherwise take local rotation into account.
    
    // This is the rotation of this object with the
    // root object's rotation as the reference frame.
    rotation LocalRot = llGetLocalRot();
    // This uses the global coord system as the 
    // reference frame.
    rotation GlobalRot = llGetRot();
    
    // Reverse the local rotation, so we can undo it.
    LocalRot.s = -LocalRot.s;
    
    // Convert from local rotation to just root rotation.
    rotation RootRot = LocalRot * GlobalRot;
    
    // Make the sign match (mathematically, this isn't necessary, 
    // but it makes the rotations look the same when printed out).
    RootRot = -RootRot;
    
    return RootRot;
}

key GetRootKey() {
    // Just return link number 0's key.
    return llGetLinkKey(0);
}


RezChairs() {   
    // First remove any callback if it exists.
    if (gCallback != NONE) {
        llListenRemove(gCallback);
        // Remove any chairs already out.
        llShout(gChairChannel, CHAIR_DIE);
    }

    // Create a new chair manager channel.
    gChairChannel = llRound(llFrand(1.0) * 1000000000) + 1;
    gCallback = llListen(gChairChannel, "", "", "");   
    
    // Now rez new chairs.
    vector      RootPos = GetRootPos();
    rotation    RootRot = GetRootRot();
    
    llRezObject(CHAIR_OBJECT, RootPos + gWhiteChairPosition * RootRot,
                ZERO_VECTOR, gWhiteChairRotation * RootRot, gChairChannel * 2);
    llRezObject(CHAIR_OBJECT, RootPos + gBlackChairPosition * RootRot,
                ZERO_VECTOR, gBlackChairRotation * RootRot, gChairChannel * 2 + 1); 
}

ReadChairData() {
    // Start the notecard reading process.
    gLineNumber = WHITE_CHAIR_POSITION_LINE;
    gQueryID = llGetNotecardLine(CHAIR_DATA, gLineNumber);
}

default {
    state_entry() {
        // Read the chair data from the notecard.
        ReadChairData();
    }
    
    on_rez(integer param) { 
        // First remove any callback if it exists.
        if (gCallback != NONE) {
            llListenRemove(gCallback);
            gCallback = NONE;
        }

        // Read the chair data from the notecard.
        ReadChairData();   
    }
    
    dataserver(key query_id, string data) {
        // Make sure this is the data we requested.
        if (query_id != gQueryID)
            return;
            
        // If this is EOF, give a warning.
        if (data == EOF) {
            llSay(0, "ERROR: " + CHAIR_DATA + " notecard is invalid!");
            return;
        }
            
        // Check which line number this is.
        if (gLineNumber == WHITE_CHAIR_POSITION_LINE) {
            gWhiteChairPosition = (vector) data;
            
            // Set up the next line.
            gLineNumber = WHITE_CHAIR_ROTATION_LINE;
        }
        else if (gLineNumber == WHITE_CHAIR_ROTATION_LINE) {
            gWhiteChairRotation = (rotation) data;
            
            // Set up the next line.
            gLineNumber = BLACK_CHAIR_POSITION_LINE;
        }
        else if (gLineNumber == BLACK_CHAIR_POSITION_LINE) {
            gBlackChairPosition = (vector) data;
            
            // Set up the next line.
            gLineNumber = BLACK_CHAIR_ROTATION_LINE;
        }
        else if (gLineNumber == BLACK_CHAIR_ROTATION_LINE) {
            gBlackChairRotation = (rotation) data;
            
            // No next line.
            gLineNumber = NONE;
        }
        else { // Unknown...
            llSay(0, "ERROR: Unknown line number.");
            return;
        }
        
        // Retrieve the next line.
        if (gLineNumber != NONE) {
            gQueryID = llGetNotecardLine(CHAIR_DATA, gLineNumber);
            return;
        }
        else { 
            // We are done reading the notecard.
            RezChairs();
        }
    }
    
    listen(integer channel, string name, key id, string mesg) {
        if (channel == gChairChannel) {
            // Split up the mesg.
            list Parsed = llParseString2List(mesg, [FIELD_SEPERATOR], []);
            
            string Command = llList2String(Parsed, 0);
            
            // Check the command.
            if (Command == PING) {
                // Send out a pong.
                llShout(gChairChannel, llDumpList2String(
                            [PONG, GetRootPos(), GetRootRot(), 
                             GetRootKey()], FIELD_SEPERATOR));
                return;
            }
            if (Command == AVATAR_CHANGE) {
                integer ChairColor  = (integer) llList2String(Parsed, 1);
                key     Avatar      = (key)     llList2String(Parsed, 2);
                                
                // Tell the interface about the avatar change.
                llMessageLinked(LINK_SET, AVATAR_IN_CHAIR,
                                (string) ChairColor, Avatar);
                return;
            }
        }
    }
    
    // Re-read the notecard if inventory changes.
    changed(integer change) {
        if (change == CHANGED_INVENTORY) {
            ReadChairData();
        }
    }
    
    link_message(integer sender, integer channel, string data, key id) {
    }
}
In dem Skitpt erhalte ich den Error:
CS0023: Operator "-" can not be applied to operand of type "Opensim. Region, ScriptEngine, Shared, LSL_Types, Quaternion
Und zwar für folgende Zeile:
RootRot = -RootRot;
Vielen Dank nochmal für die Hilfe :)
 

Users who are viewing this thread

Zurück
Oben Unten