Change scanning level of ship

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

thomasbkdk
Posts: 180
Joined: Wed, 8. Jan 20, 07:34
x4

Change scanning level of ship

Post by thomasbkdk »

I have scanning of a station working with

<set_object_scanned object="player.target"/>

But this does not seem to work when a ship is targeted.

Can anyone tell me how to code that a ship has been scanned so that its order, crew etc. is visible to the player?
Last edited by thomasbkdk on Thu, 20. Feb 25, 13:17, edited 1 time in total.
AMD 3700X|GSKILL 2x32GB 3600C17|MSI X570 UNIFY|MSI RX 6800|SAMSUNG NVME 990 PRO|RAZER TARTARUS PRO|AOC AGON AG273QX 2560x1440@165|STREAM DECK XL+PEDAL|CORSAIR K95 PLATINUM RGB
thomasbkdk
Posts: 180
Joined: Wed, 8. Jan 20, 07:34
x4

Re: Scanning of ship

Post by thomasbkdk »

So i tried a few things like

<set_value name="player.target.scannedlevel" exact="2"/>
<set_value name="player.target.revealedpercentage" exact="95"/>

and set_value object=..... instead.

But no luck getting it to work :-(

Any advice please
AMD 3700X|GSKILL 2x32GB 3600C17|MSI X570 UNIFY|MSI RX 6800|SAMSUNG NVME 990 PRO|RAZER TARTARUS PRO|AOC AGON AG273QX 2560x1440@165|STREAM DECK XL+PEDAL|CORSAIR K95 PLATINUM RGB
Realspace
Posts: 1637
Joined: Wed, 15. Nov 06, 10:21
x4

Re: Scanning of ship

Post by Realspace »

Have you tried to write this before?
<set_known object="$ship" known="true"/> or "player.target" instead, if $ship has not been not previously defined
thomasbkdk
Posts: 180
Joined: Wed, 8. Jan 20, 07:34
x4

Re: Scanning of ship

Post by thomasbkdk »

I’ll try that first chance i get. Thank you.
AMD 3700X|GSKILL 2x32GB 3600C17|MSI X570 UNIFY|MSI RX 6800|SAMSUNG NVME 990 PRO|RAZER TARTARUS PRO|AOC AGON AG273QX 2560x1440@165|STREAM DECK XL+PEDAL|CORSAIR K95 PLATINUM RGB
thomasbkdk
Posts: 180
Joined: Wed, 8. Jan 20, 07:34
x4

Re: Scanning of ship

Post by thomasbkdk »

I have looked over a savegame from before and after testing the code.
And in both saves the ships and the lasertower i have tested on has the knownto="player" assigned.
Also it would not make sense to me that i'm actually able to target something which is not known.
So i don't think this is it.

Just for the sake of anyone reading this.
I have a help info box telling me info on the player.target in the same code that works fine.
So i'm rather sure that the code for scanning is actually being run.

Something i find a little 'strange'.
I'm assuming from the save game that the level="0.742684" is the value for revealedpercentage.
But if that is correct, it's strange to me that that seems like a decimal value, but in the coding documentation that attribute should be an integer.
So i'm unsure this is actually related and where in the savegame file it is actually stored and to what extent a ship is scanned.

So i'm stilling looking for help on this matter.
AMD 3700X|GSKILL 2x32GB 3600C17|MSI X570 UNIFY|MSI RX 6800|SAMSUNG NVME 990 PRO|RAZER TARTARUS PRO|AOC AGON AG273QX 2560x1440@165|STREAM DECK XL+PEDAL|CORSAIR K95 PLATINUM RGB
thomasbkdk
Posts: 180
Joined: Wed, 8. Jan 20, 07:34
x4

Re: Scanning of ship

Post by thomasbkdk »

Well i found where in the save game the scanned level is stored.

I'm wondering if the cause for not being able to change the scannedlevel for ships via scripting is that i need to use (if even possible) a reference to the static attribute since the cue is running 'instantiated'.
AMD 3700X|GSKILL 2x32GB 3600C17|MSI X570 UNIFY|MSI RX 6800|SAMSUNG NVME 990 PRO|RAZER TARTARUS PRO|AOC AGON AG273QX 2560x1440@165|STREAM DECK XL+PEDAL|CORSAIR K95 PLATINUM RGB
z1ppeh
Posts: 653
Joined: Sat, 8. May 04, 21:19
x4

Re: Change scanning level of ship

Post by z1ppeh »

thomasbkdk wrote: Fri, 14. Feb 25, 15:20 I have scanning of a station working with

<set_object_scanned object="player.target"/>

But this does not seem to work when a ship is targeted.

Can anyone tell me how to code that a ship has been scanned so that its order, crew etc. is visible to the player?
I refer you to viewtopic.php?p=5281623&hilit=set_objec ... d#p5281623 to get it to work if your still interested
thomasbkdk
Posts: 180
Joined: Wed, 8. Jan 20, 07:34
x4

Re: Change scanning level of ship

Post by thomasbkdk »

Nice find. Thank you.
AMD 3700X|GSKILL 2x32GB 3600C17|MSI X570 UNIFY|MSI RX 6800|SAMSUNG NVME 990 PRO|RAZER TARTARUS PRO|AOC AGON AG273QX 2560x1440@165|STREAM DECK XL+PEDAL|CORSAIR K95 PLATINUM RGB

Return to “X4: Foundations - Scripts and Modding”