hasEquipment and lasers?

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
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

hasEquipment and lasers?

Post by Kaks »

In vanilla 1.70 I've tried the following in js

Code: Select all

if (player.hasEquipment('EQ_WEAPON_MILITARY_LASER')) {
//ooh nice!
....
}
but it returns false whether I've got the military laser or not.

I looked at the wiki, and the twin plasma lasers are are the only lasers that can be tested for. Is there a way in javascript to find out if we've got any of the other lasers equipped anywhere on board?

Cheers,

Kaks
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 »

Hmmm, I tried to see if I could figure out the type of laser depending on weaponRange but, at least in 1.70 vanilla, it's always0 if you've got military, pulse, and beam lasers installed...

Is that working as intended?

Cheers,

Kaks
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

but it returns false whether I've got the military laser or not
When you look in the save file you'll figure out why it is not working. Missiles an weapons are stored differently and in an other array. I think this also didn't work in the old system.
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 »

I did get that impression....

Shame, it would really help to know the lasers equipped, so we can scale the challenge up & down accordingly.

I ended up using the player's score. Unlikely someone manages 60 odd kills with a pulse laser & a toothpick! :)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Kaks wrote:
Shame, it would really help to know the lasers equipped, so we can scale the challenge up & down accordingly.

I ended up using the player's score. Unlikely someone manages 60 odd kills with a pulse laser & a toothpick! :)
In general it is the player responsibility to make sure he has the right stuff for a fight. It shouldn't be the opponents that adapt to the players outfit.
Post Reply