First OXP (Crybaby)

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

Moderators: another_commander, winston

User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

First OXP (Crybaby)

Post by Dr.Tripsa »

I'm embarking on my first OXP (it's intentional involved so I can wrap my head around certain concepts while working on it) the basis is as follows

1. creates a new equipment (perhaps missile or bomb type?) EDIT : most likely pylon mounted missile type
2. when launched the device emits an SOS or registers as a bigger threat than the owner.
3. should take cargo space, to limit number of uses. 1 use = 1 ton EDIT : Pylon mount takes care of this
EDIT 4. Possible to make this equip unavailable at standard stations, as it would in theory be using an illegal transponder?

can some of you nice folks point me in the right places to look at for where to begin here?
Last edited by Dr.Tripsa on Thu May 03, 2012 6:33 pm, edited 1 time in total.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: First OXP (Crybaby)

Post by SandJ »

Dr.Tripsa wrote:
1. creates a new equipment (perhaps missile or bomb type?)
3. should take cargo space, to limit number of uses.
If it is on a pylon, then that limits the number of uses.
Dr.Tripsa wrote:
3. should take cargo space, to limit number of uses.
Was it your intention to limits its number to just one - if you make it equipment that should have that effect.
Dr.Tripsa wrote:
2. when launched the device emits an SOS
3. 1 use = 1 ton
That is very heavy for a radio beacon.

The Cargo Shepherd might be a good example of a piece of pylon-mounted equipment.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: First OXP (Crybaby)

Post by cim »

Dr.Tripsa wrote:
I'm embarking on my first OXP (it's intentional involved so I can wrap my head around certain concepts while working on it) the basis is as follows

1. creates a new equipment (perhaps missile or bomb type?)
2. when launched the device emits an SOS or registers as a bigger threat than the owner.
3. should take cargo space, to limit number of uses. 1 use = 1 ton

can some of you nice folks point me in the right places to look at for where to begin here?
Overall OXP information: [wiki]OXP_howto[/wiki]
Scripting reference: [wiki]Oolite_JavaScript_object_model[/wiki]

New equipment is defined in [wiki]equipment.plist[/wiki]. Making the equipment itself take up cargo space is impossible, but you could make it consume 1t of Minerals/Alloys/Narcotics from the hold when used. Alternatively, if you make it a missile or a mine, it'll take up a pylon slot in place of a normal missile, which easily restricts how many can be carried at once.

Point 2 requires messing around with the AIs of nearby ships - see [wiki]OXP_howto_AI[/wiki] for AI coding, and the Ship object in the Javascript reference for how to adjust some of the parameters used.

Good luck!
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: First OXP (Crybaby)

Post by Dr.Tripsa »

Finally beginning work on this,

equipment.plist

Code: Select all

(
	(
	8, 
	1000, 
	"Crybaby Transponder", 
	"EQ_CRY_BABY_MINE", 
	"Cry, baby, cry. Make your momma sigh. Emergency beacon.", 
		{
		"available_to_all" = true;
		"requires_empty_pylon" = true;
		}
        // unneeded?  "script" = "CrybabyLaunch.js";
	)
)
CrybabyAI.plist

Code: Select all

{
	GLOBAL = {
	ENTER = ("commsMessageByUnpiloted: Crying!!", broadcastDistressMessage); 
	EXIT = (); 
	UPDATE = (broadcastDistressMessage, "pauseAI: 8"); 
       // Thanks to Eric Walch!
	}; 	
}
shipdata.plist

Code: Select all

{
	crybaby_transponder = {
                "like_ship" = "barrel";
                //THANKS!! to Wyvern_Mommy for that!
		ai_type = "CrybabyAI.plist";		
		unpiloted = yes;
                "roles" = EQ_CRY_BABY_MINE crybaby_transponder";
	};

}
CrybabyLaunch.js <= TBD, may be unneeded...

The above should be enough to register it as equipment available to players in tech level 9 worlds, for 100CR as a single use "mine". The AI -should- be simple enough to keep it doing nothing but spamming for help, which is the idea.

When used it should free itself from a pylon (making it single use) by default as a "_MINE".

Any help at this point would be appreciated :S
Last edited by Dr.Tripsa on Mon Jan 21, 2013 8:35 pm, edited 3 times in total.
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: First OXP (Crybaby)

Post by Eric Walch »

This UPDATE needs a pause to become:

Code: Select all

UPDATE = (broadcastDistressMessage, "pauseAI: 8"); 
Without pause, it is broadcasted 4 times every second. That is a bit overuse of cpu time. Specially because identical messages are suppressed and not visible at all.

One problem will be that the beacon needs a primary aggressor that is already targeting the beacon in attack mode. If not present, broadcastDistressMessage will do nothing. :(

EDIT: This behaviour is different that written in the wiki were it is suggested that you can set a primary target that will become the "aggressor". I looked it up, and the wiki was correct up to Oolite 1.74. In 1.76 there already needed to be an explicit primary aggressor. Probably to prevent buggy behaviour where a viper went after an unwanted primary target. (Going to edit the wiki now....)
Last edited by Eric Walch on Mon Jan 21, 2013 8:37 pm, edited 1 time in total.
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: First OXP (Crybaby)

Post by Dr.Tripsa »

thanks for that Eric, fixing...

the lack of aggressor being a factor is irksome, mayby I should use another "like_ship" instead and see if I can give it some cargo , perhaps gold, as bait?

Almost there, reworked into a tasty floating cargo... that explodes if scooped by npc, only one problem now...

it launches at an extreme rate of speed (injectors needed just to catch it!) HELP!
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: First OXP (Crybaby)

Post by Dr.Tripsa »

UPDATE!

Crybaby is almost ready, It's had to change a bit...
Credit due to Wyvern_Mommy for the booby-trap concept!

Code: Select all

The Crybaby EDM (Extreme Defensive Measures) Mine
----------------------------------------------------
Deployed like a mine, appears as a cargo canister...
Silently waits while monitoring transponder codes and cross referencing these with GalCops Database.
(there is much debate as to if its access to this database is legal)
When it detects a known pirate within 200m, a Quirium/Hydrogen explosion is triggered.

Effective Range: 1/2Km (500)
Effective Energy: 5Keu (5000)
So before I release this I need input...

How much should it cost?
What tech level do you suggest?
What do you think of the Detection/damage range?
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: First OXP (Crybaby)

Post by cim »

If you're using the AI command dealEnergyDamageWithinDesiredRange for the explosion, the damage formula is:

Code: Select all

(Energy * Effective Range) / (6.76 * Actual Range * Actual Range)
So, at 200m, this would do:

Code: Select all

(5000 * 500) / (6.76 * 200 * 200) = 9 points of damage
For comparison, a pulse laser hit does 16, and a missile does around 250. In that case, the explosion probably needs either a lot more power or a little more range.

If you're using the JS method dealEnergyDamage then the damage formula is simpler, though the mine will require Oolite 1.77 or later.

Code: Select all

Energy (within effective range)
(Energy * Effective Range) / (Actual Range * Actual Range) (outside effective range)
It would therefore do 5000 damage to the target, enough to destroy a Behemoth twice. At the edge of scanner range, it will still do around 2 points of damage. In this case, you can probably reduce the power substantially (just set it to the amount of damage you want the mine to do to its target, in fact)
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: First OXP (Crybaby)

Post by Dr.Tripsa »

thank you for this cim, I wasn't aware of the constants there... I'll recalculate based on those figures :)
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: First OXP (Crybaby)

Post by Dr.Tripsa »

UPDATE:

took cim's advice and revised to dealEnergyDamage, this caps max damage at 256 within 1/2Km of the blast.
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Rorschachhamster
---- E L I T E ----
---- E L I T E ----
Posts: 274
Joined: Sun Aug 05, 2012 11:46 pm
Contact:

Re: First OXP (Crybaby)

Post by Rorschachhamster »

Dr.Tripsa wrote:
...
(there is much debate as to if its access to this database is legal)
When it detects a known pirate within 200m, a Quirium/Hydrogen explosion is triggered.
Food for thought:
If you are an offender using it... BOOM? :lol:
Does it just register OTHER pirates? :?:
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: First OXP (Crybaby)

Post by Dr.Tripsa »

Rorschachhamster wrote:
Dr.Tripsa wrote:
...
(there is much debate as to if its access to this database is legal)
When it detects a known pirate within 200m, a Quirium/Hydrogen explosion is triggered.
Food for thought:
If you are an offender using it... BOOM? :lol:
Does it just register OTHER pirates? :?:
Hmm fair point, I could do that, or just make it unavailable to players with an offender status...

For the moment, until I ponder this a bit more I've added
"requires_clean" = yes;
to the equipment.plist for this.

Test Version available, at tech level 9 systems, with clean status.. for 100CR

http://dl.dropbox.com/u/9855374/Crybaby ... .0.oxp.zip
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: First OXP (Crybaby)

Post by Diziet Sma »

Dr.Tripsa wrote:
Test Version available, at tech level 9 systems, with clean status.. for 100CR
Very cheap, for a WMD.. :mrgreen:
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: First OXP (Crybaby)

Post by Dr.Tripsa »

Less WMD than you might think, it only has an effective blast radius of 1/2 Km (by contrast the scanner display is what .. 10Km radius? ) additionally it is only activated by the presence of a pirate (entity.hasRole("pirate")) within 1/5 Km.


The reason for the test release is so people can give feedback on pricing/availability after playing with it a bit :)
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: First OXP (Crybaby)

Post by Eric Walch »

Dr.Tripsa wrote:
it is only activated by the presence of a pirate (entity.hasRole("pirate")) within 1/5 Km.
Not true as this tests if a "pirate" role is among the possible roles for that ship, that may be added as a trader at the moment. You probably need: (entity.primaryRole == "pirate")
Post Reply