Electronic Disruption Missile
Moderators: winston, another_commander
- Amen Brick
- Deadly
- Posts: 187
- Joined: Sat May 10, 2008 5:22 pm
- Location: Bolton!
Electronic Disruption Missile
Would it be possible to implement a missile that knocked out 1-4 random electronic aids (Compass, ECM, etc)?
- 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:
You could use a combo of scriptActionOnTarget (or its funky JS equivalent) and removeEquipment, plus a few dice rolls, to randomly take out a player's systems. This might be rather harsh though - is there a script action to set equipment to 'damaged' rather than removing it outright?
I suppose you could use a timed script to make the effect non-permanent - having a missile temporarily disrupting a player's witchdrive injectors would be quite cool. In fact, wasn't there something in LB's Assassins that did this?
Anyhoo, something along these lines might be quite good as a variation for the Violet Flax disruptor missile, as at the moment it has little effect on the player. It's quite a distinctive-looking missile so you'd know to avoid it.
I suppose you could use a timed script to make the effect non-permanent - having a missile temporarily disrupting a player's witchdrive injectors would be quite cool. In fact, wasn't there something in LB's Assassins that did this?
Anyhoo, something along these lines might be quite good as a variation for the Violet Flax disruptor missile, as at the moment it has little effect on the player. It's quite a distinctive-looking missile so you'd know to avoid it.
Download Resistance Commander plus many other exciting OXPs HERE
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Yes, there is. You can damage stuff in JS by scripting as follows (example how to damage Docking Computers):Ramirez wrote:You could use a combo of scriptActionOnTarget (or its funky JS equivalent) and removeEquipment, plus a few dice rolls, to randomly take out a player's systems. This might be rather harsh though - is there a script action to set equipment to 'damaged' rather than removing it outright?
Code: Select all
P.setEquipmentStatus("EQ_DOCK_COMP","EQUIPMENT_DAMAGED");
Code: Select all
P.setEquipmentStatus("EQ_DOCK_COMP","EQUIPMENT_OK");
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Yes, McLane is using this. Just remove the equipment and add new equipment with the same name but preceded with "damaged". This will do the trick.Ramirez wrote:This might be rather harsh though - is there a script action to set equipment to 'damaged' rather than removing it outright?
Temporary disabling it would be possible. e,g, with a timer. However, when it is damaged, it should stay broken. In normal play equipment is also not selfrepairing.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- 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:
Yep. Have a look into Anarchies.Eric Walch wrote:Yes, McLane is using this. Just remove the equipment and add new equipment with the same name but preceded with "damaged". This will do the trick.
The AI-methods you would have to use are these (for other equipment you have of course to change the names):
Code: Select all
"safeScriptActionOnTarget: removeEquipment: EQ_ECM", "safeScriptActionOnTarget: awardEquipment: EQ_ECM_DAMAGED"
Or, alternatively, you could do it in the missile's death_actions. But this has the disadvantage that death_actions don't care for what has caused the death. So even if the missile explodes on launching it would do its work. Not desirable.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
I don't think you can ask for a list of equipment a player has. You just have to try equipment a player could have. I just wrote an piece of untested code:
Call the function from the AI with: "sendScriptMessage: damageEquipment"
The JS code creates a list of equipment that you may to damage. Than select a random one from the list. At last, when the player has it, damage it. And probably you might add a change factor so it is not always doing things.
Before 1.71 you had to remove the original first or you ended up with both the working and damaged one in your directory, but with the new commands in 1.71.2 a_c mentioned above it is just one command.
Code: Select all
this.damageEquipment = function()
{
let list = ["EQ_ADVANCED_COMPASS", "EQ_DOCK_COMP", "EQ_ECM", "EQ_FUEL_INJECTION", "EQ_TARGET_MEMORY"]
let equipment = list[Math.floor(Math.random() * list.length)]
if(player.hasEquipment(equipment) player.setEquipmentStatus(equipment, "EQUIPMENT_DAMAGED")
}
The JS code creates a list of equipment that you may to damage. Than select a random one from the list. At last, when the player has it, damage it. And probably you might add a change factor so it is not always doing things.
Before 1.71 you had to remove the original first or you ended up with both the working and damaged one in your directory, but with the new commands in 1.71.2 a_c mentioned above it is just one command.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Cmdr. Maegil
- Sword-toting nut-job
- Posts: 1294
- Joined: Tue Feb 27, 2007 10:28 pm
- Location: On the mend in Western Africa
About restoring the equipment: it'd make sense for an EMP to burn out the electronics, but such a strong pulse should wreck them all and cook any ionized hulls nearby - that's an energy bomb's effect, so you're looking at much more subtler effects such as simply resetting the OS and forcing them to waste time rebooting.
This seems enough to soften a target, and won't affect so much the game balance.
This seems enough to soften a target, and won't affect so much the game balance.
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
I'm obviously not one of them.
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
@Cmdr. M - I like those ideas - even shutting the drive computers down for say 10s (mixing all that fuel in the right ratio is complicated business - and they're using microwaves now to non-lethally stop a car that refuses to slow for a check-point so this is real life stuff) - would mean you'd be having a very bad day unless you're shields were up to it...
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Captain Hesperus
- Grand High Clock-Tower Poobah
- Posts: 2310
- Joined: Tue Sep 19, 2006 1:10 pm
- Location: Anywhere I can sell Trumbles.....
Wasn't there a thread about a missile/bomb that causes ships to lose the ability to steer/shoot for a period of time?DaddyHoggy wrote:@Cmdr. M - I like those ideas - even shutting the drive computers down for say 10s (mixing all that fuel in the right ratio is complicated business - and they're using microwaves now to non-lethally stop a car that refuses to slow for a check-point so this is real life stuff) - would mean you'd be having a very bad day unless you're shields were up to it...
Could that not be implemented?
Captain Hesperus
The truth, revealed!!
Hey people
I tried out Eric's bit of code with the Violet Flax override missile and it works. As well as dumping my cargo it damaged my docking computer. You have to check the F5 screen to see if anything's been damaged though - would it be possible to do a commsMessage to state that a specific system has been damaged? If not, I'll just put in a general warning.
I tried out Eric's bit of code with the Violet Flax override missile and it works. As well as dumping my cargo it damaged my docking computer. You have to check the F5 screen to see if anything's been damaged though - would it be possible to do a commsMessage to state that a specific system has been damaged? If not, I'll just put in a general warning.
Download Resistance Commander plus many other exciting OXPs HERE
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Ay, don't blame me when something gets damaged. And when it does, you can look at one of the GRS stations for repair.Ramirez wrote:I tried out Eric's bit of code with the Violet Flax override missile and it works.... it damaged my docking computer.
I don't think there is a function to get the display name of the equipment. The easiest solution would be to make two corresponding lists. One with the internal names and the other with the display names, and than generate a random number to be used for both lists.Ramirez wrote:You have to check the F5 screen to see if anything's been damaged though - would it be possible to do a commsMessage to state that a specific system has been damaged?
It gets more complicated as we now have a two dimensional array.
Code: Select all
this.damageEquipment = function()
{
this.list = [["EQ_ADVANCED_COMPASS", "EQ_DOCK_COMP", "EQ_ECM", "EQ_FUEL_INJECTION", "EQ_TARGET_MEMORY"], ["Compass", "Docking Computer", "ECM", "Fuel Injection", "Target Memory"]]
let equipment = Math.floor(Math.random() * list[0].length)
if(player.hasEquipment(this.list[0][equipment])
{
player.setEquipmentStatus(this.list[0][equipment], "EQUIPMENT_DAMAGED")
player.consoleMessage(this.list[1][equipment],5)
}
}
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Amen Brick
- Deadly
- Posts: 187
- Joined: Sat May 10, 2008 5:22 pm
- Location: Bolton!