Page 9 of 46

Posted: Wed Aug 26, 2009 9:45 pm
by zevans
That's no moon!

Posted: Sun Aug 30, 2009 11:06 pm
by pagroove
What about some megaclass ships serving as house HQ's?
A super-weapon called plasma catapult?

Posted: Tue Sep 01, 2009 3:19 pm
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?

Posted: Tue Sep 01, 2009 3:24 pm
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.

Posted: Tue Sep 01, 2009 3:41 pm
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.

Posted: Tue Sep 08, 2009 9:20 pm
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

Posted: Thu Sep 17, 2009 1:36 pm
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?

Posted: Thu Sep 17, 2009 2:38 pm
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.

Posted: Thu Sep 17, 2009 2:44 pm
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

Posted: Thu Sep 17, 2009 4:35 pm
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.

Posted: Thu Sep 17, 2009 5:22 pm
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.

Posted: Mon Sep 21, 2009 1:32 am
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.

Posted: Mon Sep 21, 2009 5:10 pm
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.

Posted: Mon Sep 21, 2009 9:05 pm
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.

Posted: Mon Sep 21, 2009 9:06 pm
by Rustybolts
Sounding very cool. :D