Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

The Feudal States

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

Moderators: winston, another_commander

zevans
---- E L I T E ----
---- E L I T E ----
Posts: 332
Joined: Mon Jul 06, 2009 11:12 pm
Location: Uncharted backwaters of the unfashionable end of the western spiral arm

Post by zevans »

That's no moon!
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

What about some megaclass ships serving as house HQ's?
A super-weapon called plasma catapult?
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
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 ideas - all good stuff. Back to scripting, unfortunately I'm away from my mac for a bit and am trying to do some work on a rather old PC, without any of the cool debug tools I'm used to. It's all very frustrating!!

From earlier on,
Thargoid wrote:

2) Do a scan for the ships within range, filter as necessary and then step through the produced array and for each use <ship>.AIState or <ship>.reactToAIMessage to either change the AI state of the ship or send the given AI state a message - depending on how you want to do it.
What's the correct syntax for sending a reactToAIMessage to a ship's target? I have the following in the ship script of a tournament target that the player has to destroy.

Code: Select all

this.shipDied = function()
{var buoy = system.shipsWithRole("feudal-buoy")
  this.ship.target = buoy
  this.ship.target.reactToAIMessage("CHECK_DISTANCE")}
The system.shipsWithRole part is working fine but I'm not sure about the rest. Also, are there any tips for debugging OXPs on a PC?
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Code: Select all

this.shipDied = function()
{var buoy = system.shipsWithRole("feudal-buoy")[0]; // <- Its an array and using [0] takes the first entry
  this.ship.target = buoy
  this.ship.target.reactToAIMessage("CHECK_DISTANCE")}
But probably you should check before if this feudal-buoy is found at all to avoid errors.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5527
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Wot he sed ;)

As for debugging OXPs on a PC, install debug OXP and have the JS debug console running. You can then access probably a fair amount of what you're missing from your Mac. It's a separate window, but from my understanding does most (but not all) of what the built-in one on Mac does.

You can grab the console from Berlios, and the debug OXP to link it with Oolite from the wiki.

As for your code, if you're sending it to the buoy, then I would just use buoy.reactToAIMessage("CHECK_DISTANCE"). No need to mess around with targets and such (especially given the ship is technically dead at this point).

Of course having checked that the buoy actually exists as Svengali correctly says, as don't forget this.shipDied will fire no matter who/what killed the ship, and when it happened.
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 »

Back to the familiar ground of the mac. Still haven't got the buoy.reactToAIMessage("CHECK_DISTANCE") thing to work. For the moment I'm using a workaround:

Code: Select all

var buoy = system.shipsWithRole("feudal-buoy")[0]
this.ship.target.setAI("feudal-buoy-checkAI.plist")
where a temporary AI does the necessary distance check before returning to the normal buoyAI.plist. I'll look into it again to see if I'm still missing something.

Anyway, while I crack on with the tournament events I've packaged up the progress so far - this includes the new shaders plus some various other tweaks:

Feudal States WIP v0.3
Download Resistance Commander plus many other exciting OXPs HERE
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 »

In this thread there was mention of using awardEquipment("EQ_MISSILE_REMOVAL") to clear a player's weapon pylons. However this doesn't work - it actually adds the 'remove pyon-mounted weapons' option to the player's F3 screen.

I know that under 1.73, removeEquipment now works for pylon-mounted items, but I'd like to clear a player's pylons without knowing exactly what kind of missiles are fitted. Is there way of doing this?
Download Resistance Commander plus many other exciting OXPs 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 »

Not that I know of, but one of the coders may be more knowledgeable here.

However, you could test for all missiles and remove them if present. Something like:

Code: Select all

for(var i; i==0; i<player.ship.missiles)
{
     if(player.ship.hasEquipment("EQ_MISSILE")) player.ship.removeEquipment("EQ_MISSILE")
     if(player.ship.hasEquipment("EQ_HARDENED_MISSILE")) player.ship.removeEquipment("EQ_HARDENED_MISSILE")
     .
     .
     .
}
EDIT: Hmmm. Looks like missiles is no JS-property, so we cannot actually test how many missiles the player has. Seems you have to devise something different then.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

There's the isExternalStore property that applies to mines, missiles, external fuel tanks, and whatever else uses the missiles slots

You can check through all your equipped items and remove the ones that have isExternalStore == true
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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 »

Interesting. Hadn't come across it yet.

But how would you check through all items? AFAIK you would need the infoForKey-method, so you would still have to know the keys for all possible missiles beforehand. And how often would you run the routine, because the player could have multiple missiles/mines of one type? Seems all not very elegant to me.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2268
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

"Any other things people can think of that might be the subject of a sneaky recon mission?"

what about something like the Constrictor? ie, there's apparently a new and dangerous ship by xxx faction and someone wants more info, so you need pics. of course, the script could trigger and attack by this deadly vessel as soon as it realises it's been photographed.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Ramirez wrote:
there was mention of using awardEquipment("EQ_MISSILE_REMOVAL") to clear a player's weapon pylons. However this doesn't work - it actually adds the 'remove pyon-mounted weapons' option to the player's F3 screen.
Ok, awardEquipment("EQ_MISSILE_REMOVAL") now works in trunk, and will be added to maintenance asap.

There might be a 1.73.4 release in the not too distant future.
Hey, free OXPs: farsun v1.05 & tty v0.5! :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 »

Kaks wrote:
Ok, awardEquipment("EQ_MISSILE_REMOVAL") now works in trunk, and will be added to maintenance asap.
That would come in very handy indeed! For the tournament I've got around this by deploying minesweepers to deal with missiles launched by both the player and NPCs. These have finite range though and I want to make sure the player can't cheat by loading up with weapons.

I've just finished the third event - Quartet - where you have to compete against three other nobles to capture a target drone. Sounds easy but even I got wiped out one or two times. I might re-use some of the AI and script to do a capture the flag event, which should be quite fun.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

Yes Nice ones.

Also include SpaceCastle(TM) attacks. Events where the player has to bomb the base of another house in a coordinated attack.
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
Rustybolts
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Sun Jun 07, 2009 6:22 pm
Location: UK

Post by Rustybolts »

Sounding very cool. :D
STE.+ Firefly/Dragonfly + BlackJacksbullion v.1.23 link below.
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
Image
Post Reply