New missiles, bombs and equipment

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

Moderators: winston, another_commander

User avatar
wackyman465
---- E L I T E ----
---- E L I T E ----
Posts: 831
Joined: Thu Nov 06, 2008 10:15 pm
Location: Currently hunting you down in an Imperial Courier

Post 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!
I shot him back first. That is to say, I read his mind and fired before he would have fired on me. No, sir, he wasn't a fugitive.
User avatar
tomsk
Dangerous
Dangerous
Posts: 66
Joined: Sun Jan 11, 2009 12:21 pm
Location: under my Cobra's hood...

Post by tomsk »

Ramirez wrote:
Version 1.2 is available at the link below.
Typos in your links. ;)
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

Missiles & Bombs 2.0 appears as 2.0, but the download link leads nowhere :(
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: ..

Post by Thargoid »

Lestradae wrote:
Missiles & Bombs 2.0 appears as 2.0, but the download link leads nowhere :(
Try here
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:

Post 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>
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

Post 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.
Download Resistance Commander plus many other exciting OXPs HERE
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post 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
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post 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"
			}
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:

Post 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?
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post 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
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:

Post 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).
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

Post 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.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post 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
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

Post 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.
Download Resistance Commander plus many other exciting OXPs HERE
Post Reply