Page 5 of 6

Posted: Mon Dec 22, 2008 2:10 pm
by wackyman465
Gotta love the cascade missile... It's gotten me out of many tough spots. Angry behemoth bearing down on you? They've got witchdrives too, they're vulnerable!

Posted: Thu Jan 22, 2009 5:05 pm
by tomsk
Ramirez wrote:
Version 1.2 is available at the link below.
Typos in your links. ;)

..

Posted: Thu Jan 22, 2009 5:13 pm
by Lestradae
Missiles & Bombs 2.0 appears as 2.0, but the download link leads nowhere :(

Re: ..

Posted: Thu Jan 22, 2009 6:12 pm
by Thargoid
Lestradae wrote:
Missiles & Bombs 2.0 appears as 2.0, but the download link leads nowhere :(
Try here

Posted: Mon Jan 26, 2009 9:38 am
by Commander McLane
Hi Ramirez!

You missed one in the renaming process:
[shipData.merge.failed]: ***** ERROR: one or more shipdata.plist entries have like_ship references that cannot be resolved: ("rmb-chaff")
In the rmb-chaff entry there is a like_ship you overlooked. Instead of

Code: Select all

		<key>like_ship</key>
		<string>frag-particle</string>
it should be

Code: Select all

		<key>like_ship</key>
		<string>rmb-frag-particle</string>

Posted: Mon Jan 26, 2009 11:14 am
by Ramirez
Thanks - I got a PM on that one yesterday so I've made the corrections and have re-uploaded v2.0. Hopefully it works OK now.

Posted: Mon Jan 26, 2009 11:59 am
by Screet
Ramirez wrote:
Thanks - I got a PM on that one yesterday so I've made the corrections and have re-uploaded v2.0. Hopefully it works OK now.
Yes, chaff is working nicely. Apparently it never worked before as I did buy the dispenser without a free pylon, thus never receiving the first package at all. I thought the buyable packages would just be to reload the launcher, not to make the launchers functionality accessible. My mistake.

After updating, I did get that strange error message again, which you could not reproduce. Is anyone else seeing this upon cache rebuild?

Code: Select all

[plist.parse.foundation.failed]: Failed to parse AddOns/Missiles and Bombs v2.0.oxp/AIs/missileAI.plist as a property list using Foundation. Retrying using homebrew parser. WARNING: the homebrew parser is deprecated and will be removed in a future version of Oolite.
Parse failed at line 1 (char 16) - extra data after parsed string
  [plist.homebrew.parseError]: Property list isn't in XML format, homebrew parser can't help you.
Looking at the file, I fail to understand what's causing this message. The missiles I've tried so far do work.

Screet

Posted: Mon Jan 26, 2009 12:09 pm
by Eric Walch
Screet wrote:
After updating, I did get that strange error message again, which you could not reproduce. Is anyone else seeing this upon cache rebuild?
It won't work. Ramirez is overwriting the internal missileAI. However he made a syntax error in the plist so it it is not loading at all. In that case Oolite keeps using its original missileAI. Missiles still work, but the special things don't work. (e.g. the chaff.)
However overwriting internal AI is a bad thing. When you install one oxp that overwrites something, there is probably no problem. But a problem arises when you install a second oxp that uses the same overwriting tactic. One of the two will lose than!

EDIT: After downloading 2.0 I see no error in that plist. My syntax checker says it is OK.

I see an other bug though. Ramires writes in the shaff script:

Code: Select all

		if
	
			(missionVariables.rmb_chaff_count == 0)
			player.consoleMessage(expandDescription("Chaff exhausted."), 6)
			missionVariables.rmb_chaff_loaded = "NO"

When writing it this way it will use the condition only for the one line preceding the if statement. The second line is always executed. Seeing the rest of the code this is not wanted. It should be:

Code: Select all

		if
	
			(missionVariables.rmb_chaff_count == 0)
			{
				player.consoleMessage(expandDescription("Chaff exhausted."), 6)
				missionVariables.rmb_chaff_loaded = "NO"
			}

Posted: Mon Jan 26, 2009 1:00 pm
by Commander McLane
Screet wrote:
After updating, I did get that strange error message again, which you could not reproduce. Is anyone else seeing this upon cache rebuild?

Code: Select all

[plist.parse.foundation.failed]: Failed to parse AddOns/Missiles and Bombs v2.0.oxp/AIs/missileAI.plist as a property list using Foundation. Retrying using homebrew parser. WARNING: the homebrew parser is deprecated and will be removed in a future version of Oolite.
Parse failed at line 1 (char 16) - extra data after parsed string
  [plist.homebrew.parseError]: Property list isn't in XML format, homebrew parser can't help you.
Looking at the file, I fail to understand what's causing this message. The missiles I've tried so far do work.
This message was produced by an extra '}' (I think) in an older version of Missiles and Bombs. The bug is however no longer present in version 2.0.

Probably another manifestation of your Vista Virtual Store problem?

Posted: Mon Jan 26, 2009 4:45 pm
by Screet
Commander McLane wrote:
Probably another manifestation of your Vista Virtual Store problem?
That's what I checked first, it wasn't the problem. I had the same bug with the previous version and accidentally created a VS-copy then when I tried to replace the spaces with new ones, thinking that this might have been it, but it wasn't the cause either.

Screet

Posted: Tue Jan 27, 2009 5:51 am
by Commander McLane
Then I don't know what's wrong. The bug was definitely removed already in 1.2 (or whatever was the version previous to 2.0).

Posted: Tue Jan 27, 2009 10:49 am
by Ramirez
Thanks for the pointer on the chaff bug - I still have a bit of a blind spot when it comes to the curly brackets!

On the missile AI, is there a better way of going about this than overwriting files? It seemed like a quick and easy solution at the time but I know it can create clashes - I think Thargoid's missile rack OXP uses copies of the originals as well.

Posted: Tue Jan 27, 2009 11:00 am
by Thargoid
Mine use variants on the trunk missileAI (standard and hard), as the rack's missiles have shorter ranges (to stop the rack becoming too powerful). That range is dealt with in the AI, so they need new ones. If you look at the desiredRange checks, you'll see my numbers are smaller (20k vs 30k).

Whilst missile range is a function of the AI rather than of the shipdata I don't think there is any other way than to use an amended AI.

Posted: Tue Jan 27, 2009 12:17 pm
by Eric Walch
Ramirez wrote:
On the missile AI, is there a better way of going about this than overwriting files? It seemed like a quick and easy solution at the time but I know it can create clashes - I think Thargoid's missile rack OXP uses copies of the originals as well.
A more foolproof method would be with a ship script. I didn't want to suggest that in the past because you were not using them. But I see you now started with JS and could use it with your chaff. Instead of changing the AI, you could let the shafflauncher scan for all missiles in an area of 25600 meters that have the shaffs mother as target. If found, use a random function to decide if you change targets to the chaff. The missile is in performIntercept and just will use this new target to head to.

e.g. when you remove the spawning from the AI and add the next code to your decrementChaff function I think it will work with a unmodified missileAI. It just scanns for all missiles in range heading for the chafflauncher owner. If found it switches the missile targets to one of the chaffs. (90% of them).

Code: Select all

		var chaff = this.ship.spawn("rmb-chaff", 30)  

		function isHostileMissile(entity) 
			{ 
				return (entity.isShip && entity.scanClass == "CLASS_MISSILE" && entity.target && entity.target == this.ship.owner);
			}
		var missiles = system.filteredEntities(this, isHostileMissile, this.ship, 25600)
		
		for(var i=0; i<missiles.length; i++)
			{
				if(Math.random() < 0.9) missiles[i].target = chaff[i];
			}
Untested code! This code will generate an error when there are more than 30 missiles at once heading for the other but that many missiles it pretty unlikely.
I realise that system.filteredEntities is very difficult to understand in the start, but is is a very powerful function to do a scan for very specific ships that are defined by the function isHostileMissile

Posted: Tue Jan 27, 2009 12:36 pm
by Ramirez
I thought of ship scripts but only as a means to somehow switch the missile's AI dynamically. However that would have involved creating a like_ship in the shipdata and I'd still have the overwrite issues.

Scanning for missiles and changing their targets sounds like a v good suggestion, so I'll give it a go.