[Question] Is there something like get_object_min_hull

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

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

Post Reply
User avatar
Vannacutt-BT-
Posts: 92
Joined: Sun, 17. Jun 18, 16:57
x4

[Question] Is there something like get_object_min_hull

Post by Vannacutt-BT- » Thu, 17. Jun 21, 22:32

Hey,

we can make with the command

Code: Select all

<set_object_min_hull object="player.ship" exact="100"/>
the player ship invincible.
My question is there a way to find out if the value is set that is changed by "set_object_min_hull".
Something like get_object_min_hull ? :gruebel:

Please don't comment over cheating, thank you.
I have my reasons.

Thank you in advance
Vannacutt-BT-
Best regards
Vannacutt-BT-


PC-Specs: PasteBin
My Mod: BaerTec God Mode
For questions why I use a mod, I am seriously ill.

"...und der Tod stellte seine Sense in die Ecke und stieg auf den Mähdrescher... denn es war Krieg" - Unknown Author

User avatar
peroxyde
Posts: 2230
Joined: Sun, 2. Apr 06, 00:12
x3tc

Re: [Question] Is there something like get_object_min_hull

Post by peroxyde » Thu, 17. Jun 21, 23:25

I don't know the exact answer to your question (i was a MSCI scriptor, not a MD one)...
But except the one-shoot, maybe something like this could help (checkinterval="1s", and it's done whatever the %hull the ship has):

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<mdscript name="ShipOfGod" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>
    <cue name="FullRepair" instantiate="true" checkinterval="1s">
	<set_object_min_hull object="player.ship" exact="100"/>
    </cue>
  </cues>
</mdscript>
Image
"On apprend en faisant des erreurs, mais le problème c'est qu'en explosifs, l'erreur est fatale." Aldébaran v10
Image<-- Clef Des Toilettes Privées Du Forum Français décernée par Thoto le 23/06/07

User avatar
Vannacutt-BT-
Posts: 92
Joined: Sun, 17. Jun 18, 16:57
x4

Re: [Question] Is there something like get_object_min_hull

Post by Vannacutt-BT- » Fri, 18. Jun 21, 06:42

@peroxyde thank you for your answer
what you have posted looks similar to what I have.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<mdscript name="X4_BT_God_Mode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
    <cues>
        <!-- Make Player Primary Ship invincible -->
        <cue name="BTGM_Player_Ship_Invincible" instantiate="true" checktime="player.age + 20000ms" checkinterval="20s" namespace="this">
            <actions>
                <!-- Player Ship -->
                <restore_object object="player.ship" hull="100" recursive="true" />
                <set_object_min_hull object="player.ship" exact="100"/>
                
                <!-- Some more code -->
            </actions>
        </cue>
        
        <!-- Some more code -->        
    </cues>
</mdscript>
This is what I have so far. Its no problem and working.
Maybe I overthink my problem. Because I learned to set only values when you need them
in programming. :gruebel:

Full Source can be seen here:
https://github.com/VannacuttBT/X4_BT_God_Mode
Best regards
Vannacutt-BT-


PC-Specs: PasteBin
My Mod: BaerTec God Mode
For questions why I use a mod, I am seriously ill.

"...und der Tod stellte seine Sense in die Ecke und stieg auf den Mähdrescher... denn es war Krieg" - Unknown Author

User avatar
Vannacutt-BT-
Posts: 92
Joined: Sun, 17. Jun 18, 16:57
x4

Re: [Question] Is there something like get_object_min_hull

Post by Vannacutt-BT- » Fri, 18. Jun 21, 09:29

I think I have found what I need.
When I have a working result I'll post here. :)
Best regards
Vannacutt-BT-


PC-Specs: PasteBin
My Mod: BaerTec God Mode
For questions why I use a mod, I am seriously ill.

"...und der Tod stellte seine Sense in die Ecke und stieg auf den Mähdrescher... denn es war Krieg" - Unknown Author

User avatar
Vannacutt-BT-
Posts: 92
Joined: Sun, 17. Jun 18, 16:57
x4

Re: [Question] Is there something like get_object_min_hull

Post by Vannacutt-BT- » Fri, 18. Jun 21, 12:18

In hope to help other people in search.
This is what I found out

Code: Select all

<cue name="BTGM_Player_Ship_Invincible" instantiate="true" checktime="1min" checkinterval="1s">
    <actions>
        <!-- Player Ship -->
        <set_value name="$BTGM_Player_Ship" exact="player.ship"/>
        <do_if value="$BTGM_Player_Ship != null and $BTGM_Player_Ship.isclass.destructible">
            <!-- If Player Ship is damaged repair it -->
            <do_if value="$BTGM_Player_Ship.hullpercentage lt 100">
                <restore_object object="$BTGM_Player_Ship" hull="100" recursive="true" />
            </do_if>
            
            <!-- If Player Ship is not invincible make it invincible -->
            <do_if value="not $BTGM_Player_Ship.isindestructible">
                <set_object_min_hull object="$BTGM_Player_Ship" exact="100"/>
            </do_if>
        </do_if>
        
        <remove_value name="$BTGM_Player_Ship"/>
    </actions>
</cue>
Needs more testing from my side, but first test are looking promising.
Best regards
Vannacutt-BT-


PC-Specs: PasteBin
My Mod: BaerTec God Mode
For questions why I use a mod, I am seriously ill.

"...und der Tod stellte seine Sense in die Ecke und stieg auf den Mähdrescher... denn es war Krieg" - Unknown Author

Post Reply

Return to “X4: Foundations - Scripts and Modding”