If someone wants to add a friendly object that does not care about piracy, he has two options: Add "auton" or "zoanthrope" attribute to the new object type's attributes (and accept the baggage that comes with it), or overwrite korOnShipDestroyed to ignore piracy.

korOnShipDestroyed should allow friendly objects to ignore piracy if desired. The easiest solution would be to check another attribute called "ignorePiracy" or something similar, and objects can have that attribute without being labelled auton or zoanthrope.

nms 30 Apr 2016:

I think there's actually a bug in this function. For reference:

(setq korOnShipDestroyed (lambda ()
				(block (theWitness)
					(if (and aOrderGiver 
							(eq aOrderGiver gPlayerShip)
							(eq (sovGetDisposition &svCommonwealth; (objGetSovereign gSource)) 'friend)
							(not (sysFindObject gPlayerShip "sTAE N:100"))
							(setq theWitness (random 
								(filter (sysFindObject gSource "sTAF Z N:100; -auton; -zoanthrope;") theObj 
									(and (objCanDetectTarget theObj gSource)
										(or (not (eq (shpGetOrder theObj) 'escort))
											(not (eq (shpGetOrderTarget theObj) gPlayerShip))
											)
										)
									)
								))
							(not (objGetData gSource "noPiracyCheck"))
							)
						(block Nil
							(objSendMessage gPlayerShip theWitness "Pirate!")
							(intCommonwealthCrime 2 "piracy")
							)
						)
					)
				))

I'm not completely sure, but shouldn't gSource here be the ship that was destroyed? In that case,
(eq (sovGetDisposition &svCommonwealth; (objGetSovereign gSource)) 'friend) will always be true, since only Commonwealth and Korolov (Corporate) ships call it. It seems like that check should be applied to the potential witnesses instead.

Also, shouldn't the potential witness need to be able to detect the player?

It might also be useful to be able to set all objects of a particular sovereign to ignore piracy, too. That would just require one more check to see if the potential witness's sovereign has an attribute.

george moromisato 31 Jan 2017:

I've made the following changes in 1.7 Beta 6:

  • Ignore any witnesses with the nonInterference attribute.
  • Ignore any witnesses whose sovereign has the nonInterference attribute.
  • Ignore any witnesses that cannot detect the player.

Thanks!