Can someone tell me if this coding line means a position minimum 6km from player ship plus max 2km on the z axis?
<position object="player.ship" z="6km" max="2km"/>
If not, how do i add some randomness into the position on the z axis?
How would it look if it had to be minimum 6km from playership but maximum 8km on the Z axis?
Safepos Z min max
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 179
- Joined: Wed, 8. Jan 20, 07:34
Safepos Z min max
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
-
- Moderator (Script&Mod)
- Posts: 13477
- Joined: Sun, 15. Feb 04, 20:12
Re: Safepos Z min max
Usually I use create_position as you can set individual (also random) coordinates. For example:
and after that:
If you want the x and y positions to be the player's ship then use player.ship.position for the corresponding values or set the player's ship as object in the position command.
Cheers Euclid
Code: Select all
<create_position name="$pos" space="player.sector" x="[$xmin $xmax].random" y="[$ymin $ymax].random" z="[$zmin $zmax].random"/>
Code: Select all
<position value="$pos"/>
Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
-
- Posts: 179
- Joined: Wed, 8. Jan 20, 07:34
Re: Safepos Z min max
I see 'radius' used in some coding.
will something like this work
<position object="player.ship" radius="6km" />
or
<create_position name="$pos" space="player.ship" radius="[3km 5km].random"/>
or just
<create_position name="$pos" space="player.ship" radius="5km"/>
will something like this work
<position object="player.ship" radius="6km" />
or
<create_position name="$pos" space="player.ship" radius="[3km 5km].random"/>
or just
<create_position name="$pos" space="player.ship" radius="5km"/>
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
-
- EGOSOFT
- Posts: 2148
- Joined: Mon, 23. Nov 15, 18:02
Re: Safepos Z min max
min/max in this context (as well as get_safepos and create_position) adds a random offset to the defined position.
Not sure what max does by itself (day is done and i'm really trying to not crack open code) but if you also specified min, it would be some random offset in a random direction between min and 2km away from 6km in front of player.ship.
Code: Select all
ship------
\
\
pos