Ship scanning ROM

A place to discuss mods in development and concepts for new mods.
Post Reply
relanat
Militia Captain
Militia Captain
Posts: 533
Joined: Tue Nov 05, 2013 9:56 am

Wed Mar 21, 2018 5:40 am

From Derakon's idea in this topic: https://forums.kronosaur.com/viewtopic.php?f=3&t=8525
Use a ROM to scan a ship and find out what it is equipped with.

I remember the Advanced Sensors mod as being really good (thanks for the link, sjf, I couldn't remember the mod name) and it still works. It uses 'objSendMessage' to show the weapon, shield and combat power of the ship that is currently targeted. See top left section of the attached image. But these messages do fade fairly quickly and can be shunted off the screen by other messages. And there is a limit of 4 lines.

The top right section of the image shows RPC's Speedometer mod from xelerus. It's a very clever mod. It uses a <StationType> to show the playership's speed.
Something like this could be used as the duration could be set but the text is fairly small. The station/device info text could be made to appear at a set point on the screen, say just above the playership, so the text shows without interfering with the HUDs and plyMessages. RPC's code can also make the text move with the playership rather than disappearing off the side of the screen.
The effect would need to be fairly limited anyway as this sort of thing can cause a lot of lag, so clutter won't be a problem.
I gave it a try and a very basic result can be seen in the bottom left of the image. The text is line-breaking at a certain width and I don't know how to format the text to stop this, if it's possible at all. This method shows the most promise. EDIT: the text appears to fit inside the width of the playership image so this may determine text width. If so another non-real station of wider width (transparent or something, not sure) could allow the text to be wider.

Using objSendMessage with the target ship as the source of the message works. See bottom right of image. But it seems there can be only one line of text. The messages don't stack 4 high like 'plyMessage's. Also the text can get mixed up and underneath stations if you are within visual range of the targeted ship, which looks messy. And there is no control of duration either. The example shown is ignoring "\n" as well unfortunately as I feel this would look much better if stacked.
I've attached a mod that uses this method, ROMSensorExample.xml (needs 1.8b1). 'U'se the Ship Scan ROM which has been added to the playership hold. It needs a ship to be targeted by the playership targeting ROM (also in the hold but not identified). The mod is based on FAD's Advanced Sensors mod.

Possibly a text-only overlay could be placed over a virtual station which stays directly above the playership. I suspect only one line of text could be shown at a time but 4 overlays placed correctly would allow a 'stack' of text. I don't know much about overlays though.

The ideal layout would seem to be something like:
Four lines of text stacked vertically above the playership but not covering it. Staying in the same spot relative to the playership as it moves is also desirable.This keeps the info out of the way of the HUDs and plyMessages.
The info could be ship name on line 1, then weapon name, shield name and armor name. More could be added, eg secondary weapon or max speed if the text size could be regulated to keep the whole display to a size which didn't overlap the HUDs or playership
Slightly larger text than the Speedo mod uses would be good but it doesn't need to be as large as the message text.
A slightly longer duration than used by standard messages would be good too.

Anyone got any other ideas or info on how to make it work?
ROMSensorExample.xml
(2.45 KiB) Downloaded 18 times
final image use.jpg
final image use.jpg (65 KiB) Viewed 515 times

User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 357
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Wed Mar 21, 2018 9:20 am

Maybe, we could use ship interior dockscreen for analyze the ship target rather than sending long messages to player.
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.37
Great corporate that feature a new items and challenges!
YourCORP v1.16
Build your very own corporation!
Trade Item Extension v1.15
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.6
New weapons that have very unique abilities!
Click this link!

User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 357
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Wed Mar 21, 2018 9:54 am

If you want to use objSendMessages, you should use addObjTimerEvent to delay messages. It may long code, but I think it should be works definitely.
You could make something like Smart Target Assistance.
Last edited by DigaRW on Wed Mar 21, 2018 1:30 pm, edited 1 time in total.
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.37
Great corporate that feature a new items and challenges!
YourCORP v1.16
Build your very own corporation!
Trade Item Extension v1.15
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.6
New weapons that have very unique abilities!
Click this link!

User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 357
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Wed Mar 21, 2018 1:26 pm

I has just made a device that analyze ship targets (Yeah!)
With OnUpdates events and data, it will send messages orderly. So every player targeting ship or station, it will describe armor, shield, and weapon without any problem.
Attachments
Untitled.jpg
Untitled.jpg (141.07 KiB) Viewed 499 times
Smart Target Assistance.xml
(2.83 KiB) Downloaded 16 times
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.37
Great corporate that feature a new items and challenges!
YourCORP v1.16
Build your very own corporation!
Trade Item Extension v1.15
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.6
New weapons that have very unique abilities!
Click this link!

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1467
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Thu Mar 22, 2018 12:34 am

Now you Knew you were going to wake the Dinosaur........However, I think you might have something there, Here are earlier pioneers into that area that you might find some trinkets to expand on or update.

"A revision of digdug's cool shield sensor mod."
http://xelerus.de/index.php?s=mod&id=78

"First example of code for a remote sensor."
http://xelerus.de/index.php?s=mod&id=43
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

relanat
Militia Captain
Militia Captain
Posts: 533
Joined: Tue Nov 05, 2013 9:56 am

Tue Mar 27, 2018 4:44 pm

The "Smart Target Assistance" is really good, DigaRW. You get enough time to read the info without it getting in the way. Nice.

I like your dockscreen idea as well. That would allow a lot more info to be shown.
If I can't get text to format how I like on the screen, I'll do a mod ROM that shows a dockscreen with class name, ship name, devices, speed and maybe a few more things (there is some really good new dockscreen stuff that I want to play around with as well).

And sjf, you are now officially the "Unofficial Xelerus Archivist", because you can always find the link while I'm sitting there thinking "Hmm, now what was the name of the mod that did that?".:lol:

The text width didn't vary in the speedometer based mod when 'plyChangeShip'ing to an Aquila. So there must be something else limiting it. Overlays now seem the easiest way to go.

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1467
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Wed Mar 28, 2018 6:38 am

relanat wrote:
Tue Mar 27, 2018 4:44 pm
The "Smart Target Assistance" is really good, DigaRW. You get enough time to read the info without it getting in the way. Nice.

I like your dockscreen idea as well. That would allow a lot more info to be shown.
If I can't get text to format how I like on the screen, I'll do a mod ROM that shows a dockscreen with class name, ship name, devices, speed and maybe a few more things (there is some really good new dockscreen stuff that I want to play around with as well).

And sjf, you are now officially the "Unofficial Xelerus Archivist", because you can always find the link while I'm sitting there thinking "Hmm, now what was the name of the mod that did that?".:lol:

The text width didn't vary in the speedometer based mod when 'plyChangeShip'ing to an Aquila. So there must be something else limiting it. Overlays now seem the easiest way to go.

Well, TY, TY, very much.. :)

I am a Huge Fan of the creativity of the community, it will not always fit into my game, but I love to at least keep up to speed on what is going on in their parts of the universe ( as much as I can, some things you guys do is way over my head ).
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

relanat
Militia Captain
Militia Captain
Posts: 533
Joined: Tue Nov 05, 2013 9:56 am

Mon Apr 09, 2018 4:38 am

Using overlays to show the device info shows real promise. The Nav Signs in SOTP use text inside of the effect code of an overlay.

Code: Select all

<OverlayType UNID="&ovNavSignText;"
            attributes=         "effect"
            >
	<Effect>
		<Text text="Nav Sign"
			font="SmallBold"
			primaryColor="0xc4, 0xdf, 0x9b"
			/>
	</Effect>
</OverlayType>
Using the LargeBold font gives a good text size and duration can be controlled by removing the overlays after a set time.

But I'm having trouble getting more than just text to display. Any method I've tried gives an error. Backslashes, 'cat'ing, Text ids in a Language block. Getting '= expected', 'must be quoted' and similar errors.
Having something like

Code: Select all

"Ship name: " (objGetName targetObj 0x100) \n
"Weapon: " (objGetWeapon (:lol:) targetObj) \n
"Shield : " etc, etc
"Armor: " etc,
as the text would work but how is it formatted?

If line breaking can't happen then 4 single-line overlays could be stacked but the variables still need to be inserted somehow.

Anyone know if this can happen and how to do it?
Attachments
ShipScanOverlayUse.JPG
ShipScanOverlayUse.JPG (45.49 KiB) Viewed 346 times

NMS
Militia Commander
Militia Commander
Posts: 437
Joined: Tue Mar 05, 2013 8:26 am

Wed May 30, 2018 11:47 pm

The ' \n ' s need to be in quotes. If you still get the '= expected' error, it means there's an XML element that isn't correctly formatted. Are you trying to put the code to generate the text inside an XML attribute? That's tricky to format, especially when strings are involved, and should usually be avoided. If you look at stCommonwealthNavSign, it uses this code to set the text:

Code: Select all

(objSetOverlayEffectProperty gSource theID 'text signText)

relanat
Militia Captain
Militia Captain
Posts: 533
Joined: Tue Nov 05, 2013 9:56 am

Mon Jun 04, 2018 2:34 am

Ah, I might be able to make that work. It certainly makes more sense than what I was trying. I was looking at the Nav Signs, among other overlays, but had tried so many things that nothing made sense anymore. Not that I understood overlays to begin with.

I was trying to put the text and code into the <Text> XML of &ovNavSignText;. Thats where the XML and other errors were coming from. Either there or in an <InitialData> block.

But I couldn't work out if I needed to set the effect. I was looking for objSetOverlayEffect or something. But I think it is the attribute inside the overlay type.

It really didn't help that just about every overlay I looked at was completely different.

So use a station, objSetData the text from translating a Text id, then use objSetOverlayEffectProperty to set the text into the overlay. Hopefully the overlay will accept the output from the Text id code and if it won't line-break, multiple overlays can be used.

Thanks. I'll give that a try whenever theTaipan mod isn't sucking up all my free time.

Post Reply