Jump to content

Script Problem


Nightmare Balestra
 Share

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

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

Recommended Posts

Hi Everyone, I have an animated spaceship that can go forward, back. left and right. It worked perfect when I got it, but I decided to add a prim to it and it has started going backwards when I should be going forwards. I can still go left and right fine, but the forwards and backwards are reversed since I added the prim. Anyone have any ideas? Do I need to change something in the script? Thanks so much.

Link to comment
Share on other sites

Steph is right.  If you can't see into the script to modify it, then you are taking a chance when you do anything to change the linkset. If a scripter addresses links by number, you can't change the numbers and expect things to work properly.  Adding or removing a prim will almost certainly mess up the script unless you can get in to modify it. 

Link to comment
Share on other sites

Before you do anything else, try adding the prim again, but this time make sure you link it as a child prim.   That is, select the new prim first, and then select the spaceship, and then link them.

Vehicle scripts (which I assume we're talking about here) by default move the vehicle on the assumption that Forwards means "on the root prim's positive x axis.  

I don't know if this is the problem but what you describe is exactly what I'd expect to happen if the orientation of the spaceship's root prim were to change and then change back when you unlink the prim and the root prim reverts to what it was when things were working OK.

 

Link to comment
Share on other sites

You wouldn't need to modify any "forward" or "backward" lines.  You'd need to rewrite all of the places where the script looks for specific link numbers, to be sure that they correspond to the proper ones in your altered model.  The best way to do it is to change all such references to look for prims by name instead of by number.  Depending on the script and on the complexity of your model, that could be a frustrating job, especially if you don't have much experience as a scripter. You'd need to give each link that you want to address a unique name and then write code to recognize those names as you need to move them.

Link to comment
Share on other sites

Always add prims as childs, never as root. If you add as root you will break every spaceship.

If you add as child there is still a small chance to break things if the creator has used hard wired link numbers for internal communication. In this case the spaceship should have been no mod by my opinion.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3001 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...