Scripters cove
Moderators: winston, another_commander
Re: Scripters cove
Try Switeck's Shipping OXP. You will need to give the Police Vipers (or whatever) cargo capacity above zero and a fuel scoop though.
- Rese249er
- ---- E L I T E ----
- Posts: 647
- Joined: Thu Jun 07, 2012 2:19 pm
- Location: Well, I WAS in G3...
Re: Scripters cove
Grazie. I've had that for some time.
Got all turned around, lost my nav connection... Where am I now?
- Rorschachhamster
- ---- E L I T E ----
- Posts: 274
- Joined: Sun Aug 05, 2012 11:46 pm
- Contact:
Re: Scripters cove
Hi all!
I just started with my first OXP, a ship. I built it in wings3d, turned it upsite-down, when it was orientated to the wrong end of the y axis (*cough*), and coded the script after the how-to at the wiki, and then I looked at it's tiny size and made the model a lot bigger, and it finally works.
The problem is, when I put into the code the coordinates that I can pinpoint in the original model in wings3d, it won't work as expected.
E.g., if I put the coordinates I took for the muzzle of the laser from the model in wings 3d into weapon_position_forward, I have x -4.065 y -2.58 and z 26.42. BUT this comes out a long way too low, too starboardish and too much in front. I started to try to slowly approach the correct position by reloading, changing the coordinates, reloading... etc., but... I am getting frustrated.
Well, at least the exhaust was easy...
Somebody here can give me a hint? Please?
I just started with my first OXP, a ship. I built it in wings3d, turned it upsite-down, when it was orientated to the wrong end of the y axis (*cough*), and coded the script after the how-to at the wiki, and then I looked at it's tiny size and made the model a lot bigger, and it finally works.
The problem is, when I put into the code the coordinates that I can pinpoint in the original model in wings3d, it won't work as expected.
E.g., if I put the coordinates I took for the muzzle of the laser from the model in wings 3d into weapon_position_forward, I have x -4.065 y -2.58 and z 26.42. BUT this comes out a long way too low, too starboardish and too much in front. I started to try to slowly approach the correct position by reloading, changing the coordinates, reloading... etc., but... I am getting frustrated.
Well, at least the exhaust was easy...
Somebody here can give me a hint? Please?
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Scripters cove
Generally the coordinates in Wings3D are the same as in Oolite. So: 1 unit in Wings = 1 meter in Oolite.
Obvious question: have you got your x- and y-axes right? x is left-right, y is up-down.
Also, I think there's still an inconsistency between Wings3D and Oolite, in that the x-axis points in the opposite direction. Thus, x -4.065 in Wings will change into X 4.065 in Oolite.
Obvious question: have you got your x- and y-axes right? x is left-right, y is up-down.
Also, I think there's still an inconsistency between Wings3D and Oolite, in that the x-axis points in the opposite direction. Thus, x -4.065 in Wings will change into X 4.065 in Oolite.
- Rorschachhamster
- ---- E L I T E ----
- Posts: 274
- Joined: Sun Aug 05, 2012 11:46 pm
- Contact:
Re: Scripters cove
Tha x axis thing I already realized the hard way. Thanks.
I think I'll try to resize that ship again (could be a little bigger, still) and then try it with the new coordinates... wish me luck.
I think I'll try to resize that ship again (could be a little bigger, still) and then try it with the new coordinates... wish me luck.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Scripters cove
What strikes me with your laser coordinates is that they're excentric. x = -4.065 means that the laser muzzle is not in the centre of the ship, but slightly to the left of the centre. Is this deliberate? If it's a single laser, I'd usually suspect it to be at x = 0. For the forward view position I'd also usually expect x = 0. Second, I'd expect view position y > weapons position y. Thus the laser appears to originate from the bottom centre of the screen.
Are you using external views for testing the positions? I'd recommend that. When using the normal forward view, you also have to take the view position into account.
Finally: it is not overly important that the laser's z position is correct. On the contrary, I'd advise that you let the laser beam begin somewhere inside the ship, thus with z < 26.42. This is to make sure that the beam originates indeed from the bottom of the screen. If you put the laser origin too much forward, inside the field of view of the screen, the player will see the beam starting abruptly at some point on the screen, which looks odd in my opinion. Here two screenshots for comparison:
First my normal shipdata, weapons position z about 15m behind view position z:
Then a tweaked shipdata, weapons position z about 15m in front of view position z:
To me the second one looks odd. I like the first one better.
Are you using external views for testing the positions? I'd recommend that. When using the normal forward view, you also have to take the view position into account.
Finally: it is not overly important that the laser's z position is correct. On the contrary, I'd advise that you let the laser beam begin somewhere inside the ship, thus with z < 26.42. This is to make sure that the beam originates indeed from the bottom of the screen. If you put the laser origin too much forward, inside the field of view of the screen, the player will see the beam starting abruptly at some point on the screen, which looks odd in my opinion. Here two screenshots for comparison:
First my normal shipdata, weapons position z about 15m behind view position z:
Then a tweaked shipdata, weapons position z about 15m in front of view position z:
To me the second one looks odd. I like the first one better.
- Rorschachhamster
- ---- E L I T E ----
- Posts: 274
- Joined: Sun Aug 05, 2012 11:46 pm
- Contact:
Re: Scripters cove
The right tilt of the originating laser is deliberate (the model has a laser slightly on the right from the main body). I'll try with the z axis, I was irrational afraid, the laser could hurt my ship...
I just tried to use the coordinates, this time, the laser just originated too much in front. So, if it doesn't harm my ship , it should work by reducing the z axis just a little more... Missiles start still to much away from where I want them, but the exhaust fit s spot on...
I just tried to use the coordinates, this time, the laser just originated too much in front. So, if it doesn't harm my ship , it should work by reducing the z axis just a little more... Missiles start still to much away from where I want them, but the exhaust fit s spot on...
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Scripters cove
Useful to know: the laser position moves back on the z-axis when the ship moves. The faster the speed, the more the laser moves backwards. The reason is that your ship has already moved forward a little when the laser gets drawn, after you press the button. It is especially noticeable for the aft laser, which will look like the second screen shot at high speed, if it's z-position isn't sufficiently greater than the view position z-position.
This is also the reason why side lasers "wander" towards the back of the ship when flying at speed.
This is also the reason why side lasers "wander" towards the back of the ship when flying at speed.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Scripters cove
Missiles are not fully following the coordinates. If they are positioned inside the bounding box, they are moved outward on addition. And for some ships, the bounding box is much bigger than the ships surface.Rorschachhamster wrote:Missiles start still to much away from where I want them,....
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Rorschachhamster
- ---- E L I T E ----
- Posts: 274
- Joined: Sun Aug 05, 2012 11:46 pm
- Contact:
Re: Scripters cove
Ok. Good to know.Eric Walch wrote:Missiles are not fully following the coordinates. If they are positioned inside the bounding box, they are moved outward on addition. And for some ships, the bounding box is much bigger than the ships surface.
Is there an easy way to alternate the place the missiles start from? Say, first missile starts on the right side, the next on the left and ad finitum? Or even just random starting from one side or the other?
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Scripters cove
What is easy? It depends on the person.
Since 1.75 we have an event for the ship firing a missile.
When you give the ship a shipScript, you can use this to relocate missiles on launch and override the original location.
Since 1.75 we have an event for the ship firing a missile.
Code: Select all
this.shipFiredMissile = function (missile, target){}
Last edited by Eric Walch on Sat Nov 03, 2012 10:44 pm, edited 1 time in total.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: Scripters cove
If you want an example of one, Griff and I put just such a thing together a while back (the Cobra with external missiles). It's the second one in Griff's download area (here), although you will probably need the rest of his normal map ship pack installed too.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Scripters cove
That Cobra is great - I always enjoy watching those missiles launch, especially up-close!Thargoid wrote:If you want an example of one, Griff and I put just such a thing together a while back (the Cobra with external missiles).
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- Rorschachhamster
- ---- E L I T E ----
- Posts: 274
- Joined: Sun Aug 05, 2012 11:46 pm
- Contact:
Re: Scripters cove
I have his ships installed!Thargoid wrote:If you want an example of one, Griff and I put just such a thing together a while back (the Cobra with external missiles). It's the second one in Griff's download area (here), although you will probably need the rest of his normal map ship pack installed too.
And I will look into it. Downloading...
At the moment, the missiles start a few meters away from their launchpad, (outside the bounding box, probably ), but as I finally managed to put them at least right in front of the launch pad the look of it is ... well, acceptable.
Edit: OK, that's definitely out of my league... Is there a way to built a second missile_launch_position into the shipdata.plist and then alternate?
- Wildeblood
- ---- E L I T E ----
- Posts: 2455
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Scripters cove
Something like...?Eric Walch wrote:What is easy? It depends on the person.
Since 1.75 we have an event for the ship firing a missile.When you give the ship a shipScript, you can use this to relocate missiles on launch and override the original location.Code: Select all
this.shipFiredMissile = function (missile, target){}
Code: Select all
this.shipFiredMissile = function (missile, target) {
if (this.launch == "odd")
{
this.launch = "even";
missile.position.x = missile.position.x - 20;
}
else // this.launch == "even"
{
this.launch = "odd";
missile.position.x = missile.position.x + 20;
}
}