This was so easy I am surprised that it hasn't been done already!
Here is an extension to override a handful of ships with differing configurations:
Prototype Random Equip mod
I wrote the script to choose weapon and shield at ship creation time from an attached array in the event. I am using it in conjunction with a Unique Stations mod that throws in some unique bad guys and 'boss' type ships. I wanted the 'bosses' to be different and challenging- so an array of configurations seemed like a good place to start.
The example mod changes the Corsair, Corsair-II, Viking and also presents a meaner version of the Corporate Cruiser.
The method is very simple to implement, so I hope to write a more comprehensive override mod shortly.
A Method for Random Equipment on Ships
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
only a couple problems with it
can you give an example of a random armor (I know how to do it but it would be nice for people who don't know how to)
You can't make weapons secondaryWeapon or general weapons omni or give them FireArc or say where on the ship it goes. This is really needed for bigger ships due to them being slower turning and easier to hide inside of if you can't way where on the ship the weapon goes.
it does look nice though did you test it with player ships?
edit: it would also be nice for an example of a range of values means a certain weapon so you can make something more common.

can you give an example of a random armor (I know how to do it but it would be nice for people who don't know how to)
You can't make weapons secondaryWeapon or general weapons omni or give them FireArc or say where on the ship it goes. This is really needed for bigger ships due to them being slower turning and easier to hide inside of if you can't way where on the ship the weapon goes.
it does look nice though did you test it with player ships?
edit: it would also be nice for an example of a range of values means a certain weapon so you can make something more common.
Crying is not a proper retort!
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
I plan to make some Virtual weapons to deal with the 'omni' factor, but you are right- it has it's limits. So, it's more of a primary weapon and shield equipper.
Playerships aren't the target for me- more varied enemy configurations are.
I suppose it might be fun to have a random weapon selection for the playership.
Playerships aren't the target for me- more varied enemy configurations are.
I suppose it might be fun to have a random weapon selection for the playership.
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
Here is a version with more ship types included from the early game.
Now with more colors!!
Also added more lasers with different colors and a small damage bonus to give an example of how much impact a small variety can have on the game.
Check out those Charon Pirates now! But be warned!
Random Equipment Prototype 2
Now with more colors!!
Also added more lasers with different colors and a small damage bonus to give an example of how much impact a small variety can have on the game.
Check out those Charon Pirates now! But be warned!
Random Equipment Prototype 2
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
I do have a possible workaround for the secondary weapon and shot angles and other lost info from the <device> tag. I haven't been able to set any code into the device tag itself, however, all the attributes that are lacking can be added into the weapon tag itself.
This means creating a set of weapons with the specific attributes for the target ship, and would also mean that the weapon wasn't very useful as loot.
Bad points aside, it would still be possible to create rand equipment for large ships and special configurations.
This means creating a set of weapons with the specific attributes for the target ship, and would also mean that the weapon wasn't very useful as loot.
Bad points aside, it would still be possible to create rand equipment for large ships and special configurations.
- Ttech
- Fleet Admiral
- Posts: 2767
- Joined: Tue Nov 06, 2007 12:03 am
- Location: Traveling in the TARDIS
- Contact:
Periculi wrote:Here is a version with more ship types included from the early game.
Now with more colors!!
Also added more lasers with different colors and a small damage bonus to give an example of how much impact a small variety can have on the game.
Check out those Charon Pirates now! But be warned!
Random Equipment Prototype 2
Interesting. SO you beat me to it.

- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
That's brilliant !
I would like to see the same for autons ! I never used some of them because they are too weak, or just because I dislike them, but if their weapons and equipments could be random... 8)
I would like to see the same for autons ! I never used some of them because they are too weak, or just because I dislike them, but if their weapons and equipments could be random... 8)
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
Of all the ships, seems to me that the autons actually should just have the static equipment. But, you should be able to cut and paste that event code into an auton and adjust the equipment accordingly, as they are a ship like any other.
I am very close to releasing a mod for this involving the early game set of ships, I can throw in the autons with that if you want to wait a little bit.
I am very close to releasing a mod for this involving the early game set of ships, I can throw in the autons with that if you want to wait a little bit.
I really like this mod and it works great when using it along with the "Charon Stronger" mod. A great combo!
I do want to point out that there is a bug within this mod and it has crashed my game twice already. It's within the Steel slaver code, as it already has a shield set in the <Devices> config, and the <OnCreate> installs yet another shield at random.
An easy fix is to simply delete the <Device deviceID="&itYoroiS100;"/> completely from within the <Devices> config, and allow the <OnCreate> to set the random shield. That way there won't be two shields installed on that ship...which is my belief, was the cause for the crashes.
I do want to point out that there is a bug within this mod and it has crashed my game twice already. It's within the Steel slaver code, as it already has a shield set in the <Devices> config, and the <OnCreate> installs yet another shield at random.
An easy fix is to simply delete the <Device deviceID="&itYoroiS100;"/> completely from within the <Devices> config, and allow the <OnCreate> to set the random shield. That way there won't be two shields installed on that ship...which is my belief, was the cause for the crashes.
- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
I have an idea for an improvement of your brilliant mod:
what about using
(itmCreateRandom "s" "c---- -----")
this will pick up a random common 1st level shield.
instead of choosing the shields with a random number, when you add more 1st level shields, even from other mods, they will be selected randomly.
Currently if you want to add a new shield (or weapon) you have to expand the random table.
using itmCreateRandom you have just to add the item, and it will be used.
[EDIT] Fixed name of function
what about using
(itmCreateRandom "s" "c---- -----")
this will pick up a random common 1st level shield.
instead of choosing the shields with a random number, when you add more 1st level shields, even from other mods, they will be selected randomly.
Currently if you want to add a new shield (or weapon) you have to expand the random table.
using itmCreateRandom you have just to add the item, and it will be used.
[EDIT] Fixed name of function

Last edited by digdug on Fri Jan 18, 2008 9:28 pm, edited 1 time in total.
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
digdug did you test that code?
It doesn't even have the correct number of arguments.
Even if it did I don't know any shield that has "c---- -----" in its name.
It doesn't even have the correct number of arguments.
Even if it did I don't know any shield that has "c---- -----" in its name.
Crying is not a proper retort!
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
I think he meant (itmCreateRandom...)