Page 33 of 45

Re: The Feudal States

Posted: Wed Feb 29, 2012 7:46 pm
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

Re: The Feudal States

Posted: Sat Mar 03, 2012 10:44 pm
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.

Re: The Feudal States

Posted: Sun Mar 04, 2012 12:01 am
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:

Re: The Feudal States

Posted: Sun Mar 04, 2012 9:13 am
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.

Re: The Feudal States

Posted: Mon Mar 05, 2012 2:23 pm
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.

Re: The Feudal States

Posted: Mon Mar 05, 2012 5:41 pm
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.

Re: The Feudal States

Posted: Mon Mar 05, 2012 9:42 pm
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.

Re: The Feudal States

Posted: Tue Mar 06, 2012 7:40 pm
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.

Re: The Feudal States

Posted: Tue Mar 06, 2012 9:31 pm
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.

Re: The Feudal States

Posted: Tue Mar 06, 2012 9:36 pm
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?

Re: The Feudal States

Posted: Tue Mar 06, 2012 9:56 pm
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.

Re: The Feudal States

Posted: Tue Mar 06, 2012 11:17 pm
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!

Re: The Feudal States

Posted: Wed Mar 07, 2012 7:24 am
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.

Re: The Feudal States

Posted: Wed Mar 07, 2012 8:00 am
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.

Re: The Feudal States

Posted: Wed Mar 07, 2012 9:05 am
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.