Oolite Bulletins

For information and discussion about Oolite.
It is currently Sat Dec 15, 2018 4:29 am

All times are UTC




Post new topic  Reply to topic  [ 24 posts ]  Go to page 1 2 Next
Author Message
 Post subject: [WIP] N-Shields
PostPosted: Tue Apr 26, 2016 1:14 pm 
Offline
Competent
Competent

Joined: Mon Mar 02, 2015 2:08 pm
Posts: 58
Location: drifting in remLock mask near Vezadi Station
You don't need this OXP. CustomShields does this perfectly well, doesn't it?

Shockingly, CustomShields is not quite 100% fair. It only recharges NPCs' shields once their energy banks are full, which clearly isn't the usual player ship behaviour. N-shields aims to rectify this, as well as letting NPC shields protect subentities as player ones have done since 1.77.
Other improvements are as follows:
-Attempting to provide better compatibility for other OXPs with shipTakingDamage overrides
-Support for very non-standard shield configurations(sorry, feature mostly removed in 0.7) Thargoids get dorsal/ventral shields.
-More customisable colours. The default multicolour set goes from green down to red for standard shields, extending to blue/purple with upgrades.
-New visual effects based on explosions.plist for shields and unshielded hits.

Version 0.7.1 OXZ download is here.

_________________
Equal Rights for NPCs!


Last edited by Ngalo on Sat Jul 16, 2016 2:20 pm, edited 4 times in total.

Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Tue Apr 26, 2016 1:19 pm 
Offline
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 13406
Location: Corke's Drift
For the record, I wholeheartedly approve of your 'Equal Rights for NPCs' campaign!

_________________
Those who seek gold dig a lot of earth, but find little


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Tue Apr 26, 2016 4:19 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Tue Aug 28, 2012 8:05 pm
Posts: 485
Location: aboard the Laenina Crowne - Yasen-N class space freighter
count me in :-)

Fireworks!!! I like... Just tried it out, I'm not sure about the "star effect" when hit, being too dominant, but maybe one has to get accustomed to it.
Anyways, nice one!

_________________
Amah


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Tue Apr 26, 2016 8:30 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 297
Quote:
For the record, I wholeheartedly approve of your 'Equal Rights for NPCs' campaign!
I want the assassins' fuel injectors to get damaged when I hit them with shields down then.
I may get beaten here though. Sometimes they go down as if their injectors were damaged, or they perhaps eject because their injectors were damaged (core assassins never eject, but OXP ones sometimes do).

_________________
warning sound if a missile is inbound: Missile warning


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Wed Apr 27, 2016 3:40 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2223
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Just got these messages in my log file:
Code:
13:29:20.745 [oxp-standards.deprecated]: Script ../AddOns/Testing.oxp/N-Shields.oxp/Scripts/N-Shields.js does not "use strict";
...
13:29:35.349 [mesh.error]: ***** Failed to find TEXTURES data (will use placeholder material)
 ..... from NShields-flare-marker.dat (from file)

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Sat Apr 30, 2016 11:45 am 
Offline
Competent
Competent

Joined: Mon Mar 02, 2015 2:08 pm
Posts: 58
Location: drifting in remLock mask near Vezadi Station
Quote:
Just got these messages in my log file:
Code:
13:29:20.745 [oxp-standards.deprecated]: Script ../AddOns/Testing.oxp/N-Shields.oxp/Scripts/N-Shields.js does not "use strict";
...
13:29:35.349 [mesh.error]: ***** Failed to find TEXTURES data (will use placeholder material)
 ..... from NShields-flare-marker.dat (from file)
That's OK, I just couldn't be bothered to texture a tiny 1-poly marker nobody will ever actually see. Might get around to it one day if your log file desperately needs de-cluttering.

As for the star effects being too big, I'm actually inclined to agree and will tweak things a bit once the hemisphere glow effects work properly; for now you can unzip the OXZ and find the off-switch in the top of N-Shields.js if you like.

Anonymissimus, NPC Equipment Damage does happen to be in my WIP folder, although it's not exactly simple and has yet to reach the testing stage. Watch this space.

_________________
Equal Rights for NPCs!


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Sat Apr 30, 2016 12:23 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Mon Apr 27, 2015 9:03 pm
Posts: 297
Quote:
Anonymissimus, NPC Equipment Damage does happen to be in my WIP folder, although it's not exactly simple and has yet to reach the testing stage. Watch this space.
Aha, so it is really so that the equipment of NPC ships cannot be damaged by default as of now ?
Fuel injectors are obviously the most interesting piece, but others such as shield boosters also count ofc.

Sorry for offtopic (somewhat), I should have created a dedicated thread for asking this.

_________________
warning sound if a missile is inbound: Missile warning


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Wed May 04, 2016 11:12 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2223
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Small bug in the following routine:
Code:
this.$drawSparks = function(position, ship, amount) //TODO: use amount to determine type?
{
	if (amount < 10) chance = 0.5;
	else chance = 1;
	
	if (Math.random() <= chance)
	{
		var sparks = ship.spawnOne("NShields-sparks");
		sparks.position = position;
		sparks.explode()
	}
}
The variable "chance" is not declared.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Tue May 10, 2016 11:04 am 
Offline
Competent
Competent

Joined: Mon Mar 02, 2015 2:08 pm
Posts: 58
Location: drifting in remLock mask near Vezadi Station
Thanks for pointing that out, phkb (although it seemed to work anyway). My problem is I think in Python too much.

Anyway, version 0.6.1 is now out with a Ship Configuration version check that actually works (sorry about the 0.5.3 attempt), some config options for users of Oolite-trunk and Library OXP, re-sized star explosions (maybe too small now?) and hemisphere glow effects working properly (although they are still disabled by default because they still look awful). Oh, and compatibility with NPC Equipment Damage OXP.

_________________
Equal Rights for NPCs!


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Wed May 11, 2016 3:18 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2223
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Small bug in the manifest.plist:
Code:
12:40:05.844 [plist.parse.failed]: Failed to parse ../AddOns/Testing.oxp/N-Shields.oxz/manifest.plist as a property list.
Parse failed at line 20 (char 700) - unexpected character (wanted '=')
Looks like there's a missing "};" at the end of the optional oxps.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Thu May 26, 2016 12:34 pm 
Offline
Competent
Competent

Joined: Mon Mar 02, 2015 2:08 pm
Posts: 58
Location: drifting in remLock mask near Vezadi Station
Already found & fixed, but thanks for your vigilance. The fixed version is now available.

[Edit:]
Also, a question for any developers who happen to be around: Is the correct default value for shield_charge_energybank_threshold in global-settings.plist 0.0 (as that file says) or 0.25 (as the source code seems to say)? 0.0 is the value I've been using, in the absence of any ability to read the actual one directly.

_________________
Equal Rights for NPCs!


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Thu May 26, 2016 7:00 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5309
Quote:
Also, a question for any developers who happen to be around: Is the correct default value for shield_charge_energybank_threshold in global-settings.plist 0.0 (as that file says) or 0.25 (as the source code seems to say)? 0.0 is the value I've been using, in the absence of any ability to read the actual one directly.
It looks like it is set to 0.25. The value in the plist is commented out and is considered non-existent.


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Fri May 27, 2016 6:47 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2223
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Getting this in my log file:
Code:
16:38:57.864 [NPC_Equipment_Damage]: damaging EQ_NSHIELDS_NPC_SHIELD_BOOSTER on Wolf Mark I: Cursed Trumble V
16:38:58.052 [script.javaScript.exception.notDefined]: ***** JavaScript exception (griff_spawn_wreckage 1.1): ReferenceError: labels is not defined
16:38:58.052 [script.javaScript.exception.notDefined]:       ../AddOns/Testing.oxp/N-Shields.oxp/Scripts/N-Shields.js, line 911.
BTW, there's a bug in ShipConfig, in the code that damages energy equipment. I've got a "ship" reference rather than a "this.ship" on one of the lines.

Edit: I fixed it by changing these lines
Code:
	if (equipment == "EQ_NSHIELDS_NPC_NAVAL_SHIELD_BOOSTER") //reverse the equipment upgrade changes
	{
		let eq = EquipmentInfo.infoForKey("EQ_NAVAL_SHIELD_BOOSTER");
		let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
		let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
		for (i in labels.maxShields)
		{
			ship[labels.maxShields[i]] -= shield_boost;
			if (recharge_boost) ship[labels.rechargeRates[i]] /= recharge_boost;
		}
	}
	
	if (equipment == "EQ_NSHIELDS_NPC_SHIELD_BOOSTER") //reverse the equipment upgrade changes
	{
		let eq = EquipmentInfo.infoForKey("EQ_SHIELD_BOOSTER");
		let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
		let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
		for (i in labels.maxShields)
		{
			ship[labels.maxShields[i]] -= shield_boost;
			if (recharge_boost) ship[labels.rechargeRates[i]] /= recharge_boost;
		}
	}
to this
Code:
	if (equipment == "EQ_NSHIELDS_NPC_NAVAL_SHIELD_BOOSTER") //reverse the equipment upgrade changes
	{
		let eq = EquipmentInfo.infoForKey("EQ_NAVAL_SHIELD_BOOSTER");
		let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
		let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
		for (i in this.ship.script.NShields_labels.maxShields)
		{
			this.ship[this.ship.script.NShields_labels.maxShields[i]] -= shield_boost;
			if (recharge_boost) this.ship[this.ship.script.NShields_labels.rechargeRates[i]] /= recharge_boost;
		}
	}
	
	if (equipment == "EQ_NSHIELDS_NPC_SHIELD_BOOSTER") //reverse the equipment upgrade changes
	{
		let eq = EquipmentInfo.infoForKey("EQ_SHIELD_BOOSTER");
		let shield_boost = parseInt(eq.scriptInfo.oolite_shield_increase);
		let recharge_boost = parseFloat(eq.scriptInfo.oolite_shield_recharge_multiplier);
		for (i in this.ship.script.NShields_labels.maxShields)
		{
			this.ship[this.ship.script.NShields_labels.maxShields[i]] -= shield_boost;
			if (recharge_boost) this.ship[this.ship.script.NShields_labels.rechargeRates[i]] /= recharge_boost;
		}
	}

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Tue Jun 07, 2016 2:25 pm 
Offline
Competent
Competent

Joined: Mon Mar 02, 2015 2:08 pm
Posts: 58
Location: drifting in remLock mask near Vezadi Station
Thanks phkb, I think I already found & fixed the shield damage bug (and found the shipconfig energy bug) for myself & will emergency-release N-Shields 0.6.3 today if time permits.

[Edit]
Done. The link above should now be the new version.
[/Edit]

_________________
Equal Rights for NPCs!


Top
   
 Post subject: Re: [WIP] N-Shields
PostPosted: Wed Jun 15, 2016 1:01 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2223
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
One more bug. Line 594 of N-Shields.js reads
Code:
		else if (ship.script.NShields_cloaked_attacker && ship.script.NShields_cloaked_attacker.distanceTo(ship) < 25600) attacker = ship.script.NShields_cloaked_attacker;
I think it should be
Code:
		else if (ship.script.NShields_cloaked_attacker && ship.script.NShields_cloaked_attacker.position.distanceTo(ship) < 25600) attacker = ship.script.NShields_cloaked_attacker;

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 24 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited