Random equipment assignment

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Helvellyn
Dangerous
Dangerous
Posts: 118
Joined: Wed Jul 11, 2007 11:59 pm
Location: Qudira
Contact:

Random equipment assignment

Post by Helvellyn »

I've just started poking around with trying to make some ArcElite ships, to finish off the original Elite variations (perhaps could include an ArcElite mission or two as well in time, and following that I've a ridiculously ambitious plan to do the Xeer shipyard, but don't hold your breath on that one!)

The question is ship equipment assignments - the description of shipdata.plist on the Wiki seems to suggests that if you give the ship an ECM (for example), it'll always have an ECM, and similarly with other equipment (always the same laser?) Is this right, or is it just the possibility that is set? To get a bit of variety of the equipment would I need a whole load of separate entries?
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

You can use:-

<key>has_ecm</key> <real>0.34</real> (as an example) to give a ship a 34% chance of having the ecm (or any other type of equipment), but think laser has to be set to a type. You can use likeship though, so have one entry for the ship which sets all the equipment probabilities, but then have three entries which are all like_shiped to the first but have a different weapon set as the forward gun. That way you get variety in both equipment and lasers.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Those chances are for NPC ships though.

A player-buyable ship is defined differently.
Riding the Rocket!
User avatar
Helvellyn
Dangerous
Dangerous
Posts: 118
Joined: Wed Jul 11, 2007 11:59 pm
Location: Qudira
Contact:

Post by Helvellyn »

Thanks, it's the NP ships I'm starting with. Some will become player ships eventually. And I've even got my first (incomplete) ship into the game, although due to a miscalculation of scale it was rather on the large size, and seemed to crash the game.

The ArcElite manual mentions the Racer as being built to take some interesting equipment...

Edit: The second one didn't crash the game, but blew me up. Think I've got some adjusting to do here! At least I now have a mostly-finished Racer in the game. Yay, my first addition!
User avatar
Helvellyn
Dangerous
Dangerous
Posts: 118
Joined: Wed Jul 11, 2007 11:59 pm
Location: Qudira
Contact:

Post by Helvellyn »

A little bit of progress (not that Oolite needs yet another additional ship OXP, but hey). I may put the Zartid mission in to make it more than simply added ships.

The Racer can be a player ship now. To try to avoid it being too uber it's supposed to be not a huge advancement on the Cobra MkIII - faster, of course, but possibly a smaller cargo bay. How fast I've not decided; the Cobra being upped to 0.35 for Oolite makes it hard to make the Racer noticeably faster without going into silly speeds. That aside, I just need to re-do my first effort at the texture.

The Caiman has also been added. It is cannon fodder, nothing more; not up to most Snake-class small pirate ships. I'm thinking of looking into a way of making them usually appear in large swarms of just them (perhaps with one large ship to handle the scooping), which fits with the ArcElite datacard description. The only problem with that is that it might be too easy a way to rack up the kills :)

I've not started on any others yet, and quite frankly I've not got a clue what to do about the Copperhead's engine, or the name clash with someone else's Hognose.
User avatar
Cmdr Wyvern
---- E L I T E ----
---- E L I T E ----
Posts: 1649
Joined: Tue Apr 11, 2006 1:47 am
Location: Somewhere in the great starry void

Post by Cmdr Wyvern »

Helvellyn wrote:
The Caiman has also been added. It is cannon fodder, nothing more; not up to most Snake-class small pirate ships. I'm thinking of looking into a way of making them usually appear in large swarms of just them (perhaps with one large ship to handle the scooping), which fits with the ArcElite datacard description. The only problem with that is that it might be too easy a way to rack up the kills :)
Look at the Eagle mk 2 someone made for Oolite. By themselves they're not much of a threat, but they like to come at you in large packs and can be hard to deal with.

The Caiman can be the same way, set up to be seen as escort fighters for pirate Anacondas, say.

The pirate Dragon often appears in the company of a squadron of small light fighters; the fighters fly distraction patterns while the Dragon sneaks up behind and hammers your defenses down. I didn't plan it that way, it's just the kind of tactics Oolite's AI likes to use.
Running Oolite buttery smooth & rock stable w/ tons of eyecandy oxps on:
ASUS Prime X370-A
Ryzen 5 1500X
16GB DDR4 3200MHZ
128GB NVMe M.2 SSD (Boot drive)
1TB Hybrid HDD (For software and games)
EVGA GTX-1070 SC
1080P Samsung large screen monitor
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

@easykill caimans: you could give them a death_actions, that detracts a kill 50% of the time. (when player is near)
This could also hurt your kills when an NPC gets one close to you, so maybe not too good idea.

However if the combined thread of the Caimans is enough to hurt an ironass, the risk may compensate for the easy kill bonus.

Did the aligators have missiles?
maybe lowyield but ECM hardened (dumb) missiles could be a threat to an unsuspecting pilot. (many ships = many missiles)
Riding the Rocket!
User avatar
Helvellyn
Dangerous
Dangerous
Posts: 118
Joined: Wed Jul 11, 2007 11:59 pm
Location: Qudira
Contact:

Post by Helvellyn »

The ArcElite ones didn't have missiles, but there's no reason that they shouldn't have advanced a bit by Oolite time. I don't like the idea of the decrement; it's not really in the spirit of the game IMO. There is possibly a logical explanation for a basic low-yield missile being more resistant to ECMs, rather than it being a more advanced than basic hardhat one, again keeping in the spirit of the Caiman.

I agree with the swarm standing out as a reasonable threat to an Iron Ass; they'd be a bit like TIE Fighters.
User avatar
Helvellyn
Dangerous
Dangerous
Posts: 118
Joined: Wed Jul 11, 2007 11:59 pm
Location: Qudira
Contact:

ArcElite ships

Post by Helvellyn »

My next problem (sorry for the basic questions!) is generating a random number of ships. I'm putting in a script to generate Caiman-specific swarms, but I can't see how to generate a random number of ships by a better method than adding one, doing a check, adding another, or similar. It looks like the number can only be a number, not a method, and no arithmatic in there either.

I've the same sort of question for the generating ships at a random position along the space lane. I suppose Javascript would do this, but I'd prefer to avoid it (having developed a dislike of it due to its vast abuse on web pages).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Code: Select all

system.legacy_addSystemShips("my_role", Math.random() * 5, Math.random());
This will generate a cluster of 0 - 5 ships at an arbitrary point along the main route.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Easist way to do it without resorting to script, would be like this:-

1) have an entry for the Croc called Croc-mum.
2) Give this entry pirateAI and the role pirate.
3) Give it say 3 escorts and set the escort ship to Croc-escort.

No have another entry Croc-escort, like ship it to Croc-mum, but give it zero escorts, the role croc-escort and escortAI.

Oolite will randomly add pirates. If the Croc-mum was chosen as a pirate then 4 Crocs appear if 1 pirate was added in a group. But if Oolite had added 3 pirates in a group and the Croc-mum was chosen three times, then there would be a hoard of 12 Crocs!

It would be fairly easy to do it with (oldstyle plist) script. If scripted, then you'd just need one entry with pirateAI, but give it the role croc-pirate. Then have a script that roles the dice. EG:-

Code: Select all


conditions = ( "d100_number equal 1",
		    "status_string equal STATUS_EXITING_WITCHSPACE" 
					); 
		   do = ("addSystemShips croc-pirate 10 0.1); 
						}, 
					);
That adds a 1% chance of 10 croc-pirates appearing one-tenth the way between the w/p and the station. If you repeat with d=2, addSystemShips croc-pirate 5 0.2 etc you can get a good random effect with a few entries in script. Eg if you had entries for, roles 1 to 10 (on the hundred sided dice), then there would be a 10% chance of groups of crocs appearing, but the number and where they appear would be random. If you also added govenment as a condition, the numbers and chances could be tweaked to make them more or less common in different govenment types.

Edit: 'Course this is more fiddley to do than just the one line needed to do the same sort of thing in the new Java type script!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

better to to use "[d100_number] lessthan %" than equals. If you always use equals there will always be only 1% chance of the condition being met.

ways to tweak:
have escorts. -drawback is that escorts can behave strangely.
have croc-mum spawn additional crocs in setup_actions.
vary the roles percentage croc-pirate(%) to tweak the abundance of individual variants of the same role.

for example:
small-croc(roles: croc-pirate),
small-croc_v2(roles: croc-pirate),
large-croc (roles: croc-pirate(0.2)),
croc-mum (roles: croc-mum croc-pirate(0.05)).
when a croc pirate is called for by script, the cumulative chances of appearing are relatively:
1/2.25*100%=44% for either small croc,
0.2/2.25*100%= 9% of a large croc,
about 2% of a croc mum appearing.

if you added setup-spawned crocs, these mums will then add another few crocs.
Riding the Rocket!
User avatar
Helvellyn
Dangerous
Dangerous
Posts: 118
Joined: Wed Jul 11, 2007 11:59 pm
Location: Qudira
Contact:

Post by Helvellyn »

Hmm, looking at all of that it sounds like the script (I'm assuming Ahruman's example is Javascript) is going to be far and away the simplest, most adaptable, and most general way to go.

Thanks for bearing with me with this.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

J-script is the way to go if you are just starting out, it is the future and way more flexible than the legacy script.

however, don't get intimidated by us 'old hands'.
We just give way more information than you asked for.
(my comments deal with the shipdata.plist, not even with the script for example)

showing off our leet skillz...before jscript renders us obsolete. ;)
Riding the Rocket!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Helvellyn wrote:
Hmm, looking at all of that it sounds like the script (I'm assuming Ahruman's example is Javascript) is going to be far and away the simplest, most adaptable, and most general way to go.
Ahh, someone has finally achieved enlightenment. ;-)
Post Reply