Floating text

Répondre
Partager Rechercher
Bonjour,
Alors voilà : je me suis mise à vendre quelques vases de ma création et pour ce faire j'y ai mis à l'intérieur un floating text qui indique son prix et le nom de l'objet.
Lors de la vente j'ai autorisé la modification des dit-vases.

Un gros souci: l'acheteur a toujours ces indications du floating text qui restent au-dessus de l'objet et ceci même si le script est supprimé puisqu'il peut modifier l'objet...

Bizarre: les objets gardent-t il- en mémoire des scripts même s'ils sont effaçés?
Car ceci je l'ai remarqué même avec d'autres sortes de scripts: ou bien y a t il un moyen que ce script disparaisse ?

2) Comment puis-je savoir qu'un acheteur m'a acheté un des objets mis en vente: car contrairement à des vendeurs JEVN: je ne reçois aucune notification à ce sujet.

Merci
Bonsoir Leetah,

Les floating texts sont des horreurs car ils restent même après suppression du script.
Pour les enlever définitivement, j'utilise un autre script à insérer puis supprimer dans l'objet.
Citation :
default
{
state_entry()
{
llSay(0, "Floating text has been removed!");
llSetText("",<0,0,0>,0.0);
}

on_rez(integer start_param)
{
llResetScript();
}
}
Pour être informer d'un achat, je te donnes un script objet vendor mais je ne l'ai pas encore testé :
Citation :
1// remove this number for the script to work.


string object_name = "TEST"; //This is the name of the object you are selling and MUST BE EXACTLY THE SAME NAME AS THAT YOU ARE WANTING TO SELL.

string Hname = "New Item";//This will be your object name used in the hovertext

string Hdes = "Great Value"; //This is your object description

vector color = <1,1,0>; //This is the color of the hover text

integer price = 10; //This is the price of your item

string Ttext = "Please right click and select pay"; //This is the touch text what people will see if they left click your vendor.



default
{
state_entry()
{
//Request permissions to debit owner's account.
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions(integer perms)
{
if(perms & PERMISSION_DEBIT)
{//Permissions have been granted so proceed.


//Set the hover text, USing the above predifind variables.
llSetText(Hname + "\n" + Hdes + "\nL$" + (string) price + "\n", color, 1);
}
else
{//Permissions was denied.

//Because permissions was denied we shall change state to give the owner a chance of resetting permissions.
state idol;
}
}
touch_start(integer total_number)
{
//When touched will say the text previously defined in the variables.
llSay(0, Ttext);
}
money(key customer, integer amount)
{
if(amount > price)
{ //if amount payed is more than price, refund the diffrence and give object.
llGiveInventory(customer, object_name);
llInstantMessage(customer, "Thank you for your purchase although you did over pay. You will be refunded the diffrence in a moment.");
llGiveMoney(customer, amount - price);


//If you wish to be notified everytime of a sale, then remove the first 2 // from the line below.

//llInstantMessage(llGetOwner(), llKey2Name(customer) + " has just purchased " + object_name + " from " + llGetRegionName() + ", " + llGetPos() ".");

}
else if(amount < price)
{//If the amount is less than the price then give back all the money and explain why.
llGiveMoney(customer, amount);
llInstantMessage(customer, "I am sorry, You never paid the correct amount of L$" + (string) price + ", Your money has been refunded.");
}
else
{//The only option left is if they pay the correct amount.

//Give object and say Thank you.
llGiveInventory(customer, object_name);
llInstantMessage(customer, "Thank you for your purchase.");

//If you wish to be notified everytime of a sale, then remove the first 2 // from the line below.

//llInstantMessage(llGetOwner(), llKey2Name(customer) + " has just purchased " + object_name + " from " + llGetRegionName() + ", " + llGetPos() ".");
}
}

on_rez(integer start_param)
{// if the vendor is picked up and replaced then reset the script
llResetScript();
}
}

state idol
{//Permission was denied.

state_entry()
{
//Give instructions to owner on how they can give the permissions again
llInstantMessage(llGetOwner(), "You have chosen not to give permissions, This vendor will now sit in an idle state.");
llInstantMessage(llGetOwner(), "If you wish to give your permission for this vendor to work accordingly, please left click the vendor.");

//Set text informing customers the vendor is not configured.
llSetText("VENDOR IS OUT OF ORDER\nIf you wish to see\nthis merchants wares\nplease contact the vendors owner.\n", <1,0,0>,1);

}
touch_start(integer total_num)
{
if(llDetectedKey(0) == llGetOwner())
{//Touched by the owner

//Reset Script to obtain permission request
llResetScript();
}
else
{//Touched by someone other than the owner

//Give instructions on how they can see owners line of products
llSay(0, "We are sorry but this vendor is currently out of order.");
llSay(0, "If you wish to see this merchants wares then please contact the owner.");
}
}

on_rez(integer start_param)
{// if the vendor is picked up and replaced then reset the script
llResetScript();
}
}
Il faut le voir comme ça: les floating text et particules sont des paramètres persistants du prim, comme la couleur ou la taille par exemple. Par contre, ils ne peuvent être settés que par des scripts.

Si tu veux les supprimer sur le nouvel objet, tu dois le mettre dans un event "on_rez", comme dans l'exemple de Phli.
Répondre

Connectés sur ce fil

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