Page 1 of 2

Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 2:36 pm
by mandoman
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

Posted: Thu Dec 22, 2011 6:23 pm
by Thargoid
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.

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 6:45 pm
by JensAyton
Thargoid 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.
Protip: you can just write T.switchAI….

Also, while docked, you can use :test your-ship-role to show your ship on a mission screen.

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 7:23 pm
by mandoman
Ahruman wrote:
Thargoid 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.
Protip: you can just write T.switchAI….

Also, while docked, you can use :test your-ship-role to show your ship on a mission screen.
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.
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.

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

Posted: Thu Dec 22, 2011 7:46 pm
by mandoman
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?

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 7:49 pm
by JensAyton
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.)

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 8:19 pm
by mandoman
Ahruman wrote:
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.)
The result was.. well let me show you:

Image

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.

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 8:50 pm
by JensAyton
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

Posted: Thu Dec 22, 2011 8:53 pm
by DaddyHoggy
mandoman wrote:
Ahruman wrote:
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.)
The result was.. well let me show you:

Image

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.
Is it the Monolith from 2001: A Space Odyssey? (because the ratio for that I think was 9, 4, 1)

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 9:08 pm
by Eric Walch
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.
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.

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

Posted: Thu Dec 22, 2011 9:48 pm
by Thargoid
Ahruman wrote:
Protip: you can just write T.switchAI….
See, you learn something new every day ;) Thanks.

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.

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 10:15 pm
by mandoman
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. :-)
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.

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 10:16 pm
by mandoman
Eric Walch wrote:
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.
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.

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]
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.

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 10:22 pm
by mandoman
Thargoid wrote:
Ahruman wrote:
Protip: you can just write T.switchAI….
See, you learn something new every day ;) Thanks.

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.
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. :)

Re: Model Checking, Fitting, And Testing

Posted: Thu Dec 22, 2011 10:29 pm
by JensAyton
Thargoid wrote:
S is JS console shorthand for system, similarly P is short for player and PS for player.ship
Also, $ holds the result of the last console command (ignoring null and undefined).

Code: Select all

> 5 + 3
8
> $ * 2
16