Page 5 of 5

Posted: Tue Oct 30, 2007 11:07 am
by Commander McLane
Just go ahead this way. Using a counter should be pretty simple. Increment it by one on each use and if it's ten, remove the equipment.

For use of variables you may also look at the short script for the Fuel Scoops Enhancer I was posting here once. It works by incrementing a variable and awarding a little bit of fuel after a couple of increments.

One problem I had with variables was that in 1.69.1 local_foo variables don't seem to be able to store integers, which is what you need for a counter. No problem with mission_foo variables, though.

Posted: Thu Nov 01, 2007 9:47 am
by Ramirez
I've played around with some options but have run into a couple of snags. The testForEquipment method doesn't seem to want to work with missiles and mines (i.e. EQ_XXX_MISSILE or EQ_XXX_MINE). I can get around this by having a separate EQ_CHAFF_LAUNCHER that exists as a piece of equipment fitted into the ship, and then use this to set the chaff_count upon launch. I would still need to have individual chaff mines so the player can use them at will, but these could be regarded as refills for the chaff dispenser.

Would anyone be able to confirm whether testForEquipment works with missiles and mines or not, or if I'm just missing something?

I then had a plan to keep re-equipping the player with a chaff mine until their chaff_count ran out. I've tried putting awardEquipment: EQ_CHAFF_MINE as a deathAction in the mine's shipdata but nothing seems to be happening. Maybe I'll try putting this in the script as a STATUS_IN_FLIGHT occurance rather than in the shipdata.

Posted: Thu Nov 01, 2007 11:01 am
by Commander McLane
Yes, indeed missiles and mines can not be queried by testForEquipment. They also cannot be removed by removeEquipment (and probably also not be awarded as well). I think I read that recently in a post of LittleBear, so not my personal finding.

Posted: Sat Nov 03, 2007 4:03 pm
by Ramirez
I think I've worked out a solution to this. I'll add a post to the Missiles and Bombs thread in the Expansion Packs forum.