Ship equipment
Moderators: winston, another_commander
-
- Dangerous
- Posts: 84
- Joined: Wed Nov 14, 2012 11:57 am
Ship equipment
I'm working on oxp and have a question - how to correct detect the enemy's equipment ?
I use event shipTargetAcquired and call target.equipmentStatus(id)
Seem it works wrong, because I often check for "EQ_MISSILE" and the code return "EQUIPMENT_UNAVAILABLE" and after that the ship can attack with a missile
I use event shipTargetAcquired and call target.equipmentStatus(id)
Seem it works wrong, because I often check for "EQ_MISSILE" and the code return "EQUIPMENT_UNAVAILABLE" and after that the ship can attack with a missile
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Ship equipment
You might be checking if the ship can have the equipment. To find out what it actually has, try the ship property equipment
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: Ship equipment
The ship.equipment will give you an array of the equipment that the target ship has, as Smivs says. But note that missiles aren't classed as equipment in this case (nothing that is pylon mounted is classed as equipment, those are available via ship.missiles, again as an array of items that the target ship currently has on its pylons.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
-
- Dangerous
- Posts: 84
- Joined: Wed Nov 14, 2012 11:57 am
Re: Ship equipment
I disagree. Sometimes ship has missile and equipmentStatus is EQUIPMENT_OK, but in the most cases the status is EQUIPMENT_UNAVAILABLE when the ship has missiles.
The same thing with the lasers. I.e. when forwardWeapon is Beam laser, equipmentStatus might be EQUIPMENT_UNAVAILABLE.
Looks like it depend on the shipdata and shipyard configs.
The same thing with the lasers. I.e. when forwardWeapon is Beam laser, equipmentStatus might be EQUIPMENT_UNAVAILABLE.
Looks like it depend on the shipdata and shipyard configs.
-
- Dangerous
- Posts: 84
- Joined: Wed Nov 14, 2012 11:57 am
Re: Ship equipment
Code: Select all
player.consoleMessage(target.equipmentStatus("EQ_MISSILE"));
player.consoleMessage(target.equipmentStatus("EQ_WEAPON_PULSE_LASER"));
player.consoleMessage(target.equipmentStatus("EQ_WEAPON_BEAM_LASER"));
I often see two or one line. What can be the reason ?
Re: Ship equipment
MadHollander, try using
It should do what you want - inform the player of the equipment the target DOES have, and not whether it might theoretically equip it or not.
As I understand Thargoid and Smivs, equipmentStatus will not work correctly at all for missiles. I suppose it might be similar with lasers.
Code: Select all
player.consoleMessage(target.equipment);
As I understand Thargoid and Smivs, equipmentStatus will not work correctly at all for missiles. I suppose it might be similar with lasers.
Re: Ship equipment
In this context neither missiles nor lasers are equipment, hence equipmentStatus isn't applicable to them. They are accessed separately, as I already mentioned for missiles (or more strictly pylon mounted items including mines and their oxp equipment derivatives).
Hence neither will appear in the equipment array, so your check is meaningless. If you want to know if a ship has anything on its pylons, check if ship.missiles exists and ship.missiles.length > 0 If it is you can then parse through the array and check exactly what is on each pylon.
Hence neither will appear in the equipment array, so your check is meaningless. If you want to know if a ship has anything on its pylons, check if ship.missiles exists and ship.missiles.length > 0 If it is you can then parse through the array and check exactly what is on each pylon.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Dawn Trader
- Competent
- Posts: 45
- Joined: Thu Sep 29, 2011 3:45 am
Re: Ship equipment
Let me get this straight... you want an oxp that lets you know what is hidden in the innermost region of another ship?????? Why don't you make an oxp that makes all ship transparent like glass????Mad Hollander wrote:I'm working on oxp and have a question - how to correct detect the enemy's equipment ?
With this oxp.. all the mystery and indecisions about engaging the ship is gone. the response of a ship to your attentions should be surprising and once the weapon is disclosed then you can say "OH OH" I am a goner.
Cloning, It's not for everyone.
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Ship equipment
<grins> I thought exactly that just now when six assassins jumped me at the Onorti WP. There was no time to dwell upon what ordnance they might have been carrying though - it was execute evasion plan beta (and pretty damn quickly too). Ahh yes, the dangerously interesting life of an ace courier!Dawn Trader wrote:"OH OH" I am a goner.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Ship equipment
Repeated consoleMessages with the same content will not appear again within a few seconds.Mad Hollander wrote:I often see two or one line.
As others said, the correct way is the ship.missiles array. I hope you will be use it for some balanced changes or power up NPCs and not the player.
- Yah-Ta-Hey
- ---- E L I T E ----
- Posts: 333
- Joined: Thu Feb 24, 2011 2:31 am
- Location: Traversing new opportunities in space
Re: Ship equipment
Ta-pockata ta-pockata ta-pockataCody wrote:Ahh yes, the dangerously interesting life of an ace courier!
walter mitty
Bartle tester says while I am drinking evil juice, I am: 80% killer/ 80 % achiever/ 33% explorer and 0% socializer.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Ship equipment
Sounds like you've found another vocation as challenging as that of contrabandista!Cody wrote:<grins> I thought exactly that just now when six assassins jumped me at the Onorti WP. There was no time to dwell upon what ordnance they might have been carrying though - it was execute evasion plan beta (and pretty damn quickly too). Ahh yes, the dangerously interesting life of an ace courier!Dawn Trader wrote:"OH OH" I am a goner.
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
Re: Ship equipment
Exactly why I suggested using target.equipment. The missiles & laser should remain a mystery.Thargoid wrote:In this context neither missiles nor lasers are equipment, hence equipmentStatus isn't applicable to them. They are accessed separately, as I already mentioned for missiles (or more strictly pylon mounted items including mines and their oxp equipment derivatives).
Hence neither will appear in the equipment array, so your check is meaningless. If you want to know if a ship has anything on its pylons, check if ship.missiles exists and ship.missiles.length > 0 If it is you can then parse through the array and check exactly what is on each pylon.
-
- Dangerous
- Posts: 84
- Joined: Wed Nov 14, 2012 11:57 am
Re: Ship equipment
You are right - I'm working on oxp that detect enemy equipment.Dawn Trader wrote:Let me get this straight... you want an oxp that lets you know what is hidden in the innermost region of another ship?????? Why don't you make an oxp that makes all ship transparent like glass????Mad Hollander wrote:I'm working on oxp and have a question - how to correct detect the enemy's equipment ?
With this oxp.. all the mystery and indecisions about engaging the ship is gone. the response of a ship to your attentions should be surprising and once the weapon is disclosed then you can say "OH OH" I am a goner.
1 all external equipment can be seen, theoretically, with an unarmed eye - look at the Dark Wheel novel in the very beginning.
2 hence it can be seen with a subsystem
3 moreover, the most of the equipment http://wiki.alioth.net/index.php/Catego ... pment_OXPs by the fact do the same
4 the same oxp's have significantly bigger impact on balance
5 NPC do the same, i.e. when the role between pirate or assassin is chosen.
The main Idea of the oxp is to give some piece of information that can help to make a decision
1. attack or not
2. who is the first
3. when is to chase or escape during dogfight
Last edited by Mad Hollander on Mon Dec 30, 2013 12:44 pm, edited 1 time in total.
-
- Dangerous
- Posts: 84
- Joined: Wed Nov 14, 2012 11:57 am
Re: Ship equipment
I see no sense to power up NPC when the most popular tactic is "execute evasion plan beta". Actually, in vanilla oolite there are lot's of places when the enemy are too strong. I.e. five, six and more groups of assassins or pirates.Norby wrote:Repeated consoleMessages with the same content will not appear again within a few seconds.Mad Hollander wrote:I often see two or one line.
As others said, the correct way is the ship.missiles array. I hope you will be use it for some balanced changes or power up NPCs and not the player.
Actually, I was starting this oxp when I tried Adder. There is too little energy, single laser, single missile and etc. I like this ship but I don't like to escape every second fight. With this oxp I can, at least, know the chances before fight, not after.