Jump to content

This is Driving Me Nuts I Guess This Is What Happens When You Use scripts Already Made Because Your To Lazy To Learn Yourself Help!


MariahMaximilliana
 Share

You are about to reply to a thread that has been inactive for 224 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So I just opened a store in May of this year and started creating yard decor, which I really enjoy. However, Whenever I try to add anything with a script, something goes wrong or breaks. From falling Leaves, Windmills, Swings, and animals. Anything I add that is animated with any movement and everything blows up. 

Case in point: I am trying to add a simple Windmill to my creation; when I link everything, this is what happens to my windmill it's like off its axis. Or even better, the whole creation will start turning sometimes. So I really need some help if anyone out there has the time. At this point, the only thing I can do effectively when linking is creating stuff with no moving parts, and I really want to learn this and stop spending hours on these issues. I assume it's not hard if I can get a little help with it. Thank you so much all. If you can help me understand scripts better, I will send you some really nice gifts from my store.

Thanks all Hugs Maxi

I am pretty much on Discord most of the afternoon and evening if its easier.  

Discord Name   mariahmaximilliana

 

https://gyazo.com/a1c33c8c69ccf41442151512c915e6f2

Link to comment
Share on other sites

Yes, a large majority of the time, writing a custom script tailored for the specific task at hand will usually be more effective than using an off the shelf generic one. Knowing how to write one's own scripts is a very valuable and rewarding skill to have to SL - and fortunately there are many resources available for anyone wanting to learn. A good place to start would be the LSL 101 wikibook. It guides newcomers through the basics of scripting and assumes little to no prior programming experience.

After that, exploring the LSL wiki in general, reading the functions' documentation, and trying the examples there will be a great way to practice. If you have specific questions/problems, feel fee to ask here on the forums (though soliciting for people to give you lessons may be more appropriate for the inworld employment forum).

For your current windmill issue, a lot of it will depend on how the object is constructed. llTargetOmega is typically used to create a smooth and continuously rotating effect on objects. The function's specification tells us that if the host script is placed in a child link, then only that link will rotate around its local axis. If the script is placed in the root of the object, then the entire object will spin around the global axis. Regarding axes in Second Life, positive X is considered "forward" locally (or East globally), positive Y is considered "left" locally (or North globally) and positive Z is considered "up".

Judging from your video, the windmill fanblades seem to be their own object. I can't say for sure without seeing the object in edit mode or the script you used, but it appears as though your current script is rotating the fanblades around the global Z axis. If that's the case, then I suspect the fix for you would be as simple as zeroing out the Z component of the vector supplied to llTargetOmega and instead putting some positive number in the X component of the same vector.

Something like this:

default
{
    state_entry()
    {
        llTargetOmega(<1,0,0>,1,1);	//spin about X axis
    }
}

If that doesn't work, try switching around which part of the vector is 1 (either the X, Y or Z parts) and observe how it changes the spin.

Edited by Fenix Eldritch
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Ok, this is fantastic information. When I am off, I will try some of your suggestions above. I appreciate you stepping up and help me. I will be sending you a gift in world from my store. I hope you like it. Once I try the above, I will let you know if it works. Below is a picture of the gift I am sending you.

LAB IN FLOWERS_001.png

  • Like 3
Link to comment
Share on other sites

If you're using the llTargetOmega thingy, it only appears to rotate the prim that the script is actually in, which is nice also. It's a client-side animation, so if people have that turned off in their viewer (for some weird unknown reason) it won't appear to rotate, but everyone else can see it move. It only appears to rotate, which is fine too, because even if someone is sitting on it, they'll rotate with it.

If you need to use it to rotate a linked part of a build via interaction with a different part (like a switch of some sort) you can use the llMessageLinked function to make a script in one linked part talk to any or all other linked parts that might be listening for a command, like "ON". The script in the rotating part can then "hear" the message and turn on (or off) the rotation.

It might seem complicated at first, but it's just a sequence of simple little things, in the right order, that makes it all go.

Hope it helps you get a start~

Edited by PheebyKatz
Link to comment
Share on other sites

5 hours ago, PheebyKatz said:

If you need to use it to rotate a linked part of a build via interaction with a different part (like a switch of some sort) you can use the llMessageLinked function to make a script in one linked part talk to any or all other linked parts that might be listening for a command, like "ON". The script in the rotating part can then "hear" the message and turn on (or off) the rotation.

Regarding this point specifically, I would recommend to try making use of the various "linked" functions before resorting to llMessagedLinked between two scripts. LlMessagedLinked does have its uses, but these days it's quite possible for a single script to manipulate any other prim in the linkset via functions like llSetLinkPrimitiveParamsFast. The benefits to doing this are that you don't have to spread your logic across multiple scripts, and you avoid the extra setup/overhead of having to communicate between the scripts (and you avoid the 2nd script entirely). So it's potentially easier to code, maintain, and expand your script. Also, it's more resource efficient on the server to run fewer scripts.

Edited by Fenix Eldritch
  • Like 2
Link to comment
Share on other sites

20 hours ago, MariahMaximilliana said:

Ok, this is fantastic information. When I am off, I will try some of your suggestions above. I appreciate you stepping up and help me. I will be sending you a gift in world from my store. I hope you like it. Once I try the above, I will let you know if it works. Below is a picture of the gift I am sending you.

LAB IN FLOWERS_001.png

Just a drive-by comment, but that's adorable! 

  • Like 2
Link to comment
Share on other sites

10 hours ago, Fenix Eldritch said:

Regarding this point specifically, I would recommend to try making use of the various "linked" functions before resorting to llMessagedLinked between two scripts. LlMessagedLinked does have its uses, but these days it's quite possible for a single script to manipulate any other prim in the linkset via functions like llSetLinkPrimitiveParamsFast. The benefits to doing this are that you don't have to spread your logic across multiple scripts, and you avoid the extra setup/overhead of having to communicate between the scripts (and you avoid the 2nd script entirely). So it's potentially easier to code, maintain, and expand your script. Also, it's more resource efficient on the server to run fewer scripts.

There is this, yes. I'm just not the most up-to-date and expert scripter, so I can only relate what I know works. I've used llSetLinkPrimitiveParamsFast for a lot of stuff, actually, but I haven't really looked into using it to spin linked parts around so much yet. Heck, I still use separate scripts for headlights on my motorcycle.

When learning, my philosophy is keep it simple and learn what works first, then learn how to do it better. I'm still in the learning to do it better phase, myself.

Edited by PheebyKatz
  • Like 1
Link to comment
Share on other sites

On 10/17/2023 at 7:14 PM, Fenix Eldritch said:

 

To add onto this, if you search up "College of Scripting" in world. You will find a parcel with several levels of tutorial boards that take you through nearly every aspect of scripting and the parcel also allows rez so you can learn on site.

Edited by ItHadToComeToThis
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, ItHadToComeToThis said:

To add onto this, if you search up "College of Scripting" in world. You will find a parcel with several levels of tutorial boards that take you through nearly every aspect of scripting and the parcel also allows rez so you can learn on site.

Seconding, because yeah. I've been there and it was neato. That was years ago, I should go look again, and see if anything's different now.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 224 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...