Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Why I dont work?! Selling objects...

Flavio Richez
Registered User
Join date: 9 Dec 2006
Posts: 25
12-14-2006 17:06
Hello people,

I just create my first object to sell. It's nothing special, a little kind of food from Brazil (we call pastel).

Here's my problems:

1) I created the object, attached a script (see below) and a wave sound. When someone buy the object, it list all the contents (the script and wave). Can I make the contents not showed in the buying interface?

2) My idea for the script is the following:

The man buy it. And when he WEAR it, it starts an animation to simulate that he is eating, and show a message and play the wave sound (the message and sound only when he wear - only this time).

Here's the script:

// Pastel da feira script v.0.1
// 14/12/2006
// By Flavio Richez
// Based on "Blood Mary" script

string anim ="drink";
string anim2 ="hold_R_handgun";
string sound = "FeiradaFruta";

default
{
attach(key victim)
{
if(victim == NULL_KEY)
{
llStopAnimation(anim);
llStopAnimation(anim2);
llSetTimerEvent(0);

}
else
{
integer is = llGetAttached();
if (is != 0) {
llRequestPermissions(victim,PERMISSION_TRIGGER_ANIMATION);
}
}
}

run_time_permissions(integer permissions)
{
if (PERMISSION_TRIGGER_ANIMATION & permissions)
{
llWhisper(0,"Aproveite o verdadeiro pastel da feira! Sem gordura trans!";);
llPlaySound(sound, 1.0);
llStartAnimation(anim);
llStartAnimation(anim2);
llSetTimerEvent(15);
}
}

timer()
{
llStartAnimation(anim2);
llStartAnimation(anim);
}

}

THE PROBLEM:

When I (the creator) wear it, it works well (play the music and shows the message). But when other people wear it, neither the animations, sound or message works!

What can I do?

Hope you can help me!

Thanks
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
12-14-2006 17:12
one problem:

if (PERMISSION_TRIGGER_ANIMATION & permissions)

should be

if (PERMISSION_TRIGGER_ANIMATION && permissions)
Dragon Eccleston
Registered User
Join date: 25 Dec 2005
Posts: 42
12-14-2006 17:17
From: Geuis Dassin
one problem:

if (PERMISSION_TRIGGER_ANIMATION & permissions)

should be

if (PERMISSION_TRIGGER_ANIMATION && permissions)

No the way he has it with bitwise & is right, throw a few say's or whispers in there and make sure it's going thru the paces when you give it to someone else, try to find out what isn't firing right.
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
12-14-2006 17:21
ah you are right. forget bitwise comparisons are different
Flavio Richez
Registered User
Join date: 9 Dec 2006
Posts: 25
Ok but...
12-14-2006 17:25
What can it happens? :/

Another thing:

Can I put in the script to when it just buyed, to attach to the right hand instantly?

Thanks
Flavio Richez
Registered User
Join date: 9 Dec 2006
Posts: 25
Here's the script with "debug" stuff
12-14-2006 17:30
// Pastel da feira script v.0.1
// 14/12/2006
// By Flavio Richez
// Based on "Blood Mary" script

string anim ="drink";
string anim2 ="hold_R_handgun";
string sound = "FeiradaFruta";

default
{
state_entry() {}

attach(key victim)
{
if(victim == NULL_KEY)
{
llWhisper(0, "NULLKEY";);
llStopAnimation(anim);
llStopAnimation(anim2);
llSetTimerEvent(0);

}
else
{
llWhisper(0, "NOT NULLKEY";);
llRequestPermissions(victim,PERMISSION_TRIGGER_ANIMATION);
}
}

run_time_permissions(integer permissions)
{
if (PERMISSION_TRIGGER_ANIMATION & permissions)
{
llWhisper(0,"RUN_TIME_PERMISSIONS";);
llPlaySound(sound, 1.0);
llStartAnimation(anim);
llStartAnimation(anim2);
llSetTimerEvent(15);
}
}

timer()
{
llWhisper(0, "TIMER";);
llStartAnimation(anim2);
llStartAnimation(anim);
}

}



---------

What happens:

When someone buy it and wear it, NOTHING HAPPENS!

When he deattached, it shows the messages:

NOT NULLKEY
NULLKEY
RUN_TIME_PERMISSIONS

I really really dont know what's happening :/
Flavio Richez
Registered User
Join date: 9 Dec 2006
Posts: 25
Found The Problem
12-14-2006 18:05
He he he... :]

My terrain was check to not allow residents to run scripts. hehehe

Sorry :D
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-14-2006 20:06
From: Flavio Richez
He he he... :]

My terrain was check to not allow residents to run scripts. hehehe

Sorry :D

No problemo ;)
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
12-14-2006 20:31
Flavio let us know when them pastels are ready to eat because you have one hungry customer already. :D

-peekay

ps. and some Bohemia beer please.