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.
Some things
Moderators: winston, another_commander
- Commander McLane
- ---- 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:
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.
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.
Download Resistance Commander plus many other exciting OXPs HERE
- Commander McLane
- ---- 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: