[Opensim-users] llSetPrimitiveParams doesnt work anymore
Chris
mewtwo0641 at gmail.com
Thu Mar 27 20:47:46 UTC 2014
A loop is fine as far as I can tell; so long as you don't use an
infinite loop (e.g. while(1) ) A timer() event in conjunction with
llSetTimerEvent() would be better if you needed something to run
indefinitely or for a really long period of time; as loops completely
tie your script up, preventing other events and such from firing until
the loop is finished or is broke out of. As such, I try to avoid loops
if I know they're going to take longer than a second or so to complete,
but that is my own personal preference.
As for llSetLinkPrimitiveParamsFast(), it is faster because it doesn't
have the 0.2 second sleep penalty that llSetPrimitiveParams() does :)
This is true both on OpenSim as well as on SL.
On 3/27/2014 3:31 PM, Fred Folkerts wrote:
> After using llSetLinkPrimitiveParamsFast everything went well.
> This one is very much faster then llSetPrimitiveParams.
> Together with llGetPrimitiveParams([PRIM_SIZE, PRIM_TYPE]) and
> llList2Vector(params,3) I can detect and control the cutting level
>
> I still use the loop.
> I'm not a very good programmer, so I keep it this way.
> Thanks for the help, Fred
>
>
> -----Oorspronkelijk bericht----- From: Chris
> Sent: Thursday, March 27, 2014 2:31 PM
> To: opensim-users at lists.berlios.de
> Subject: Re: [Opensim-users] llSetPrimitiveParams doesnt work anymore
>
> Yes I agree, loops with sleeps or functions that incur sleep penalties
> will quickly cause the script to appear to "hang up" eventually. Try
> llSetLinkPrimitiveParamsFast instead. If you need it to only apply to
> the prim that the script is in, use LINK_THIS. If you for some reason
> need the delay, try using a timer with llSetLinkPrimitiveParamsFast, and
> a count variable, stopping the timer after the count variable has
> reached a specific number of steps.
>
> On 3/27/2014 6:55 AM, Melanie wrote:
>> Don't use loops with functions that incur time penalties. Use timers
>> instead. Loops will tie up the script threads until no scripts will
>> run anymore.
>>
>> Melanie
>>
>> On 27/03/2014 12:48, Fred Folkerts wrote:
>>> Hello,
>>>
>>>
>>> I want to make use of a script for opening a door using
>>> llSetPrimitiveParams.
>>> After a whyle the script does not react anymore on touching.
>>> This happen for example with the following script:
>>>
>>> vector cut = < 0, 0.25 , 0 >;
>>> float step = .015;
>>>
>>> default {
>>> touch_start(integer total_number) {
>>> do {
>>> cut.x += step;
>>> llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER,
>>> PRIM_HOLE_DEFAULT, //hole_shape
>>> cut, // cut
>>> 0.95, // hollow
>>> < 0.0, 0.0, 0.0 >, // twist
>>> < 1.0, 1.0, 0.0 >, // top_size
>>> < 0.0, 0.0, 0.0 >]);
>>> }
>>> while (cut.x > 0 && cut.x < .75);
>>> step *= -1;
>>> }
>>> }
>>> When using a new prim with the same script, it works again!
>>> Using the do-while loop in a function it most times doesnt work at all.
>>> Fred / OSGRID
>>>
>>>
>>>
>>> _______________________________________________
>>> Opensim-users mailing list
>>> Opensim-users at lists.berlios.de
>>> https://lists.berlios.de/mailman/listinfo/opensim-users
>> _______________________________________________
>> Opensim-users mailing list
>> Opensim-users at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/opensim-users
>
>
--
OpenSim: 10 Region Standalone on 0.7.6 Dev
Physics: Open Dynamics Engine
OS: Windows 7 (x64)
CPU: AMD Phenom II X4 840 3.2 GHz
Memory: 11 GB DDR3
Database: MySQL 5.1.63 (x64)
More information about the Opensim-users
mailing list