Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stack-Heap collision in a low count list?

Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-19-2008 02:12
ok I think I've got this traced to the folowing function

CODE

fWarpPos( vector vPosGoto ){
vector vPosCurrent = llGetPos();
list vLstBase;

llLookAt( vPosGoto, 10.0, 1.0 );
llSleep( 1.0 );

while (llVecDist( vPosCurrent, vPosGoto) > 10){
vLstBase += [PRIM_POSITION, (vPosCurrent = llGetPos() + <0, 0, 10.0> * llGetRot())];
}
vLstBase += [PRIM_POSITION, vPosGoto];

llStopLookAt();
llSetPrimitiveParams( vLstBase );
}


when I first got the error the object (a default .5m diameter sphere, non physical) was ~60m east of the target coordinates, any thoughts?
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Beezle Warburton
=o.O=
Join date: 10 Nov 2006
Posts: 1,169
01-19-2008 02:17
Admittedly, I'm still learning the quirks of LSL myself.

Have you tried changing

list vListBase;

to

list vListBase = [];

Or it's likely your "while" is filling the list past the memory.


while (llVecDist( vPosCurrent, vPosGoto) > 10)
{
vListBase += [PRIM_POSITION, (vPosCurrent = llGetPos() + <0, 0, 10.0> * llGetRot())];
}
_____________________
Though this be madness, yet there is method in't.
-- William Shakespeare

Warburton's Whimsies:
In SL
Apez.biz
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
Doh!
01-19-2008 02:31
gah, nevermind... I was repeatedly calling from llGetPos, so it never advanced past the first 10m call... just kept looping the first move

corrected to
CODE

fWarpPos( vector vPosGoto ){
vector vPosCurrent = llGetPos();
list vLstBase;

llLookAt( vPosGoto, 10.0, 1.0 );
llSleep( 1.0 );

while (llVecDist( vPosCurrent, vPosGoto) > 10){
vLstBase += [PRIM_POSITION, (vPosCurrent += <0, 0, 10.0> * llGetRot())];
}
vLstBase += [PRIM_POSITION, vPosGoto];

llStopLookAt();
llSetPrimitiveParams( vLstBase );
}
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -