Page 1 of 3
[WIP] freighttrain
Posted: Tue Jan 22, 2013 9:45 pm
by Rorschachhamster
I made something...
Freighttrain-not-even-alpha
Ok, after having no real idea about JavaScript and scripting in something newer than virtual basic and too much time at hand, I decided I want some freighttrains in my Ooniverse... so I looked at and took from quite a lot of scripts, mostly from Thargoid (YAH Mobile and Stellar Serpent, and the look-in-the-direction-of-the-target thing from TrackerCam (I still don't really know how Quaternions work...
))*, took a scripting sledgehammer, read a lot, and tried to get it to work. And it works. Mostly. As of now, I have a random number of trailers following a traction engine, wich is spawned near the a station at launch. Looks quite nifty, if I'm allowed to say so.
Look:
from far away...
press release...
Launching twice will have funny results, I will have to script something that only one train is in a system at the same time. At least I know how to do that. ... Well, I know where to look.
Thanks for the info on the wiki.
Ok, there's still a lot of work, and one thing in particular evades me (Quaternions), that is that the
relative upwards orientation of the trailers should match the one from the traction engine.
It stays that way...
One rather hamfisted solution I considered would be to redesign the trailer to a design without UP, maybe even have it rotating... don't have the slightiest idea how and if that would interfere with the direction to the mother ship thing from TrackerCam...
Then theres AIs, but I think I can gather more than the rudimentary things I wrote/copied from looking at OXPs. It flees and cries for help if it is shot at. The released version will propably need a number of escorts.
Ideas/hints/comments how to do the script better and more stable (I had one trailer disconnected once, even though it worked later on flawless...) are more than welcome. Just take a peek and delete the OXP afterwards.
* Look at the number of the brackets. I learned the hard way...
Re: [WIP] freighttrain
Posted: Tue Jan 22, 2013 10:56 pm
by GGShinobi
I haven't tested it yet, but it looks cool! Good idea!!
Re: [WIP] freighttrain
Posted: Tue Jan 22, 2013 11:47 pm
by Shipbuilder
Great idea and I really do like the look of this ship.
Scripting is not really one of my strengths at the moment so I will leave the scripting comments to those with more knowledge but I just wanted to say how I like the style of your ships.
Re: [WIP] freighttrain
Posted: Wed Jan 23, 2013 7:48 am
by Diziet Sma
That looks totally awesome! (apologies for using that much-abused term, but in this case it's deserved)
<pedantic_ex-railways_freightclerk_mode>
The only thing I'd suggest is that the engine should look distinctly different from the trailers (although if you want to go with the train theme, they really should be called wagons.
) By all means use a similar livery and style as the trailers, but a freight-engine should
look like an engine.
</pedantic_ex-railways_freightclerk_mode>
This is
so having a place in my Ooniverse!
Re: [WIP] freighttrain
Posted: Wed Jan 23, 2013 9:18 am
by Massively Locked
This is very cool! The only problem I had with it was that it killed my framerate (down to about 5). I would definitely like to see you continue developing this.
Re: [WIP] freighttrain
Posted: Wed Jan 23, 2013 11:24 am
by Rorschachhamster
Diziet Sma wrote:That looks totally awesome! (apologies for using that much-abused term, but in this case it's deserved)
<pedantic_ex-railways_freightclerk_mode>
The only thing I'd suggest is that the engine should look distinctly different from the trailers (although if you want to go with the train theme, they really should be called wagons.
) By all means use a similar livery and style as the trailers, but a freight-engine should
look like an engine.
</pedantic_ex-railways_freightclerk_mode>
This is
so having a place in my Ooniverse!
Thanks! Speaking German myself, I wasn't sure if the term "wagon" would be right. And I already started a second model of an engine, if I can't get the orientation thingy right, I will go for something more like this:
(from the italian wikipedia...)
With rotating wagons ... only then would trailer be adequate, wouldn't it?
MAYBE I'll redo the one I have, too... and try to get them work alongside, so you could have both! On the other hand... this would be even worse for the framerate...
@ML: Yeah, I figured as much (but forgot to remark it), as it is quite cumbersome, graphicswise and in scripting, for slower machines. Maybe try turning the smooth off in the shipdata.plist, don't know wether that helps.
Still a long way to go...
EDIT: Oh, and I found out why trailers (or wagons?) after number 6 would be left behind and fixed it. In the trailer.js there is in line 106
Code: Select all
this.ship.position = trailer6.position.subtract(this.ship.vectorForward.multiply(410));
and it should read like this:
Code: Select all
this.ship.position = trailer6.subtract(this.ship.vectorForward.multiply(410));
I looked at that before and didn't see it...
Re: [WIP] freighttrain
Posted: Wed Jan 23, 2013 3:24 pm
by pagroove
Ubercool. Looking forward to the final release. But it will be in my Ooniverse when it's ready.
Re: [WIP] freighttrain
Posted: Wed Jan 23, 2013 4:33 pm
by Diziet Sma
Rorschachhamster wrote:(from the italian wikipedia...)
With rotating wagons ... only then would trailer be adequate, wouldn't it?
Wagons would still be correct usage. (Unless you planned to call it
Space Truckers)
Re: [WIP] freighttrain
Posted: Thu Jan 24, 2013 4:02 pm
by dschofield
I'm new to all this, but had been thinking about something on the same lines... Making your ship the "wagon" and doing missions to deliver a trailer (or trailers) to a destination.
Re: [WIP] freighttrain
Posted: Thu Jan 24, 2013 6:45 pm
by Cody
Hi dschofield and welcome aboard.
Our apologies for taking so long to approve your first post - I'll blame the forum software.
Re: [WIP] freighttrain
Posted: Thu Jan 24, 2013 9:22 pm
by Rorschachhamster
dschofield wrote:I'm new to all this, but had been thinking about something on the same lines... Making your ship the "wagon" and doing missions to deliver a trailer (or trailers) to a destination.
I thought about doing, perhaps, if I find the time, some missions, too... something like that would be a possibility but probably not so easy to do... hm... maybe an equipment that allows you to catch lost wagons (@Diziet Sma: Yes, I renamed them! And I'm working, just for fun, on a new engine after having googled pictures of futuristic trains...). Or asteroids, or even abandoned ships...
THIS is the dark side, oviously...
Re: [WIP] freighttrain
Posted: Sat Jan 26, 2013 7:18 pm
by Griff
Woah, those look fantastic! Really amazing design- these are going to look amazing travelling through the system, they also look really explodable, dobt i could resist firing a missile or two at them just to see them all explode
Re: [WIP] freighttrain
Posted: Sun Jan 27, 2013 12:55 pm
by GGShinobi
Griff wrote:Woah, those look fantastic! Really amazing design- these are going to look amazing travelling through the system, they also look really explodable, dobt i could resist firing a missile or two at them just to see them all explode
LOL
I wanna have them, too! Hope the framerate issues will be resolved!
Re: [WIP] freighttrain
Posted: Sun Jan 27, 2013 2:42 pm
by Rorschachhamster
Griff wrote:Woah, those look fantastic! Really amazing design- these are going to look amazing travelling through the system, they also look really explodable, dobt i could resist firing a missile or two at them just to see them all explode
Did that a lot... for testing purposes only, of course. "Run, little train, run!"
But they are really robust, it takes one and a half turns with a military laser to blow one. Just like a train wagon is a lot more robust even than a truck... and try to not bumb into them. They have a greater density than normal ships.
Didn't do a lot scripting, but they spawn randomly on the wp - station aegis route now - plan is to make the script to scan for stations (oxp and otherwise) and put them on a random route... so you don't see one everytime on the usual way into the system. And escorts, of course, wich is obviously a must. Last time, I saw one, it was just three lost wagons.
Framerate... I just realised, after having made a gorgous model with a lot of combined objects, I did my wings3d ships with all internal faces of combined objects intact. This means there are a lot of unnecessary faces, that you won't see at all... Does anybody now a quick way to delete them?
If not, I will probably have to do them all over again...
And I really have to look into shaders and all that stuff... especially decals with logos from YAH would be cool...
Re: [WIP] freighttrain
Posted: Sun Jan 27, 2013 7:04 pm
by Shipbuilder
You can define these hidden faces as holes.
To do this select the face or faces that you want to hide, right click and select hole.
Hope that this helps.