(double-post because last answer was half a day ago)
ok, i just looked into the script-side of positioning.. the Positions are correct inside the Script itself (placement was absolutely fine InGame when i placed the Gates during a test run via script) - so no idea whats wrong with the offset.. a Code Snippet where it went wrong might be interesting (for example the diff code for a single Zone)
additionally i made some improvements to the script:
-> some comments added where to change values for timing/distance and Zone Size
-> Debuglog output is now only in Tubes and much clearer (Message for entered Tube, changed Position Origin to a Zone, changed Position Origin to the Sector, and of course the Positions)
-> corrected angle value from radians to degrees
-> first Gate is skipped because its same pos as Entry Gate
-> can place midgates during flythrough (kicks you out on entering when midgate has collisions, therefore deactivated)
since it is very short here just the Code for C&P:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<aiscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="log.coordinates.in.tube" xsi:noNamespaceSchemaLocation="http://utnas/~unitrader/XRebirthxsds/aiscripts.xsd">
<params>
</params>
<attention min="unknown">
<actions>
<do_while value="true">
<wait exact="10s"> <!-- you can change the distance between mid-gates with this parameter - it defines the time between the position outputs -->
<interrupt>
<conditions>
<event_object_changed_zone object="player.primaryship"/>
</conditions>
<actions>
<do_if value="player.primaryship.zone.isclass.highway" >
<debug_text text="'Player entered Highway %s'.[player.primaryship.zone.macro]" filter="general"/>
<set_value name="$entered_tube" exact="true" />
</do_if>
</actions>
</interrupt>
</wait>
<find_zone name="$newzone" tempzone="false" priorityzone="true" multiple="false" >
<match_distance object="player.primaryship" max="50km" /> <!-- this Value defines as how big Zones should be treated - 50 km is absolutely safe, but higher valuses should work, too (dont set it too high - this command seems to pick any in range, not necesarily the nearest -->
</find_zone>
<do_if value="$newzone == null" >
<set_value name="$newzone" exact="player.primaryship.sector" />
</do_if>
<do_if value="$newzone != @$zone or $entered_tube?" >
<set_value name="$zone" exact="$newzone" />
<do_if value="$zone.isclass.zone" >
<debug_text text="'Coordinates now inside/relative to %s'.[$zone.macro]" filter="general"/>
</do_if>
<do_else>
<debug_text text="'Coordinates now inside/relative to %s - THE SECTOR !!!!!!!!!!'.[$zone.macro]" filter="general"/>
</do_else>
</do_if>
<create_position name="$position" space="$zone" object="player.primaryship"/>
<show_notification caption="'POSITION AND ROTATION:'" details="[$zone.name,$position.x,$position.y,$position.z,player.primaryship.rotation.yaw,player.primaryship.rotation.pitch,player.primaryship.rotation.roll]" timeout="2.9s"/>
<do_if value="player.primaryship.zone.isclass.highway and not $entered_tube?" >
<debug_text text="'<offset><position x="%s" y="%s" z="%s" /><rotation yaw="%s" pitch="%s" roll="%s" /></offset>'.[$position.x,$position.y,$position.z,player.primaryship.rotation.yaw*114.592,player.primaryship.rotation.pitch*114.592,player.primaryship.rotation.roll*114.592]" filter="general"/>
<!-- Testing Option - create the Gates along the Path ( add "nocollisions" tag to all connections in the midgate macro and/or component for testing or it will kick you out on entering!!!! ) -->
<do_if value="$zone.isclass.zone and false" > <!-- remove "and false" here to create midgates during flythrough -->
<create_object macro="macro.props_lordjack_highway_midgate_macro" zone="$zone" ><position value="$position" /><rotation yaw="player.primaryship.rotation.yaw" pitch="player.primaryship.rotation.pitch" roll="player.primaryship.rotation.roll"/></create_object>
</do_if>
</do_if>
<remove_value name="$entered_tube" />
</do_while>
</actions>
</attention>
</aiscript>
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
