Page 1 of 3
Random equipment assignment
Posted: Wed Aug 15, 2007 12:48 pm
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?
Posted: Wed Aug 15, 2007 1:06 pm
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.
Posted: Wed Aug 15, 2007 1:34 pm
by Arexack_Heretic
Those chances are for NPC ships though.
A player-buyable ship is defined differently.
Posted: Wed Aug 15, 2007 7:02 pm
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!
Posted: Fri Aug 17, 2007 7:54 pm
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.
Posted: Sat Aug 18, 2007 2:35 am
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.
Posted: Sun Aug 19, 2007 4:36 pm
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)
Posted: Sun Aug 19, 2007 5:46 pm
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.
ArcElite ships
Posted: Mon Aug 20, 2007 6:06 pm
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).
Posted: Mon Aug 20, 2007 7:01 pm
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.
Posted: Mon Aug 20, 2007 7:15 pm
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!
Posted: Mon Aug 20, 2007 8:04 pm
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.
Posted: Mon Aug 20, 2007 9:14 pm
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.
Posted: Mon Aug 20, 2007 9:32 pm
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.
Posted: Mon Aug 20, 2007 10:36 pm
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. ;-)