Archean

Archean

32 vurderinger
Color ore scanner
5
3
   
Pris
Føj til foretrukne
Gjort til foretrukken
Fjern som foretrukken
Blueprint: Machine, Computer
Filstørrelse:
Offentliggjort:
Opdateret:
3.079 MB
19. juni 2024 kl. 1:24
5. okt. 2024 kl. 2:53
22 ændringsbemærkninger ( vis )

Abonner for at downloade
Color ore scanner

Beskrivelse
Scan for three different ores at once using a three-color scheme.

UI button to select:
-Ores to scan for
-Scanning range
-Stop or start scanning to save power


There's a section at the top of the code to specify ores to scan for, scanning speed, range and detail.

You can also artificially boost the return value of ores, so that if there's a trace amount of an ore, it will still output in a strong color.

Connected devices and aliases
If you're attaching the computer in another build

Attach the following devices via data cable and name each using the V key.
Screen
Port 0: Dashboard with screen. You can adjust the port, alias or dashboard screen number using the @SetOreScreen function in main.xc or where $screenOre is declared in the main code.

Devices
"ore_scanner": The Ore scanner on top of the pivot "ore_pivot": A robotic pivot (make sure to turn off servo mode with V) "speed": Speed sensor (can be dropped if $allowRestMode is 0) "angle": Angular speed sensor (can be dropped if $allowRestMode is 0) "terrain_scanner": Terrain scanner (optional)

Optional terrain scanner
If you attach a terrain scanner on port 5, you can select "land" and "sea" on the green and blue channel to show the terrain on screen.

Power saving features
When the vehicle isn't moving, the scanner stops turning and scanning to save power. This can be disabled by setting $allowRestMode to 0.
If you don't select either land or sea, the terrain scanner doesn't draw any power.
If no ores are selected, the ore scanner doesn't draw any power.

CPU/Server performance
If you want to reduce load on a multiplayer server, don't use the terrain scanning features ("land" and "sea"). It uses more of the server CPU than the ore scanner does. You can remove the terrain scanner without breaking the machine.
If you disconnect the speed and angle sensors it puts the scanner in a permanent rest mode (it thinks your vehicle is stationary at all times), then when you need to scan, just press one of the Range buttons to do a single scan.


Values you might want to tweak
; REST MODE. Set this to 0 if there's no speed sensor and angular velocity senor attached const $allowRestMode = 1 ; STARTING ORE SELECTION, can be changed in the on-screen config menu ; After the first start, these values are stored and reloaded after rebooting or editing code var $ore1Default="Fe" ;Iron, Red channel var $ore2Default="Cu" ;Copper, Green channel var $ore3Default="Al" ;Aluminium, Blue channel var $resetStoredValue = 0 ; override to reset stored values, set to 1 to fix any bugged ore values ; BOOST ORE VISIBILITY const $oreboost1=0 ; normal display const $oreboost2=0.5 ; any amount of ore will be displayed as at least 50% const $oreboost3=0.1 ; any amount of ore will be displayed as at least 10% ; CUSTOMIZE SCAN RANGES ON BUTTONS const $shortRange = 250 const $mediumRange = 500 const $longRange = 1000 ; ADJUST SCANNER ROTATION SPEED const $rotSpeed = 0.1 ; Change button sizes const $ButtonHeight = 25 ; Use this to limit power usage and server impact, but decrease the line density on screen. ; Max allowed is scan steps is 100, lower resolution screens use fewer lines. const $maxScanSteps = 40

Troubleshooting
If you see circular stripes in the output near the center, reduce the $maxScanSteps value or check that the scanner is connected directly to a battery. If power is routed through a junction, the scanner may run out of power before all scan steps are done per tick, and will output bad data.

Re-use in other workshop items is OK
If you want to incorporate this into your own workshop items, please do. No need to ask for permission.
(If you build something cool, or improve upon it, feel free to tell me)

Source code
The code is based on batcholi and Drya'd BMD's blueprints, but with extra bells and whistles.

If you want to load the code into a computer without spawning the blueprint, you can find the code here:

https://github.com/archean-cookbook/snjo-color-ore-scanner
14 kommentarer
Phoenyx 24. aug. kl. 7:50 
Absolutely amazing
ArchieFoxer 29. apr. kl. 13:12 
Ah thanks, I either misunderstood the comments or didn't see it.
Snjo  [ophavsmand] 29. apr. kl. 8:40 
@paullie Screens can't pass through bridges and junctions, only direct connection.

@archiefoxer Yes, it will take any signal > 0 and boost it up to the value, a boos vale of 0.5 changes a source signal of 0.0002 to 0.5, or half total brightness. 0.5 is usually overkill though, because it's useful to separate very faint resources from medium queality resources. There's also a multiplier value in there to play with. The code comments should explain it.
ArchieFoxer 29. apr. kl. 2:15 
@Snjo:
Does this also make stuff in the 0-1% range visible?
Paullie 28. apr. kl. 14:01 
So i have dismantled it and rebuilt however i can only get the screen to work if it is plugged straight into port 0, i wanted to run it through a data bridge so i could tidy up the wiring a bit. any ideas?
Snjo  [ophavsmand] 28. apr. kl. 9:52 
@archiefox Yes, you can use the oreboost variables. Check the description above. It requires you to edit the main code file, not via the UI. Set the boost value to any number between 0 and 1.
ArchieFoxer 26. apr. kl. 13:54 
Can I somehow make the scanner more sensitive to scan for low density pockets of very rare stuff like flouride?
Snjo  [ophavsmand] 5. okt. 2024 kl. 3:18 
Updated after a game update to fix broken code. If you have integrated this into your own build, you can spawn this updated version separately and swap the disk into your build, or make the following changes manually:

file: ColorOreScanner.xc
line 325: remove ) at the end
line 382: add ) at the end
Ahdidaas 4. sep. 2024 kl. 17:50 
ty, it looks sweet!
Snjo  [ophavsmand] 18. juli 2024 kl. 13:11 
@tycho_leksten, go right ahead!