objet parlant modifiable par note card

Répondre
Partager Rechercher
bonjour voici un script qui....quand on le touche il dis ce qu il y a de marqué dedans
l Idée est que les phrases ne soient pas limité en caractère ni en n'ombres et que les phrases soient modifiable uniquement par note card, ce qui s simplifierait les choses

list colorChoices = ["je Reviens (AFK)","voila je suis revenue","et BISOUS","Re ","sa lag!!!!","ooops","j ai faim","j ai soif","oops cras","A bientot Bisous","je Deco Reco!","Bisous"];
string message = "faites votre choix.............."; // The newline (\n) helps to visually separate this text from the dialog heading line

key ToucherID;
integer channelDialog;

default
{
state_entry()
{
// channelDialog = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );
}

touch_start(integer num_detected)
{
ToucherID = llDetectedKey(0);

llDialog(ToucherID, message, colorChoices, channelDialog);
}
}
Citation :
Publié par MenthalOH
et tu selectionnes comment la phrase à dire ? et en quoi une notecard est plus simple ?
quand on clique sur le hud il y a un menu en fenêtre bleue qui apparait avec le début de phrase, la note card est pour modifier la phrase ce qui est plus simple que d entrer dans le script
Comme je suis allergique aux notecards qui ne simplifient en rien le bouzin dans la grande majorité des cas, et que les scripteurs ne se bousculent pas.....voilà une version sans NC mais tout aussi simple.....


list ListePhrases = [
///////////////////////////////////////////////////////////////////
//////RAJOUTEZ AUTANT DE PHRASES QUE PERMET LA MEMOIRE LIBRE////////
////////////METTRE ENTRE GUILLEMETS ET UNE VIRGULE A LA FIN/////////
//////////////////////SAUF A LA DERNIERE PHRASE/////////////////////
///////////////////////////////////////////////////////////////////
"mettre une nouvelle phrase ici",
"et puis hop",
"yfuklyfyukfu",
"blablabla",
"gloyuglyug",
"DFGFFFFFFF",
"truc bite chatte",
"pipi caca vomit",
"cépafo",
"uklygfulfgufl",
"ipoipoj",
"hfgfhfgfhfghfgfh",
"kkkkkkk",
"kuyyuft7687687687",
"7687468475435",
"bbbbbbbbbbbbbbbbbbb"
//////////////////////////////////////////////////////////////
];


list order_buttons(list buttons)
{
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) +
llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
}

DialogPlus(key avatar, string message, list buttons, integer channel, integer CurMenu)
{
if (12 < llGetListLength(buttons))
{
list lbut = buttons;
list Nbuttons = [];
if(CurMenu == -1)
{
CurMenu = 0;
menuindex = 0;
}

if((Nbuttons = (llList2List(buttons, (CurMenu * 10), ((CurMenu * 10) + 9)) + ["<<<", ">>>"])) == ["<<<", ">>>"])
DialogPlus(avatar, message, lbut, channel, menuindex = 0);
else
llDialog(avatar, message, order_buttons(Nbuttons), channel);
}
else
llDialog(avatar, message, order_buttons(buttons), channel);
}

integer menuindex;
integer channel;
integer listen_handle;

list ListeBoutons;


default
{
state_entry()
{
channel = (integer)("0xA" + llGetSubString((string)llGetKey(), 0,6 ));

llOwnerSay((string)llGetFreeMemory() + " bytes de memoire libre.\n"
+(string)llGetListLength(ListePhrases)+ " phrases listées ");
}

touch_start(integer total_number)
{
key owner = llGetOwner();

if(owner==llDetectedKey(0))
{
ListeBoutons = [];
integer i;
integer a = llGetListLength(ListePhrases);

do
{
ListeBoutons += llGetSubString(llList2String(ListePhrases, i),0,12);
}
while (++i < a);

listen_handle = llListen(channel, "", owner,"");
llSetTimerEvent(30.0);
DialogPlus(owner, "Choise une phrase", ListeBoutons, channel, menuindex = 0);
}
}

listen(integer chan, string name, key id, string msg)
{
key owner = llGetOwner();

if(msg == ">>>")
{
DialogPlus(owner, "Choise une phrase", ListeBoutons, channel, ++menuindex);
}

else if(msg == "<<<")
{
DialogPlus(owner, "Choise une phrase", ListeBoutons, channel, --menuindex);
}

else
{
llListenRemove(listen_handle);
llSetTimerEvent(0.0);

integer index = llListFindList(ListeBoutons, [msg]);
string text = llList2String(ListePhrases, index);

llSay(0,text);
}
}

timer()
{
llOwnerSay("Temps ecoulé.");
llListenRemove(listen_handle);
llSetTimerEvent(0.0);
}

changed(integer change)
{
if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
{
llOwnerSay("L'inventaire a changé ");
llResetScript();
}
}

on_rez(integer start_param)
{
llResetScript();
}
}
cc. merci je vais essayer ça super
Citation :
Publié par MenthalOH
Comme je suis allergique aux notecards qui ne simplifient en rien le bouzin dans la grande majorité des cas, et que les scripteurs ne se bousculent pas.....voilà une version sans NC mais tout aussi simple.....


list ListePhrases = [
///////////////////////////////////////////////////////////////////
//////RAJOUTEZ AUTANT DE PHRASES QUE PERMET LA MEMOIRE LIBRE////////
////////////METTRE ENTRE GUILLEMETS ET UNE VIRGULE A LA FIN/////////
//////////////////////SAUF A LA DERNIERE PHRASE/////////////////////
///////////////////////////////////////////////////////////////////
"mettre une nouvelle phrase ici",
"et puis hop",
"yfuklyfyukfu",
"blablabla",
"gloyuglyug",
"DFGFFFFFFF",
"truc bite chatte",
"pipi caca vomit",
"cépafo",
"uklygfulfgufl",
"ipoipoj",
"hfgfhfgfhfghfgfh",
"kkkkkkk",
"kuyyuft7687687687",
"7687468475435",
"bbbbbbbbbbbbbbbbbbb"
//////////////////////////////////////////////////////////////
];


list order_buttons(list buttons)
{
return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) +
llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
}

DialogPlus(key avatar, string message, list buttons, integer channel, integer CurMenu)
{
if (12 < llGetListLength(buttons))
{
list lbut = buttons;
list Nbuttons = [];
if(CurMenu == -1)
{
CurMenu = 0;
menuindex = 0;
}

if((Nbuttons = (llList2List(buttons, (CurMenu * 10), ((CurMenu * 10) + 9)) + ["<<<", ">>>"])) == ["<<<", ">>>"])
DialogPlus(avatar, message, lbut, channel, menuindex = 0);
else
llDialog(avatar, message, order_buttons(Nbuttons), channel);
}
else
llDialog(avatar, message, order_buttons(buttons), channel);
}

integer menuindex;
integer channel;
integer listen_handle;

list ListeBoutons;


default
{
state_entry()
{
channel = (integer)("0xA" + llGetSubString((string)llGetKey(), 0,6 ));

llOwnerSay((string)llGetFreeMemory() + " bytes de memoire libre.\n"
+(string)llGetListLength(ListePhrases)+ " phrases listées ");
}

touch_start(integer total_number)
{
key owner = llGetOwner();

if(owner==llDetectedKey(0))
{
ListeBoutons = [];
integer i;
integer a = llGetListLength(ListePhrases);

do
{
ListeBoutons += llGetSubString(llList2String(ListePhrases, i),0,12);
}
while (++i < a);

listen_handle = llListen(channel, "", owner,"");
llSetTimerEvent(30.0);
DialogPlus(owner, "Choise une phrase", ListeBoutons, channel, menuindex = 0);
}
}

listen(integer chan, string name, key id, string msg)
{
key owner = llGetOwner();

if(msg == ">>>")
{
DialogPlus(owner, "Choise une phrase", ListeBoutons, channel, ++menuindex);
}

else if(msg == "<<<")
{
DialogPlus(owner, "Choise une phrase", ListeBoutons, channel, --menuindex);
}

else
{
llListenRemove(listen_handle);
llSetTimerEvent(0.0);

integer index = llListFindList(ListeBoutons, [msg]);
string text = llList2String(ListePhrases, index);

llSay(0,text);
}
}

timer()
{
llOwnerSay("Temps ecoulé.");
llListenRemove(listen_handle);
llSetTimerEvent(0.0);
}

changed(integer change)
{
if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
{
llOwnerSay("L'inventaire a changé ");
llResetScript();
}
}

on_rez(integer start_param)
{
llResetScript();
}
}
c est nickel il y a un moyen pour que dans le local ce soit comme si c etais moi qui parlais et non l objet car le texte sort en vert
Citation :
Publié par stefsparta
cc. merci je vais essayer ça super
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés