Model Checking, Fitting, And Testing
Moderators: winston, another_commander
Model Checking, Fitting, And Testing
This may have been discussed before, but I can't find it. One of the biggest problems I'm having is getting a new ship up in the game to test it, without it flying away from me, or just not showing up at all. I have one ship that the DebugConsole won't even let me bring up, and I'm not sure why. Anyway, is it possible to write some kind of program that would allow builders to put their ships into a vacuum, like space, and be able to manipulate it in ways like, inserting a docking bay, or ball turret, or anything else one might want to add to an already built ship? This going from the shipdata.plist into the game to see if you wrote out the quaternion correctly to fit the item onto/into the ship is a real pain. Maybe I'm asking too much, but I needed to ask. Thanks.
Re: Model Checking, Fitting, And Testing
For the purposes of testing just give your ship either nullAI.plist or dumbAI.plist as their AI. Then they'll either just sit there in space or will sit there tumbling. No flying away or anything like that. And if you want to do it on the fly for a ship spawned from the console, just use this.T.switchAI("yourAInamehereAI.plist") . this.T is the variable assigned to the ship you spawned in the console.
Or alternatively, target the ship in question and then just PS.target.switchAI("yourAInamehereAI.plist") .
As for the ship not appearing, that will mean that there's something either wrong with it or blocking it (for example a condition within shipdata.plist not being met). Check your latest.log for possibly more information of what's gone wrong.
Also once a ship is spawned, it's not possible to add sub-entities to it (although you can restore removed or destroyed ones). The sub-ents are defined in shipdata.plist for the ship, and can't be added to on the fly.
Or alternatively, target the ship in question and then just PS.target.switchAI("yourAInamehereAI.plist") .
As for the ship not appearing, that will mean that there's something either wrong with it or blocking it (for example a condition within shipdata.plist not being met). Check your latest.log for possibly more information of what's gone wrong.
Also once a ship is spawned, it's not possible to add sub-entities to it (although you can restore removed or destroyed ones). The sub-ents are defined in shipdata.plist for the ship, and can't be added to on the fly.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Model Checking, Fitting, And Testing
Protip: you can just writeThargoid wrote:And if you want to do it on the fly for a ship spawned from the console, just use this.T.switchAI("yourAInamehereAI.plist") . this.T is the variable assigned to the ship you spawned in the console.
T.switchAI…
.Also, while docked, you can use
:test your-ship-role
to show your ship on a mission screen.E-mail: [email protected]
Re: Model Checking, Fitting, And Testing
Ahruman wrote:Protip: you can just writeThargoid wrote:And if you want to do it on the fly for a ship spawned from the console, just use this.T.switchAI("yourAInamehereAI.plist") . this.T is the variable assigned to the ship you spawned in the console.T.switchAI…
.
Also, while docked, you can use:test your-ship-role
to show your ship on a mission screen.
Hmmm, okay. I tried that T.switchAI command, but looking at yours, I'm pretty sure I did it wrong. Nothing new there. As for the other ship, the one that won't appear? I checked Latest.log straight off, but it isn't showing a problem with the oxp. Unfortunately, it's not a player ship, which makes it even more difficult to get it set up right, though I managed all the ball turrets on the Andricothere. The one that won't show up may be in the Behemoth class. Does that make a difference? I call it the Andricothere Dreadnaught, as it is quite a bit bigger than the already big Andricothere.Thargoid wrote:For the purposes of testing just give your ship either nullAI.plist or dumbAI.plist as their AI. Then they'll either just sit there in space or will sit there tumbling. No flying away or anything like that. And if you want to do it on the fly for a ship spawned from the console, just use this.T.switchAI("yourAInamehereAI.plist") . this.T is the variable assigned to the ship you spawned in the console.
Or alternatively, target the ship in question and then just PS.target.switchAI("yourAInamehereAI.plist") .
As for the ship not appearing, that will mean that there's something either wrong with it or blocking it (for example a condition within shipdata.plist not being met). Check your latest.log for possibly more information of what's gone wrong.
Also once a ship is spawned, it's not possible to add sub-entities to it (although you can restore removed or destroyed ones). The sub-ents are defined in shipdata.plist for the ship, and can't be added to on the fly.
I haven't tried the mission screen out, though I looked at the instructions for using it. Somehow the way you just put it made it clearer. Don't know why, but thanks.
Re: Model Checking, Fitting, And Testing
I tried the "Mission Screen" option, and got on to it. However, my ship is so far away, or so diminished in size that I can barely make it out at all. Is there a way to zoom?
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Model Checking, Fitting, And Testing
It should be scaled to fit the available space. Try
console.debugFlags ^= console.DEBUG_BOUNDING_BOXES
and see how much space it’s actually taking up. (The same command again will turn bounding boxes off.)E-mail: [email protected]
Re: Model Checking, Fitting, And Testing
The result was.. well let me show you:Ahruman wrote:It should be scaled to fit the available space. Tryconsole.debugFlags ^= console.DEBUG_BOUNDING_BOXES
and see how much space it’s actually taking up. (The same command again will turn bounding boxes off.)
I can undo that, as you said, but as you can see, it doesn't resolve the problem. The ship in the game is big enough to be a small carrier, as it was meant to be.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Model Checking, Fitting, And Testing
Either your ship is very pointy and very dark, or it has some stray geometry off in the distance and you need to clean up your model. :-)
E-mail: [email protected]
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Re: Model Checking, Fitting, And Testing
Is it the Monolith from 2001: A Space Odyssey? (because the ratio for that I think was 9, 4, 1)mandoman wrote:The result was.. well let me show you:Ahruman wrote:It should be scaled to fit the available space. Tryconsole.debugFlags ^= console.DEBUG_BOUNDING_BOXES
and see how much space it’s actually taking up. (The same command again will turn bounding boxes off.)
I can undo that, as you said, but as you can see, it doesn't resolve the problem. The ship in the game is big enough to be a small carrier, as it was meant to be.
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Model Checking, Fitting, And Testing
It looks like you added a subEntity far outside the ships dimensions, or in the ship itself it something wrong, As Ahruman says, the ships displayed on the mission screens are sized to fit.mandoman wrote:I can undo that, as you said, but as you can see, it doesn't resolve the problem. The ship in the game is big enough to be a small carrier, as it was meant to be.
The good and close view is also why I like to evaluate the ships on the mission screen. You can even access the model by using:
mission.displayModel
.e.g.
mission.displayModel.subEntities[0].position = [x,y,z]
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: Model Checking, Fitting, And Testing
See, you learn something new every day Thanks.Ahruman wrote:Protip: you can just writeT.switchAI…
.
Another useful command is
S.countShipsWithRole("yourRoleHere")
, which will count the number of ships in the current system with the given role (S
is JS console shorthand for system
, similarly P
is short for player
and PS
for player.ship
).So if you think you've spawned a ship but nothing appears (in-game or in the logs) you can use that command to count the number of ships in the system with that role. If it's a unique role and the count is 1, then it is in existence somewhere abouts, and if count is 0 then it isn't.
If it does exist, you can refer to it by
S.shipsWithRole("yourRoleHere")[0]
. The first part of the command finds all the ships in the system with the given role and puts them into an array, and the [0] on the end refers specifically to the first element in that array (in this case it will be the closest ship with that role). You can then do things like S.shipsWithRole("yourRoleHere")[0].position
or PS.target = S.shipsWithRole("yourRoleHere")[0]
and similar manipulations.Or similarly
PS.target = T
will assign your newly spawned ship as your ships target. If it's off-scanner you'll just lose lock again, but if it's around then it can help in finding it.My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Re: Model Checking, Fitting, And Testing
I've had that ship up in the game, with ball turrets active. You are right about something being wrong, though. I have another thread going asking about the dock that I can't seem to get oriented into the ship. It is hanging part way into the ship, just under where it needs to sit straight, and I've been messing with it for over a week now without any results. It's funny, I thought this would be a snap, as the dock doesn't rotate, but it's proving more difficult than the ball turrets. I'll try removing the dock from the equation to see if it makes a difference, but I should inform you that I couldn't get ANY ship to appear in that mission screen, except that tiny Andricothere. I suppose I'm doing something wrong, but have no idea what it is.Ahruman wrote:Either your ship is very pointy and very dark, or it has some stray geometry off in the distance and you need to clean up your model.
Re: Model Checking, Fitting, And Testing
Like I said, it's a dock. I know it's out of place, and am trying to fix that, which is one of the reasons I wanted to find a better way of viewing it.Eric Walch wrote:It looks like you added a subEntity far outside the ships dimensions, or in the ship itself it something wrong, As Ahruman says, the ships displayed on the mission screens are sized to fit.mandoman wrote:I can undo that, as you said, but as you can see, it doesn't resolve the problem. The ship in the game is big enough to be a small carrier, as it was meant to be.
The good and close view is also why I like to evaluate the ships on the mission screen. You can even access the model by using:mission.displayModel
.
e.g.mission.displayModel.subEntities[0].position = [x,y,z]
Re: Model Checking, Fitting, And Testing
Thanks for that. I got a zero when I specified the Andricothere-Dreadnaught, so something is screwy there. Another thing I'm getting is a a bunch of Syntax Error warnings on .js scripts. My sucky scripting strikes again, but never fear, I shall prevail.Thargoid wrote:See, you learn something new every day Thanks.Ahruman wrote:Protip: you can just writeT.switchAI…
.
Another useful command isS.countShipsWithRole("yourRoleHere")
, which will count the number of ships in the current system with the given role (S
is JS console shorthand forsystem
, similarlyP
is short forplayer
andPS
forplayer.ship
).
So if you think you've spawned a ship but nothing appears (in-game or in the logs) you can use that command to count the number of ships in the system with that role. If it's a unique role and the count is 1, then it is in existence somewhere abouts, and if count is 0 then it isn't.
If it does exist, you can refer to it byS.shipsWithRole("yourRoleHere")[0]
. The first part of the command finds all the ships in the system with the given role and puts them into an array, and the [0] on the end refers specifically to the first element in that array (in this case it will be the closest ship with that role). You can then do things likeS.shipsWithRole("yourRoleHere")[0].position
orPS.target = S.shipsWithRole("yourRoleHere")[0]
and similar manipulations.
Or similarlyPS.target = T
will assign your newly spawned ship as your ships target. If it's off-scanner you'll just lose lock again, but if it's around then it can help in finding it.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Model Checking, Fitting, And Testing
Also,Thargoid wrote:S
is JS console shorthand forsystem
, similarlyP
is short forplayer
andPS
forplayer.ship
$
holds the result of the last console command (ignoring null
and undefined
).
Code: Select all
> 5 + 3
8
> $ * 2
16
E-mail: [email protected]