Third Plea For Help

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1368
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman » Wed Dec 14, 2011 7:20 pm

RyanHoots wrote:Hmm... could you PM me a copy of what you have so far of your Genesis OXP? I may not be an Oolite genius, but I may be able to spot the problem. I'm using Ubuntu, also (10.10 Maverick).
Yeah, sure. I also use 10.10. Here's the link:

http://www.box.com/s/c7uom40u001j6j79tiqx

Please keep in mind that I am only just now testing it's weapons, exhaust, etc., so it isn't complete by any means.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman

User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Third Plea For Help

Post by RyanHoots » Wed Dec 14, 2011 7:28 pm

I've got a problem. In Firefox 8, when I go to any page on Box.com, it won't load, but I get the favicon. :-/
I may need to try loading it in Firefox 3.6...
Image

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1368
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman » Wed Dec 14, 2011 7:34 pm

RyanHoots wrote:I've got a problem. In Firefox 8, when I go to any page on Box.com, it won't load, but I get the favicon. :-/
I may need to try loading it in Firefox 3.6...
Have you tried using Chrome web browser? It is an excellent browser, though I admit that I like Firefox better, but that is just personal preference. I don't know if it would work any better with Chrome, but it might. It's strange how different computers deal differently with the same software. :?
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman

User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Third Plea For Help

Post by RyanHoots » Wed Dec 14, 2011 7:40 pm

mandoman wrote:Have you tried using Chrome web browser? It is an excellent browser, though I admit that I like Firefox better, but that is just personal preference. I don't know if it would work any better with Chrome, but it might.
Chrome is probably my third or second favorite browser, after Firefox and maybe Safari (but Safari is Windows and Mac only...).
mandoman wrote:It's strange how different computers deal differently with the same software. :?
I agree, it's strange. Same OS, same program, different hardware, different result. Very annoying.

Well, after a little while I reloaded the page and got my answer.
Image

I'll download the file when Box is back up. :roll:
Image

User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Third Plea For Help

Post by RyanHoots » Wed Dec 14, 2011 7:51 pm

Box seems to be working. :D

Well, the latest log has some interesting errors. In no particular order:

Code: Select all

14:46:17.202 [ship.setUp.escortShipCircularReference]: ----- WARNING: Ship <ShipEntity 0x9bd24b8>{"Genesis" position: (-92489, 62820.3, 580256) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} requested escorts, when it is an escort ship itself. Avoiding possible circular reference overflow by ignoring escort setup.
and

Code: Select all

4:46:10.925 [ship.setUp.escortShipCircularReference]: ----- WARNING: Ship <ShipEntity 0xa7760b0>{"Genesis" position: (-4575.33, 6740.71, 351150) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} requested escorts, when it is an escort ship itself. Avoiding possible circular reference overflow by ignoring escort setup.
14:46:11.102 [ship.setUp.escortShipCircularReference]: ----- WARNING: Ship <ShipEntity 0xa985cf0>{"Genesis" position: (-5178.75, -8093.74, 197783) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} requested escorts, when it is an escort ship itself. Avoiding possible circular reference overflow by ignoring escort setup.
14:46:11.575 [ship.setUp.escortShipCircularReference]: ----- WARNING: Ship <ShipEntity 0xabbea58>{"Genesis" position: (-266795, -113081, 546685) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} requested escorts, when it is an escort ship itself. Avoiding possible circular reference overflow by ignoring escort setup.
So, it looks like the Genesis thinks that it is an escort ship. This might be cleared up by changing the AI. I'll experiment a bit and let you know what I find.

Edit: I've got the OXP working. Very impressive ship! :D
Image

I had to remove the escort role and add a Genesis role, and set auto AI to true. I'll send you a copy of what I have.
Image

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Re: Third Plea For Help

Post by Thargoid » Wed Dec 14, 2011 8:27 pm

And there's a solution to your aft laser position problem in the bug report thread.

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1368
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman » Wed Dec 14, 2011 8:41 pm

Thargoid wrote:And there's a solution to your aft laser position problem in the bug report thread.
Yeah, I saw that. TRIPLE CRAP!!! :lol:
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1368
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman » Wed Dec 14, 2011 9:32 pm

Thargoid, you and RyanHoots have made my day. The aft laser is already nearly perfect. it only took a couple of small adjustments. Thank you so much. Now, do you know how to get the ball turrets on the top, and bottom of the Genesis pointing in the right direction, and actually rotating? For that matter, even though I got the front, and aft ball turrets pointing the right directions, they don't rotate, or pivot, or what ever, either. That's no fun. Back to the calculator. :D
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Re: Third Plea For Help

Post by Thargoid » Wed Dec 14, 2011 10:28 pm

Do they fire at all? If not then you may have forgotten to initialise them. To do that you need

Code: Select all

setup_actions = ("initialiseTurret");
(or it's XML equivalent) in the shipdata.plist entry of the subentity (the turret).

For orientation, (1 0 0 0) is pointing forward, straight backwards is either (0 1 0 0) or (0 0 1 0) - the first is a rotation "upwards" whilst the second is a rotation left.

If you want something pointing straight upwards the rotation is (0.7071 0.7071 0 0) and downward is (-0.7071 0.7071 0 0).

There is an excel sheet around which someone on here wrote, which is superb for calculating this kind of thing. The other way is to use the JS console and dynamically adjust the orientation, but that's slightly more advanced player.[/color]

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1368
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman » Wed Dec 14, 2011 10:38 pm

Thargoid wrote:Do they fire at all? If not then you may have forgotten to initialise them. To do that you need

Code: Select all

setup_actions = ("initialiseTurret");
(or it's XML equivalent) in the shipdata.plist entry of the subentity (the turret).

For orientation, (1 0 0 0) is pointing forward, straight backwards is either (0 1 0 0) or (0 0 1 0) - the first is a rotation "upwards" whilst the second is a rotation left.

If you want something pointing straight upwards the rotation is (0.7071 0.7071 0 0) and downward is (-0.7071 0.7071 0 0).

There is an excel sheet around which someone on here wrote, which is superb for calculating this kind of thing. The other way is to use the JS console and dynamically adjust the orientation, but that's slightly more advanced player.[/color]
I have the setup actions initialized in the shipdata.plist, in the section of the "Ball Turret", like this:
"ballturret" =
{
ai_type = "nullAI.plist";
laser_color = magentaColor;
model = "oolite-ball-turret.dat";
smooth = "yes";
materials =
{
"back_metal.png" =
{
shininess = 15;
specular_color = (0.75, 0.75, 0.75, 1.0);
};
"oolite-ball-turret.png" =
{
shininess = 15;
specular_color = (0.75, 0.75, 0.75, 1.0);
};
};
name = "Ball Turret";
roles = "ballturret";
setup_actions = ( initialiseTurret );
thrust = 1;
weapon_energy = 25;
};
Isn't that correct? I don't really know, but I took that straight out of the core file. Do I always assume the turret rotates on the Y axis? That is what is really screwing me up, as I can't figure in my head on which axis to make the calculations. Oh, and I already use the Quaternion Calculator provided by the Oolite HowTo Wiki, I just can't decide on the axis.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5510
Joined: Thu Jun 12, 2008 6:55 pm

Re: Third Plea For Help

Post by Thargoid » Wed Dec 14, 2011 10:51 pm

The turret model should point along its own Z-axis. That Z-axis then rotates around the X- and Y-axes by the aiming of the turret once intialised, hence the turret can aim within a cone. The orientation of the turret subentity defines the initial (unrotated) direction which the turret Z-axis is pointed along (you are essentially transforming the XYZ axes set of the turret, which is then further rotated by the aiming). The key point to understand is that the XYZ axes of the turret may not necessarily be in the same direction as the XYZ axes of the mother entity. They can be adjusted by the orientation quaternion of the sub-entity in the shipdata.plist entry (the one in the mothers entry where the sub-ents are set up).

The initialisation code looks OK, although personally I always surround the command in quotes. I must admit I've never tried the trunk code, and it should be noted that is reference code that isn't actually used by the trunk ships. So I can't personally confirm that it works, although I can for mine (it's copied from Aquatics OXP).

PS can you use code tags rather than quotes for displaying code please? That way the indenting should be maintained, which makes it easier to read.

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1368
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman » Wed Dec 14, 2011 11:36 pm

Thargoid wrote:The turret model should point along its own Z-axis. That Z-axis then rotates around the X- and Y-axes by the aiming of the turret once intialised, hence the turret can aim within a cone. The orientation of the turret subentity defines the initial (unrotated) direction which the turret Z-axis is pointed along (you are essentially transforming the XYZ axes set of the turret, which is then further rotated by the aiming). The key point to understand is that the XYZ axes of the turret may not necessarily be in the same direction as the XYZ axes of the mother entity. They can be adjusted by the orientation quaternion of the sub-entity in the shipdata.plist entry (the one in the mothers entry where the sub-ents are set up).

The initialisation code looks OK, although personally I always surround the command in quotes. I must admit I've never tried the trunk code, and it should be noted that is reference code that isn't actually used by the trunk ships. So I can't personally confirm that it works, although I can for mine (it's copied from Aquatics OXP).

PS can you use code tags rather than quotes for displaying code please? That way the indenting should be maintained, which makes it easier to read.
Thanks. All good info.
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1368
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman » Thu Dec 15, 2011 5:06 am

Thargoid, I got all of the ball turrets oriented correctly, and they should have pivot capability, not just straight forward, but I can't get them to initialize. I took a look at the Aquatics setup, and changed a couple of minor things, such as putting "initializeTurret" in parenthesis, but nothing I do activates them in the game. I don't get it. I was able to manipulate them into the correct places using the "subentities" option, why doesn't the description of the ball turret not connect and initialize the turrets? Could you please help me just a little more on this? I feel so close to getting them working, but can't quite nail it. Any help would be fantastic. Thanks. :)
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman

User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Third Plea For Help

Post by Capt. Murphy » Thu Dec 15, 2011 7:08 am

Mandoman, I don't know much about turrets so can't help much there.

I see you got the script problem ironed out, but thought a summary may be helpful.

For worldscripts in JS you basically have two choices. You can name it script.js and put it in the Config folder, or give it [i]any_name_you_like[/i].js, put it in the Scripts folder and put a world-scripts.plist in Config which includes ("[i]any_name_you_like[/i].js",). The second way is the only way you can include multiple world scripts with different names in one OXP. They all sit in the Scripts folder and are listed within the brackets in world-scripts.plist separated by commas.

I don't think you've got on to custom AI with your ships yet, but when you do you will probably be wanting to use ship-scripts as well, which are scripts particular to a single ship once it has been spawned. They also can have any name you like, sit in the Scripts folder, but are referenced from the appropriate shipdata.plist entry for the ship using script = "[i]any_name_you_like[/i].js".

With regards to nightly builds, yes you should definitely be using the current nightly build. As it stands the current nightly is basically the release candidate for 1.76, and has loads of bugs fixed (including hopefully your missile launch crasher) compared with 1.75.3.

After release of 1.76 you may want to stick to the official release as the dev team will be starting to add new features again which will probably result in new bugs that need ironing out. Or you could play with nightlies to help test the new features and fix said bugs.

Edit to add - any_name_you_like.js should be unique to your OXP. Starting the name with something like the name of the OXP and or author is a good way of doing that...e.g Mando_Genesis_Test_Script.js
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Third Plea For Help

Post by Eric Walch » Thu Dec 15, 2011 8:24 am

mandoman wrote:... but I can't get them to initialize. I took a look at the Aquatics setup, and changed a couple of minor things, such as putting "initializeTurret" in parenthesis, but nothing I do activates them in the game. I don't get it. I was able to manipulate them into the correct places using the "subentities" option, why doesn't the description of the ball turret not connect and initialize the turrets? Could you please help me just a little more on this? I feel so close to getting them working, but can't quite nail it. Any help would be fantastic. Thanks. :)
You use "ballturret" as keyname. But, that is an entity that is already defined by Oolite and there should be no reason to overwrite the internal files.

However, the big problem is that a lot of scripters like to overwrite the internal files for unknown reason. That means that only the last one will load. And if that last one is a bad copy of the original, all ballturrets in Oolite that are based on that copy are screwed.

As said before, I would use unique keys for the ships to make sure no other oxp will mess with your definitions.

Post Reply