Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

The Feudal States

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Re: The Feudal States

Post by Ironfist »

Ramirez,

On ships I have working with turrets the range is in km so the value would be 3 not 3000. Not sure if it makes a difference, I will change one of mine to 3000 and see what happens.

Ironfist
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: The Feudal States

Post by SandJ »

Ramirez wrote:
... give the opponents a fixed ball turret ... as far as I can tell, the weapon_energy setting makes no difference. Whether it's 0.5 or 50.0, it still takes about 5 hits from an NPC to reduce my front shields to zero. Similarly, weapon_range doesn't seem to do much, at least if I set it to 3000m I'll still get an NPC firing its turret from beyond 4000m. Strangely though, fire_rate does work as expected.

The kind of entry I have in the shipdata is as follows:

Code: Select all

 subentities =         (    
				{	type = "ball_turret";
            				subentity_key = "feudal-ship-turret-green";
            				position = (0.0, 0.0, 19.0);
            				orientation = (1, 0, 0, 0);
					weapon_energy = "50.0";
					fire_rate = "1.0";
					weapon_range = "3000";
				}
				);
Is this a bug or have I not understood the documentation properly?
Bump!

I have spent today adding turrets to my Python and weapon_energy and weapon_range do seem to be ignored.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: The Feudal States

Post by CommonSenseOTB »

SandJ wrote:
Ramirez wrote:
... give the opponents a fixed ball turret ... as far as I can tell, the weapon_energy setting makes no difference. Whether it's 0.5 or 50.0, it still takes about 5 hits from an NPC to reduce my front shields to zero. Similarly, weapon_range doesn't seem to do much, at least if I set it to 3000m I'll still get an NPC firing its turret from beyond 4000m. Strangely though, fire_rate does work as expected.

The kind of entry I have in the shipdata is as follows:

Code: Select all

 subentities =         (    
				{	type = "ball_turret";
            				subentity_key = "feudal-ship-turret-green";
            				position = (0.0, 0.0, 19.0);
            				orientation = (1, 0, 0, 0);
					weapon_energy = "50.0";
					fire_rate = "1.0";
					weapon_range = "3000";
				}
				);
Is this a bug or have I not understood the documentation properly?
Bump!

I have spent today adding turrets to my Python and weapon_energy and weapon_range do seem to be ignored.
Umm...isn't max weapon energy for turrets 25 and range for turrets goes to 5(km), no? I could be wrong you know. :wink:
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: The Feudal States

Post by Thargoid »

I don't think they are working properly at the moment. I've had them in some of my OXPs for a while, and never seen them actually do anything to change the defaults (the 25 energy and 5km range).

I thought I'd reported it, but as I can't find such a report I obviously meant to do so but got sidetracked.
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: The Feudal States

Post by Ramirez »

I suspect you're right Thargoid. Although I've used weapon energy for turrets in the past I don't think I've ever actually analysed it properly to confirm whether it was working as expected. I've just tried the same setup in v1.75.3 and got the same results, so if it is indeed a bug it doesn't look like it's a new thing.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: The Feudal States

Post by SandJ »

SandJ wrote:
I have spent today adding turrets to my Python and weapon_energy and weapon_range do seem to be ignored.
Oh, and fire_rate.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: The Feudal States

Post by Ramirez »

I think fire_rate is ok - try setting the line to something small like

Code: Select all

fire_rate = "0.2";
in the subentity group and you should see a fairly rapid stream of plasma from the turret.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: The Feudal States

Post by SandJ »

Ramirez wrote:
I think fire_rate is ok - try setting the line to something small like

Code: Select all

fire_rate = "0.2";
in the subentity group and you should see a fairly rapid stream of plasma from the turret.
Nope, I'm sure it doesn't. I have a turret where I can change the plasma ball colour and the turret turn speed but I cannot get its rate of fire to change, regardless of the fire_rate setting.

I have three different turrets fitted, each of a different colour so I can compare them. I cannot get the fire rate or range to vary between them.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
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: The Feudal States

Post by Eric Walch »

Thargoid wrote:
I don't think they are working properly at the moment. I've had them in some of my OXPs for a while, and never seen them actually do anything to change the defaults (the 25 energy and 5km range).

I thought I'd reported it, but as I can't find such a report I obviously meant to do so but got sidetracked.
weapon_energy and weapon_range for turrets are not correctly supported. Both functions were announced in the 1.75 release notes, so they should work and its a bug.

I just opened oolites cache file and looked at a ship with turrets. Both entries never make it to the cache. During validation of the subentitie definitions at startup, both keys are yet unknown and skipped. After that everything is handled well. But when they are dropped in the beginning, we proceed with default values. :roll: So they never could have worked.

EDIT:
Adding both keys to the shipRegistry makes them both work correctly as I just tested. So the main part of the current code is correct.
Last edited by Eric Walch on Tue Mar 06, 2012 9:46 pm, edited 1 time in total.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: The Feudal States

Post by SandJ »

Eric Walch wrote:
weapon_energy and weapon_range for turrets are not correctly supported. Both functions were announced in the 1.75 release notes, so they should work and its a bug.

I just opened oolite's cache file and looked at a ship with turrets. Both entries never make it to the cache. During validation of the subentity definitions at startup, both keys are yet unknown and skipped. After that everything is handled well. But when they are dropped in the beginning, we proceed with default values. :roll: So they never could have worked.
Thank you for that. Is there a definitive list of what should work for turrets, or is it just the turn rate (thrust) and colour for the time being?
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
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: The Feudal States

Post by Eric Walch »

SandJ wrote:
Thank you for that. Is there a definitive list of what should work for turrets, or is it just the turn rate (thrust) and colour for the time being?
No fire rate is also working. There is just an inconsistency were its defined. In the old subentity declaration there was no place for customisation. That means that thrust and color are defined in the the subentity key itself and are the same for every time the subentity is used.

With the new subentity declaration for ships, you can do additional specifications for every time you add a subentity. That means all new keys were defined in the subentitie array of the ship. Firerate is defined here, meaning every turret on a ship can have its own firerate. That gives nice effects when defining them all slightly different. No longer synchronised bursts of plasma bolts, but all fired more individually. (I used that in the current version of the random-hits spacebar).
The two wrong keys are also defined in the subentity declaration of a ship, meaning they can be all different. (If they would work)

Anyhow, a bit confusing as there are now two places turret parameters are defined.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: The Feudal States

Post by SandJ »

Eric Walch wrote:
No, fire rate is also working. There is just an inconsistency where it's defined. In the old subentity declaration there was no place for customisation. That means that thrust and color are defined in the the subentity key itself and are the same for every time the subentity is used.

With the new subentity declaration for ships, you can do additional specifications for every time you add a subentity. That means all new keys were defined in the subentity array of the ship. Fire rate is defined here, meaning every turret on a ship can have its own firerate. That gives nice effects when defining them all slightly different. No longer synchronised bursts of plasma bolts, but all fired more individually. (I used that in the current version of the random-hits spacebar).
The two wrong keys are also defined in the subentity declaration of a ship, meaning they can be all different. (If they would work)

Anyhow, a bit confusing as there are now two places turret parameters are defined.
I think I understand. I used to have the following, which did not work:

Code: Select all

              subentities = (
                  "SiR-Turret-M   0.0   21.0  -16.0  1      0  0      0", // Magenta, top, forward
                  "SiR-Turret-M   0.0   21.0  -16.0  0      0  1      0", // Magenta, top, rear
                  "SiR-Turret-C -40.0    0.0  -25.0  0.7071 0  0.7071 0", // Cyan, left
                  "SiR-Turret-C  40.0    0.0  -25.0  0.7071 0 -0.7071 0", // Cyan, right
                  "SiR-Turret-Y   0.0  -21.0  -21.5  1      0  0      0", // Yellow, belly, front
    ...
	"SiR-Turret-C" = {
		fire_rate = "0.2";
                laser_color = "cyanColor";
		model = "oolite-ball-turret.dat";
		roles = "ballturret SiR-Turret-C";
		setup_actions = ("initialiseTurret");
        };
but this does work:

Code: Select all

                subentities = ( {type = ball_turret; subentity_key = "SiR-Turret-M"; position = (   0.0,   21.0,  -16.0); orientation = (   1     , 0 ,  0     , 0); fire_rate = 0.25;}, // Magenta, top, forward
                                {type = ball_turret; subentity_key = "SiR-Turret-M"; position = (   0.0,   21.0,  -16.0); orientation = (   0     , 0 ,  1     , 0); fire_rate = 0.20;}, // Magenta, top, rear
                                {type = ball_turret; subentity_key = "SiR-Turret-C"; position = ( -40.0,    0.0,  -25.0); orientation = (   0.7071, 0 ,  0.7071, 0); fire_rate = 0.20;}, // Cyan, left
                                {type = ball_turret; subentity_key = "SiR-Turret-C"; position = (  40.0,    0.0,  -25.0); orientation = (   0.7071, 0 , -0.7071, 0); fire_rate = 0.25;}, // Cyan, right
                                {type = ball_turret; subentity_key = "SiR-Turret-Y"; position = (   0.0,  -21.0,  -21.5); orientation = (   1     , 0 ,  0     , 0); fire_rate = 0.20;}, // Yellow, belly, front
It has taken me hours to convert the code from the first format to the second!
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Commander McLane
---- E L I T E ----
---- 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: The Feudal States

Post by Commander McLane »

Glad that you have it sorted. It's all explained in the wiki, though.

In the first case you had code that didn't make sense, because you used the old-style subentity definition which doesn't contain the properties you wanted to use. That's the reason why the new-style subentity definition was introduced in the first place. So if you wanted to use the new-style properties you have to use the new-style subentity definition to begin with.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: The Feudal States

Post by SandJ »

Commander McLane wrote:
Glad that you have it sorted. It's all explained in the wiki, though.
It was that I was going by and was causing me the confusion over weapon_range and [size=120]weapon_energy[/size]. And it's not sorted as those parameters do not work in either format.
Commander McLane wrote:
In the first case you had code that didn't make sense, because you used the old-style subentity definition which doesn't contain the properties you wanted to use. That's the reason why the new-style subentity definition was introduced in the first place. So if you wanted to use the new-style properties you have to use the new-style subentity definition to begin with.
When I thought I'd have a go at adding turrets to see what they did, I searched through all the .plists I had for the OXPs I have downloaded and come with the game to find examples to copy and adapt. Sadly, I originally had it in what you call the 'new-style' format and spent hours converting it to the 'old-style' since the parameters didn't work and the 'old-style' format is the more commonly-used for ball turrets.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Commander McLane
---- E L I T E ----
---- 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: The Feudal States

Post by Commander McLane »

SandJ wrote:
... and the 'old-style' format is the more commonly-used for ball turrets.
I guess that's a common side effect of a transition. The old and tried examples are of course in the old style, so in the beginning you have nothing to copy and work with. And as the old-style definition isn't deprecated and continues to work perfectly (within its known limitations) there is not a lot of pressure on scripters to switch existing OXPs to the new style.
Post Reply