Random Hits OXP

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

Moderators: winston, another_commander

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

This is probably already known and fixed, and it is probably caused by the current bug in Oolite's system populator that sometimes adds ships with wrong roles, but I thought I'd better let you know:

I am testing out Random Hits for the first time for a couple of days now, and I noticed an extremely annoying issue. My pilot is currently in the Esmain system in Galaxy 5. It's an Anarchy and has a Random Hits bar (the "Blue Parrot"), and it is one of the destination systems for random hits in Galaxy 5. So I can visit the bar and scroll through the contracts until one pops up which is located right in front of the door, so to speak. So I go and kill the mark, return to the bar and immediatly get the next contract, also in-system, of course.

What I have noticed, however, is that when I repeat this a couple of times, the system gets increasingly populated with random hits ships with scanClass CLASS_NO_DRAW. They do not show up on the scanner, however they do attack me. Quite annoying. And as I don't see any ship in the shipdata with a has_military_jammer-key, this seems like a bug to me.

I am running Random Hits V1.2 on Oolite 1.71.2, still without the patch, which I downloaded just now.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Commander McLane wrote:
What I have noticed, however, is that when I repeat this a couple of times, the system gets increasingly populated with random hits ships with scanClass CLASS_NO_DRAW.
Ships with scanClass CLASS_NO_DRAW are formed when the AI launches a ship by role. By itself this does not lead to "invisible" ships. There are a lot more oxp's that launch such ships without this "invisible" problem.
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

Eric Walch wrote:
Ships with scanClass CLASS_NO_DRAW are formed when the AI launches a ship by role. By itself this does not lead to "invisible" ships.
Don't understand. CLASS_NO_DRAW means that the ship doesn't appear on the scanner. (It's exactly what it says on the tin, isn't it?) So how could it not lead to the ship not appearing on the scanner?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Invisible on the scanner vs invisible "in flight" (as in you can't see them at all) perhaps?
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

Thargoid wrote:
Invisible on the scanner vs invisible "in flight" (as in you can't see them at all) perhaps?
Probably. However, I was never referring to invisibility in-flight. I am concerned about scanClass CLASS_NO_DRAW (which is by definition equal to "invisible on the scanner, but very visible in my front view").

And I am concerned about it, because I was flying in a system with 30 or 40(!) ships with scanClass CLASS_NO_DRAW, but no apparent reason why even a single of them should legally have another scanClass than CLASS_NEUTRAL. (The only thing that usually has scanClass CLASS_NO_DRAW is the SkyEntity, which makes sense. Where would you place it on the scanner?)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Commander McLane wrote:
Eric Walch wrote:
Ships with scanClass CLASS_NO_DRAW are formed when the AI launches a ship by role. By itself this does not lead to "invisible" ships.
Don't understand. CLASS_NO_DRAW means that the ship doesn't appear on the scanner. (It's exactly what it says on the tin, isn't it?) So how could it not lead to the ship not appearing on the scanner?
You are right. I was mixed up with "CLASS_NOT_SET". That is the scanclass that ships have when launched by an AI command to launch by role. It should be CLASS_NEUTRAL. With "CLASS_NOT_SET" you can shoot them as clean ships in sight of the police without repercussions.

As you say, CLASS_NO_DRAW does mean it is realy not visible on the scanner. Until oolite 1.69 you could define that scanclass in shipdata and the ship was invisible. Since 1.70 this scanclass is ignored is shipdata.
In the code I only see this scanclass set for things like particles and sparks. It would be interesting to see what their primaryRole is. That could give a clue to what went wrong. Maybe ships that were chosen in the role as particle?
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

Here's a couple of them. They appeared in the entity dump as soon as I accepted a hit and launched:

Code: Select all

  [universe.objectDump]: -> Ent:57		<ShipEntity 0x1dcac00>{"Mamba (Hired Thug)" ID: 385 position: (828.561, 114.189, 915.592) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0xdbbaaa0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 385}
  [universe.objectDump]: -> Ent:58		<ShipEntity 0x16437a00>{"Mamba (Hired Thug)" ID: 396 position: (681.672, -440.821, 893.294) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x15595330>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 396}
  [universe.objectDump]: -> Ent:59		<ShipEntity 0x16112600>{"Mamba (Hired Thug)" ID: 388 position: (-557.382, 456.471, 697.599) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0xdbbb430>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 388}
  [universe.objectDump]: -> Ent:60		<ShipEntity 0x1e01800>{"Mamba (Hired Thug)" ID: 395 position: (-242.496, -677.888, 702.592) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0xddf5180>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 395}
  [universe.objectDump]: -> Ent:61		<ShipEntity 0x1640a800>{"Mamba (Hired Thug)" ID: 384 position: (-563.631, -1210.24, 694.158) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0xdbd7030>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 384}
  [universe.objectDump]: -> Ent:62		<ShipEntity 0x1643e400>{"Mamba (Hired Thug)" ID: 397 position: (-206.99, 501.111, 624.606) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x10858030>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 397}
  [universe.objectDump]: -> Ent:63		<ShipEntity 0x160fd200>{"Mamba (Hired Thug)" ID: 387 position: (1172.56, 610.358, 515.635) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x108be120>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 387}
  [universe.objectDump]: -> Ent:64		<ShipEntity 0x1f63800>{"Mamba (Hired Thug)" ID: 386 position: (-835.251, 155.742, -187.19) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x1089bea0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 386}
  [universe.objectDump]: -> Ent:65		<ShipEntity 0x1dfae00>{"Mamba (Hired Thug)" ID: 394 position: (1153.45, -202.717, -411.933) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x155550d0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 394}
  [universe.objectDump]: -> Ent:66		<ShipEntity 0x16178000>{"Mamba (Hired Thug)" ID: 393 position: (-1264.38, -471.457, -475.645) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x15592d00>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 393}
About the same number will be added for each consecutive hit I'm accepting.

And it would really be interesting to know their primary role. Only problem is: How to find out? They can't be targetted, I believe.

Perhaps I should have a look into the Random Hits script, to find out more about them...
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

McLane wrote:
And it would really be interesting to know their primary role. Only problem is: How to find out? They can't be targetted, I believe.


I know that problem. You have to get it on the difficult way, over the console. Once you see them, type:

Code: Select all

this.result = system.entitiesWithScanClass("CLASS_NO_DRAW")
then the closest ship is in this.result[0]. For its primary role you type

Code: Select all

this.result[0].primaryRole
or for its complete roleset

Code: Select all

this.result[0].roles
You can also get the information of the second etc, but that will of course give a similar answer.

When you do a lot of testing for a specific thing with the console you can also define a macro:

Code: Select all

:setM hidden this.result = system.entitiesWithScanClass("CLASS_NO_DRAW")
Now this string is stored as macro with the name hidden and even will be available on the next startup. Whenever you need that code, you now just type:

Code: Select all

:hidden
and it will retype your earlier command and you have your ships in the array: this.result

This invisible ships around the spacebar was mentioned earlier, but I don't think it is a random hits bug, as that it should be there more frequent.
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 »

Cheers for the Bug Report McC!

None of the Random Hits ships have their Class set to NO_DRAW in shipdata. I haven't specified a class though. For the Guy's in Classic elite ships I've just liked_shiped to the native entry, given them customAIs, roles assinged them as the escort ships of the Marks and better than normal chances of having equipment fitted. Inspired by the work Svengali put in to optimise the script, I am working on a V1.3 ATM. Added :- Names displayed on the ID Computer, ability to switch to the F6 Screen whilst viewing the BB, victims relatives may occasionally take revenge later on and a big overhall of the AIs and Java Scripts. I'll specifically set the scan class to neutral in the shipdata entries, but my feeling is this is a manifistation of the ship in wrong role bug in Oolite rarther than a bug in the OXP itself.

I set the hunter ships specifically to SCAN_CLASS NETRUAL (as these are launched by launchShipWithRole: and I'd found they had no legal status if I didn't - although you could see them on the scanner). But the Escorts are just added as standard escorts. As its a quick C&P I'll add it to them as well. I know loads of people have hit the wrong role bug, but its not one I've yet hit on my system.

Hit in the same system is a feature really rather than a bug. I knew it could happen, but seemed in keeping with the Random nature of the OXP. :wink: I guess its a bit of a cheat to keep accepting it, but as the seed number remains constant within a system until you make a jump, unless you make a jump the hits remain constant.

All the OXP ships have unique roles (and only this custom role) like "random_hits_patrol_cobra3" (for a hunter cobra 3), "random_hits_mark_cobra3" (for a victim cobra 3) and "random_hits_escort_cobra3" for a victim's escort. They shouldn't pop up therefore except when called as escorts by the victim ship (although they obviously are!).
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
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

LittleBear wrote:
I set the hunter ships specifically to SCAN_CLASS NETRUAL
Where be that, since i can´t find the script setting it anywhere.. Or do you refer to the fact that ships without a scanclass set is always scanclass "CLASS_NEUTRAL" ?

For example if you try to spawn a genuine rock hermit,... it will show up yellow on the scanner, since it is "CLASS_NEUTRAL".. because its scanclass is not set in the shipdata.plist file.. where as Oolite automatically sets it to scanclass "CLASS_ROCK", when it is Oolite spawning the rock hermit..

I admit i have not checked that the hunters scanclass is indeed "CLASS_NEUTRAL" in game, but i would guess so, since they show up yellow, that i do remember...

I just don't see where it is "specifically" set..., and have done a in file search, in all files in random hits v 1.2

however, i´m running under Oolite 1.71.2, and so far i have not seen any errors generated by it...
Bounty Scanner
Number 935
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 »

Sorry, I mean the special hunters added by the OXP (they act as the defence ships of the bar, but are also launched with launchShipWithRole if the bar's AI spots criminals / pirates / thargoids nearby). I include in the shipdata the scan_class neutral. IE:-

Code: Select all

<key>random_hits_patrol_cobra3-alternate</key>
<dict>
<key>script</key>
<string>oolite-random-hits-hunter2.js</string>
<key>like_ship</key>
<string>cobra3-alternate</string>
<key>name</key>
<string>Scanning Target...</string>
<key>roles</key>
<string>random_hits_patrol</string>
<key>ai_type</key>
<string>randomhitspatrolAI.plist</string>
<key>bounty</key>
<string>0</string>
<key>scanner_range</key>
<real>25000</real>
<key>forward_weapon_type</key>
<string>WEAPON_MILITARY_LASER</string>
<key>aft_weapon_type</key>
<string>WEAPON_BEAM_LASER</string>
<key>has_shield_booster</key>
<real>0.85</real>
<key>has_shield_enhancer</key>
<real>0.75</real>
<key>has_escape_pod</key>
<real>0.0</real>
<key>has_fuel_injection</key>
<real>0.75</real>
<key>fuel</key>
<integer>5</integer>
<key>has_ecm</key>
<real>0.99</real>
<key>has_scoop</key>
<real>1.0</real>
<key>missiles</key>
<integer>4</integer>
<key>unpiloted</key>
<false/>
<key>scanClass</key>
<string>CLASS_NEUTRAL</string>
</dict>
As you say, it shouldn't be necessary to do this as without a scanClass specified it should default to NEUTRAL. It does indeed do this if a omit it and the ship appears yellow on the scanner. The ships only every appear in game if a Space Bar launched them. Because they are always added with launchShipWithRole if I don't specify a scanClass then when the ship is launched although it appears yellow it has no legal status. Oolite does not regard shooting it as a crime and although it has a bounty of zero "(Clean)" does not appear in brackets after its name on the ID computer. Giving it scanClass NEURAL in shipdata fixes this and then it does have a legal status when launched from the bar.
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
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

As you can see from the positions of the CLASS_NO_DRAW-ship in my entity dump, they seem to be fairly evenly spread across the system, and are by no means related to the space bar. Specifically they are not launched from the bar. They simply are in the entity-dump when I launch from the bar after accepting a hit.

I also seem to remember that I met one or two of them when I first jumped into the system after accepting a hit somewhere else. This seems to indicate that they are created whenever you (i) have an active hit-mission and (ii) are in a system with a space bar.

While I will go and try to get more information about them according to Eric's hint, I would be extremely interested to know whether other players can recreate the bug on their systems, and under what circumstances. For a start I would recommend to accept a hit in any space bar, leave the system, jump back, and make an entity-dump (hit P for pause and then 0 (zero); the list of entities in your current system is written to your log-file). If my assumption in the above paragraph is correct, you should have about ten ships with CLASS_NO_DRAW somewhere in the system.
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

Wow! This time I am having all of these:

Code: Select all

  [universe.objectDump]: -> Ent:90		<ShipEntity 0x19c7ec00>{"Mosquito Sport (Hired Laser)" ID: 295 position: (-34994.5, 14426.9, 28380.7) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 138862.28 <AI 0x114772a0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mosquito Sport (Hired Laser) 295}
  [universe.objectDump]: -> Ent:91		<ShipEntity 0x19c6b400>{"Mosquito Sport (Hired Laser)" ID: 292 position: (-25074.7, -4917.83, 25408.9) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 138862.28 <AI 0xe9305f0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mosquito Sport (Hired Laser) 292}
  [universe.objectDump]: -> Ent:92		<ShipEntity 0x19cfce00>{"Cobra Courier (Hired Ruffian)" ID: 306 position: (-4252.36, -1620.95, 15170.4) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 201889.69 <AI 0x11458530>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Cobra Courier (Hired Ruffian) 306}
  [universe.objectDump]: -> Ent:93		<ShipEntity 0x19c71c00>{"Mosquito Sport (Hired Laser)" ID: 293 position: (-28075.1, 4435.9, 13269.7) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 138862.28 <AI 0x1145e600>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mosquito Sport (Hired Laser) 293}
  [universe.objectDump]: -> Ent:94		<ShipEntity 0x19a99c00>{"Witchpoint Beacon" ID: 218 position: (-3100, -700, 9100) scanClass: CLASS_BUOY status: STATUS_IN_FLIGHT} mass 383595.94 <AI 0x12116fd0>{"buoyAI.plist" in state: "GLOBAL" for Witchpoint Beacon 218}
  [universe.objectDump]: -> Ent:95		<ShipEntity 0x19d1fe00>{"Adder Mk II (Hired Help)" ID: 329 position: (2322.06, -556.633, 8896.05) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x2403c7a0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 329}
  [universe.objectDump]: -> Ent:96		<ShipEntity 0x19d23400>{"Adder Mk II (Hired Help)" ID: 330 position: (4188.43, -282.436, 7862.03) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x114600f0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 330}
  [universe.objectDump]: -> Ent:97		<ShipEntity 0x1993f600>{"Adder Mk II (Hired Help)" ID: 331 position: (-2621.35, -5734.19, 7323.5) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0xe91e710>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 331}
  [universe.objectDump]: -> Ent:98		<ShipEntity 0x19d15200>{"Adder Mk II (Hired Help)" ID: 328 position: (4242.37, -4996.07, 7420.23) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0xe9164c0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 328}
  [universe.objectDump]: -> Ent:99		<ShipEntity 0x19c64c00>{"Mosquito Sport (Hired Laser)" ID: 291 position: (582.97, -3209.11, 6132.24) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 138862.28 <AI 0x1148d8a0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mosquito Sport (Hired Laser) 291}
  [universe.objectDump]: -> Ent:100		<ShipEntity 0x19c44200>{"Mamba (Hired Thug)" ID: 285 position: (358.428, 3656.63, 5461.76) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x1148da30>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 285}
  [universe.objectDump]: -> Ent:101		<ShipEntity 0x19bdc200>{"Mamba (Hired Thug)" ID: 286 position: (-1166.08, -1319.77, 5280.41) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0xe90f4c0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 286}
  [universe.objectDump]: -> Ent:102		<ShipEntity 0x19d4aa00>{"Adder Mk II (Hired Help)" ID: 321 position: (-3477.5, 7899.47, 4733.7) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x1147ba80>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 321}
  [universe.objectDump]: -> Ent:103		<ShipEntity 0x19c85400>{"Mosquito Sport (Hired Laser)" ID: 296 position: (3016.66, -214.223, 3620.55) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 138862.28 <AI 0x1147a400>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mosquito Sport (Hired Laser) 296}
  [universe.objectDump]: -> Ent:104		<ShipEntity 0x19cf1200>{"Cobra Courier (Hired Ruffian)" ID: 304 position: (-2271.01, -1436.7, 3506.1) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 201889.69 <AI 0x1145e790>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Cobra Courier (Hired Ruffian) 304}
  [universe.objectDump]: -> Ent:105		<ShipEntity 0x19d11c00>{"Adder Mk II (Hired Help)" ID: 327 position: (1539.42, -4989.52, 3599.9) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0xe7f5450>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 327}
  [universe.objectDump]: -> Ent:106		<ShipEntity 0x19cdfe00>{"Sidewinder (Bodyguard)" ID: 301 position: (-792.92, -4880.05, 3479.53) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0xe90ac50>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 301}
  [universe.objectDump]: -> Ent:107		<ShipEntity 0x19d51600>{"Adder Mk II (Hired Help)" ID: 323 position: (551.741, 9191.67, 3123.52) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x11411500>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 323}
  [universe.objectDump]: -> Ent:108		<ShipEntity 0x19c34800>{"Mamba (Hired Thug)" ID: 283 position: (682.652, -2265.84, 3179.56) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0xe900c30>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 283}
  [universe.objectDump]: -> Ent:109		<ShipEntity 0x19c78400>{"Mosquito Sport (Hired Laser)" ID: 294 position: (598.331, -6507.71, 3296.92) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 138862.28 <AI 0x1143d2a0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mosquito Sport (Hired Laser) 294}
  [universe.objectDump]: -> Ent:110		<ShipEntity 0x19d30400>{"Sidewinder (Bodyguard)" ID: 311 position: (1227.43, 46.3026, 2809.01) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0xe90b910>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 311}
  [universe.objectDump]: -> Ent:111		<ShipEntity 0x19ceb400>{"Cobra Courier (Hired Ruffian)" ID: 303 position: (-1608.57, -2265.23, 2632.6) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 201889.69 <AI 0x11426d60>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Cobra Courier (Hired Ruffian) 303}
  [universe.objectDump]: -> Ent:112		<ShipEntity 0x19d05200>{"Cobra Courier (Hired Ruffian)" ID: 307 position: (-1732.68, -2552.52, 2550.38) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 201889.69 <AI 0x11457290>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Cobra Courier (Hired Ruffian) 307}
  [universe.objectDump]: -> Ent:113		<ShipEntity 0x19cd9200>{"Sidewinder (Bodyguard)" ID: 300 position: (1393.68, 5009.26, 2376.03) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x11488770>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 300}
  [universe.objectDump]: -> Ent:114		<ShipEntity 0x19ccba00>{"Sidewinder (Bodyguard)" ID: 298 position: (-3393.5, -1122.91, 2378.94) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0xe9319d0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 298}
  [universe.objectDump]: -> Ent:115		<ShipEntity 0x19cf7000>{"Cobra Courier (Hired Ruffian)" ID: 305 position: (2009.56, -3621.82, 2068.28) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 201889.69 <AI 0x11471060>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Cobra Courier (Hired Ruffian) 305}
  [universe.objectDump]: -> Ent:116		<ShipEntity 0x19d7c800>{"Sidewinder (Bodyguard)" ID: 309 position: (451.078, -3010.71, 1960.1) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x114397a0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 309}
  [universe.objectDump]: -> Ent:117		<ShipEntity 0x19c3b200>{"Mamba (Hired Thug)" ID: 284 position: (-18.6069, -1958.55, 304.473) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x11486520>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 284}
  [universe.objectDump]: -> Ent:118		<ShipEntity 0x19cd2600>{"Sidewinder (Bodyguard)" ID: 299 position: (120.689, 3659.02, 73.9884) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x12114c80>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 299}
  [universe.objectDump]: -> Ent:119		<ShipEntity 0x19d83400>{"Sidewinder (Bodyguard)" ID: 310 position: (89.2039, -73.4824, 79.4218) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x121140b0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 310}
  [universe.objectDump]: -> Ent:120		<ShipEntity 0x19c2de00>{"Mamba (Hired Thug)" ID: 282 position: (-2831.21, -5492.24, -307.583) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 26715.86 <AI 0x11463550>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Mamba (Hired Thug) 282}
  [universe.objectDump]: -> Ent:121		<ShipEntity 0x19d47400>{"Adder Mk II (Hired Help)" ID: 320 position: (2504.23, -3603.17, -315.503) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x1145b520>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 320}
  [universe.objectDump]: -> Ent:122		<ShipEntity 0x19d43e00>{"Adder Mk II (Hired Help)" ID: 319 position: (7867.42, 251.057, -1605.27) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x1147b330>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 319}
  [universe.objectDump]: -> Ent:123		<ShipEntity 0x19d37000>{"Sidewinder (Bodyguard)" ID: 312 position: (-2631.32, -1266.66, -2037.86) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 25355.94 <AI 0x11476060>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Sidewinder (Bodyguard) 312}
  [universe.objectDump]: -> Ent:124		<ShipEntity 0x19d4e000>{"Adder Mk II (Hired Help)" ID: 322 position: (-7204.69, -3288.28, -5358.7) scanClass: CLASS_NO_DRAW status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x114759c0>{"randomhitswormAI.plist" in state: "ATTACK_SHIP" for Adder Mk II (Hired Help) 322}
That's how many? 35? The system is really flooded!

Okay, performed the search as indicated by Eric. The roleset for a randomly selected ship is:

Code: Select all

> this.result[0].roles
escort,random_hits_escort28
So they obviously are random hits escorts (also their names like "Hired Thug" suggest this). The next interesting thing is that they all are in AI-state ATTACK_SHIP. Whom are they targetting?

Code: Select all

> this.result[0].target
null
They are targetting nothing, however they are in attack-mode. According to my experience they will attack me as soon as I get within their reach.

The next very interesting thing is that, while they are spawned with primary role "escort" (and secondary role "random_hits_escortnn"), and all of them have a groupID (I found a couple of different groupIDs: 281, 290, 326), which also suggests that they are escorts, they do not have a proper AI for that. It is neither randomhitsescortnnAI.plist, as defined in their shipdata, nor the default escortAI.plist, as you would expect for generic escorts. Instead they have the rather odd randomhitswormAI.plist.

So something definitely doesn't fit together.

By the way: In this current entity dump I had some correct random hits escorts as well. I guess my mark is guarded this time. They are looking just fine (as they are just spawned they are still looking for their boss, but they are reasonably close-by):

Code: Select all

  [universe.objectDump]: -> Ent:82		<ShipEntity 0x19d65e00>{"Wolf Mk II (Marked for Death)" ID: 344 position: (18614.8, -20064.9, 81101.1) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 228677.56 <AI 0x11480fa0>{"randomhitsmark3aAI.plist" in state: "GO_TO_WITCHPOINT" for Wolf Mk II (Marked for Death) 344}
...
  [universe.objectDump]: -> Ent:84		<ShipEntity 0x19c0f200>{"Adder Mk II (Hired Help)" ID: 349 position: (18103.5, -20009.6, 80692.5) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0xe9340e0>{"randomhitsescort26AI.plist" in state: "FIND_MOTHER" for Adder Mk II (Hired Help) 349}
  [universe.objectDump]: -> Ent:85		<ShipEntity 0x19d6d200>{"Adder Mk II (Hired Help)" ID: 348 position: (19025, -20086.8, 80783) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x11431110>{"randomhitsescort26AI.plist" in state: "FIND_MOTHER" for Adder Mk II (Hired Help) 348}
  [universe.objectDump]: -> Ent:86		<ShipEntity 0x19cb4600>{"Adder Mk II (Hired Help)" ID: 345 position: (17697, -20015.7, 80452.1) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x1216c500>{"randomhitsescort26AI.plist" in state: "FIND_MOTHER" for Adder Mk II (Hired Help) 345}
  [universe.objectDump]: -> Ent:87		<ShipEntity 0x19cbb200>{"Adder Mk II (Hired Help)" ID: 347 position: (17864.1, -20125.1, 80185.3) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x11473f50>{"randomhitsescort26AI.plist" in state: "FIND_MOTHER" for Adder Mk II (Hired Help) 347}
  [universe.objectDump]: -> Ent:88		<ShipEntity 0x19cb7c00>{"Adder Mk II (Hired Help)" ID: 346 position: (19345.9, -20093.8, 80214.6) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT} mass 18477.52 <AI 0x114ced00>{"randomhitsescort26AI.plist" in state: "FIND_MOTHER" for Adder Mk II (Hired Help) 346}
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Is this a manifestation of the auto_AI feature? Might the trunk code be neing to clever swapping their AI over from LB's specific one to the generic escortAI?
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 »

I should explain what I've done with the escorts!

Each has a JavaScript attached like this:-

Code: Select all

this.shipSpawned = function ()
{
	if(this.ship.shipDisplayName == this.ship.shipDescription)
        this.ship.shipDisplayName = expandDescription("[random_hits_guard_name]") // Show the Guard's name on the ID Computer when targeted.
	  this.ship.switchAI("randomhitsescort1AI.plist")
	  delete this.shipSpawned;
}
So they don't use standard escort AI. They use a custom one like this:-

Code: Select all

{
    "ESCORT_ANOUNCEMENT" = {
        ENTER = (performTumble, "scanForNearestShipWithRole: random_hits_mark_anaconda"); 
        EXIT = ();
        "TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: FOLLOW_MOTHER"); 
        UPDATE = ("scanForNearestShipWithRole: random_hits_mark_anaconda", "pauseAI: 1.0"); 
    }; 
    "FIND_MOTHER" = {
        ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
        ENTER = (performTumble, "scanForNearestShipWithRole: random_hits_mark_anaconda"); 
        EXIT = ();
        "TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: FOLLOW_MOTHER"); 
        "NOTHING_FOUND" = ("switchAITo: randomhitswormAI.plist"); 
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP"); 
        UPDATE = ("scanForNearestShipWithRole: random_hits_mark_anaconda", "pauseAI: 1.0"); 
    }; 
    "FOLLOW_MOTHER" = {
        ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
        ENTER = ("setDesiredRangeTo: 500", setDestinationToTarget, checkCourseToDestination); 
        EXIT = ();
	"COURSE_OK" = ("setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
        "TARGET_LOST" = ("setStateTo: FIND_MOTHER"); 
        "TARGET_DESTROYED" = ("setStateTo: FIND_MOTHER"); 
        "NOTHING_FOUND" = ("setStateTo: FIND_PLAYER");
        "TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 		
        "DESIRED_RANGE_ACHIEVED" = ("setStateTo: FIND_PLAYER"); 
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP"); 
        UPDATE = ("scanForNearestShipWithRole: player", "pauseAI: 1.0"); 
    }; 
    "FIND_PLAYER" = {
        ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
        ENTER = ("scanForNearestShipWithRole: player", "pauseAI: 1.0"); 
        EXIT = ();
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP"); 
        "TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); 
        "NOTHING_FOUND" = ("setStateTo: FIND_MOTHER"); 
        UPDATE = ("pauseAI: 1.0", "scanForNearestShipWithRole: player");
    }; 
    
  "ATTACK_SHIP" = {
        "ENERGY_LOW" = (performAttack); 
        ENTER = (switchLightsOn, performAttack); 
        EXIT = (); 
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor); 
        "TARGET_DESTROYED" = ("setStateTo: FIND_MOTHER"); 
        "TARGET_LOST" = ("setStateTo: FIND_MOTHER");  
        UPDATE = (); 
    };
 
GLOBAL = 
	{ENTER = ("setStateTo: ESCORT_ANOUNCEMENT"); EXIT = (); UPDATE = (); 
    };
}
Normal Escorts will go to route1patrolAI if they lose their Mother. These ones will go to the randomhitswormAI in the event that they are seperated from Mum (can happen if Mum decides to flee on injectors and they happen not to have an injector so can't keep up). randomhitswormAI is a custom AI they flies about the spacelanes looking for the player and attacking if he finds him. So that much is intended behaviour!

What I'm completely stumped by is why Oolite is spawing loads of them in system! :shock:

They are not added by script. The Script adds they Mark ship like this:-

Code: Select all

<dict>
							<key>conditions</key>
							<array>
								<string>mission_random_hits_store_mark_ship equal Boy Racer</string>
							</array>
							<key>do</key>
							<array>
								<string>checkForShips: random_hits_mark_boyracer</string>
								<dict>
									<key>conditions</key>
									<array>
										<string>shipsFound_number equal 0</string>
									</array>
									<key>do</key>
									<array>
										<string>addSystemShips: random_hits_mark_boyracer 1 0.[mission_random_hits_markposition]</string>
										<string>reset: mission_random_hits_addmark</string>
										<string>reset: mission_random_hits_whoscooped</string>
										<string>reset: mission_random_hits_whoshot</string>
									</array>
								</dict>
							</array>
						</dict>
This Script is only run if the ADDMARK variable is true. The escorts are called by the Mark's Ship like this:-

Code: Select all

<key>random_hits_mark_python</key>
<dict>
<key>script</key>
<string>oolite-random-hits-mark16.js</string>
<key>escorts</key>
<integer>5</integer>
<key>escort-ship</key>
<string>random_hits_markguard2</string>
<key>like_ship</key>
<string>python-blackdog</string>
<key>missile_launch_position</key>
<string>0.0 15.5 -50.0</string>
<key>forward_weapon_type</key>
<string>WEAPON_MILITARY_LASER</string>
<key>aft_weapon_type</key>
<string>WEAPON_BEAM_LASER</string>
<key>name</key>
<string>Scanning Target...</string>
<key>bounty</key>
<integer>32</integer>
<key>roles</key>
<string>random_hits_mark_python</string>
<key>ai_type</key>
<string>randomhitsmark2AI.plist</string>
<key>has_energy_bomb</key>
<real>0.45</real>
<key>has_shield_booster</key>
<real>0.65</real>
<key>has_shield_enhancer</key>
<real>0.52</real>
<key>has_escape_pod</key>
<real>0.0</real>
<key>has_fuel_injection</key>
<real>0.58</real>
<key>fuel</key>
<integer>20</integer>
<key>has_ecm</key>
<real>0.97</real>
<key>has_scoop</key>
<real>0.89</real>
<key>missiles</key>
<integer>4</integer>
<key>missile_role</key>
<string>random_hits_attackworm</string>
<key>scanClass</key>
<string>CLASS_NEUTRAL</string>
</dict>
The escort is defined like this:-

Code: Select all

<key>random_hits_markguard2</key>
<dict>
<key>like_ship</key>
<string>gecko</string>
<key>has_escape_pod</key>
<real>0.0</real>
<key>script</key>
<string>oolite-random-hits-guard2.js</string>
<key>roles</key>
<string>random_hits_markguard2</string>
<key>ai_type</key>
<string>randomhitsescort2AI.plist</string>
<key>bounty</key>
<string>7</string>
<key>name</key>
<string>Scanning Target...</string>
<key>forward_weapon_type</key>
<string>WEAPON_BEAM_LASER</string>
<key>aft_weapon_type</key>
<string>WEAPON_PULSE_LASER</string>
<key>scanClass</key>
<string>CLASS_NEUTRAL</string>
</dict>
In the version on my machine I've changed the name to guard rather than escort in case this was causing some oddity. I've posted a link to the bleeding edge version of random hits on my machine, so people can test using the same code I'm working on. Please Note for testing the chance of later being attacked by victims relatives following a hit is currently set to 100%. I've not included the models and textures to save download time. Just copy this OXP in over randomhits.

Really stumped by this as I can't reproduce it and can't see why Oolite should be adding loads of these escorts without their mother!

Link to WIP RandomHits V1.3 (Just the Code no models and textures):-

http://www.box.net/shared/esaf3ygrpq
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.
Post Reply