Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Best way to get started?

Jadelynn Koala
Registered User
Join date: 23 Mar 2005
Posts: 7
04-27-2005 13:00
What's the best way to get started scripting poseballs? Never scripted or programmed anything before! Any suggestions?
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-27-2005 13:18
If you've never scripted before maybe you would want to start with some of the free poseball scripts available first. That way you can see the code and what it does.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-27-2005 13:19
One:
http://secondlife.com/badgeo/wakka.php?wakka=llAvatarOnSitTarget

Two:
http://secondlife.com/badgeo/wakka.php?wakka=llRequestPermissions

Three:
http://secondlife.com/badgeo/wakka.php?wakka=run_time_permissions

Four:
http://secondlife.com/badgeo/wakka.php?wakka=llStopAnimation

Five:
http://secondlife.com/badgeo/wakka.php?wakka=llStartAnimation

Or something like this:
CODE

string name = "Animation Name Here";

default
{
changed(integer change)
{
if(change & CHANGED_LINK)
{
key agent = llAvatarOnSitTarget();
if(agent)
llRequestPermissions(agent,PERMISSION_TRIGGER_ANIMATION);
else
llStopAnimation(name);
}
}

run_time_permissions(integer perm)
{
if(perm)
{
llStopAnimation("sit");
llStartAnimation(name);
}
}
}

Written out-of-world, but that's the jist of it.
_____________________
---
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
04-27-2005 14:05
The above script while basic will have some undesired side effects. Please use the one below.

CODE

key user;
string anim = "man-sitting";
integer perms = PERMISSION_TRIGGER_ANIMATION;

default
{
state_entry()
{
llSitTarget(<0,0,0.00001>,<0,0,0,1>);
}
changed(integer change)
{
if (change & CHANGED_LINK)
{
llSleep(0.01);
key sit = llAvatarOnSitTarget();
integer u = ((llGetAgentSize(user) != ZERO_VECTOR) && (llGetPermissions() & perms) == perms) );
if(sit == NULL_KEY)
{
user = NULL_KEY;
if(u)
llStopAnimation(anim);
}
else if(!u)
llRequestPermissions(sit, perms);
}
}
run_time_permissions(integer perm)
{
key sit = llAvatarOnSitTarget();
if((perm&perms) != perms || llGetAgentSize(sit) == ZERO_VECTOR || sit!=llGetPermissionsKey())
{
user = NULL_KEY;
return;
}
user = sit;
llStopAnimation("sit");
llStartAnimation(anim);
}
}
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-28-2005 15:26
Come now, Strife. The occasional Blue Bar of Death isn't so bad... :D
_____________________
---
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
04-28-2005 17:44
I think strife has a kinda "sit thing" going

*ducks*

/esc
_____________________
http://slurl.com/secondlife/Together
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
04-28-2005 17:47
damn but i notice the little sleep went in before llAvatarOnSitTarget() ... ;)

*omg double ducks*

/esc
_____________________
http://slurl.com/secondlife/Together