This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Chatbot Textausgabe bei Kollision
#1
Chatbot Textausgabe bei Kollision

Dieses Script dient zum Beispiel für ein Quest Spiel auf einer Sim.

Aktiv wird es bei Kollision eines Avatars mit einem unsichtbaren Primwürfel.
Es gibt eine Nachricht aus, und verstummt dann für eine einstellbare Zeit, bis es sich wieder scharf schaltet.

Typische Anwendung hier: der Wächter der Unterwelt gibt Tipps vor der Abfahrt in den Hades.

   

Platziert dazu das Script in einem unsichtbaren Phantom Prim auf dem Botssteg, sodas es die Avas es beim Einsteigen durchqueren müssen.
Benennt das Prim "Waechter der Unterwelt".   In gelb seht ihr die Platzierung des Prims.

   

- Hier soll nur eine einmalige Textausgabe erfolgen, auch wenn mehrere Avas nacheinander das Prim betreten.
- Daher ist ein Timer der zur temporären Deaktivierung eingebaut.


Code:
// P427 Chatbot mit Pause zwischen Ausgaben. by Tron

// USER PARAMETER
string  text4 = "Passt auf der Fährmann ist ein Scherzbold, er verkauft gerne Retourtickets.... hahahhahaa";
float   chatpause = 60.0;

// SYSTEM PARAMETER
integer aktiv = TRUE;

default
{
    state_entry(){llVolumeDetect(TRUE);}

    collision_start(integer total_number)
    {
        if(aktiv)
        {
            llSay(0,"\n" + text4 );
            aktiv = FALSE;
            llSetTimerEvent(chatpause);
        }
    }

    timer()
    {
        aktiv = TRUE;
        llSetTimerEvent(0.0);
    }
}

Im Artikel "Grussbot" findet ihr weitere Hinweise.

Viel Spaß

Tron
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste