Modelling questions

The place to discuss scripting and game modifications for X Rebirth.

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

42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Modelling questions

Post by 42parsec »

I thought by myself that the fact that i can watch the space while being docked on a ship which i gave the "take me to..." order is extremely cool and this definitely is a part of a thing that i dreamed of during every play of a X game:

A observation deck on which i can walk around and watch stuff happening around me.

I am not skilled at modding at all and also my 3d editing skills are zero but i want to improve myself and learn and maybe i will have a finished mod some day.

I just need a push in the right direction. Where should i look for the models that i have to edit if i want to change eg the standard cap ship docking port and how can i extract them?!
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

I also tried to add new objects to a area inside its corresponding xml by finding the desired object name like; ConnectionFor_interiors_rooms_ar_container_xl

and added it to \assets\interiors\rooms\macros\interiors_rooms_dockingbay_repairdock_macro.xml

and \assets\interiors\rooms\interiors_rooms_dockingbay_repairdock.xml

but the object did not show up ingame... apparently it broke the whole file because the other objects that i have removed in the same files are showing up again too.

So. what am i doing wrong?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

already removed the Skunk from this Platform here: http://forum.egosoft.com/viewtopic.php?p=4276254 ;) maybe you can figure out whats wrong with your aprroach by looking into it ;)
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 ;)
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

UniTrader wrote:already removed the Skunk from this Platform here: http://forum.egosoft.com/viewtopic.php?p=4276254 ;)

Yeah, Thanks UniTrader .. without your base i would have been lost completely. Ive used it to remove everything from the platform except the NPCs.

Those stupid small loot chests seem to be defined in another file then
interiors_rooms_dockingbay_repairdock.xml because even when i kill every reference about chests in this file, they still show up ... floating in midair and stuff.

The removal of stuff isn't the problem. But i want to add the player-cockpit PDA monitor to the hangar .... just to give it a try if it works... but it doesn't show up and that's where my problem start..
How do i add an object correctly? is it even possible to simply create new connections or are they hard-coded?! And .. how can i open uo the different objects and change them by hand? I.E. If i want to have a bigger landing platform.. how would i go about doing this?

Heres what i have so far:
http://www.filedropper.com/observationdeck

It simply removes everything from the Repair hangar except the NPCs



Ive also thought about a modding tool of some sorts.
It should be possible to tell the game to only load up a part of the world ..
i.e. only the room/worldspace that i am currently working on (which i have to define in a xml before i fire up the game) and place the player inside of it when i start a new game..
this could of course prove itself too extreme to do and maybe also the hardest way to get an working "graphics editor" (or at least viewer :) ) of some sort but it should be possible with the right level of expertise from my point of view ...
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

Ive tried to move the npcs by doing:

Code: Select all

<replace sel="/component/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc0_stand_02']/offset" />
	<offset>
		<position x="-3.239682" y="-1.476705E-03" z="-0.205711"/>
		<quaternion qx="-2.15515E-08" qy="0.9659258" qz="1.161508E-08" qw="0.2588191"/>
	</offset>
</replace>
But it did not work ... anyone knows why?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

*currently not at home, so writing from my memory - may be not completely correct*

if you want to add stuff/connections you have to add it in the macro file, too (similiar file Name, but ends with _macro.xml and is in the macros-subfolder) - here are the positions definied ;)

for moving stuff it is enough to only edit the macro ;)
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 ;)
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

AFAIS there is no position relevant data inside the macro file ...

the NPCs for example arent even mentioned in the _macro.xml
Last edited by 42parsec on Mon, 19. May 14, 10:41, edited 1 time in total.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

As you follow down the connection xml files you get to something like interiors_rooms_dockingbay_repairdock.xml which defines the places npc can stand. I guess there's methods for particular placement of npcs aka plot characters but I haven't looked into it.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

Hi Yorrick :)

Ive allready looked into this file to make the changes that ive allready achieved(removing all containers from the platform)

now i have a problem and im pretty shure that its my syntax in this .. maybe you two could have a look at it?

I have in interiours_rooms_dockingbay_repairdock.xml

Code: Select all

<?xml version="1.0"?>
<components>
	<component name="interiors_rooms_dockingbay_repairdock" class="dockingbay">
		<connection name="Con_npc_crouch_01" tags="npc crouch">
				<offset>
					<position x="6.58038" y="2.183068E-02" z="-8.260416"/>
					<quaternion qx="-1.888606E-08" qy="0.9217615" qz="5.245708E-09" qw="-0.3877573"/>
				</offset>
			</connection>
			<connection name="Con_npc0_stand_02" tags="npc stand engineer">
				<offset>
					<position x="-1.239682" y="-1.476705E-03" z="-0.205711"/>
					<quaternion qx="-2.15515E-08" qy="0.9659258" qz="1.161508E-08" qw="0.2588191"/>
				</offset>
			</connection>
			<connection name="Con_npc0_stand_01" tags="npc stand">
				<offset>
					<position x="-10.51626" y="-1.431704E-03" z="4.06802"/>
					<quaternion qx="1.035442E-08" qy="0.5709782" qz="2.412081E-08" qw="-0.8209652"/>
				</offset>
			</connection>
			<connection name="con_npc_leanwall_03" tags="npc ">
				<offset>
					<position x="12.56145" y="2.287364E-02" z="2.784738"/>
				</offset>
			</connection>
		</connections>
	</component>
</components>
i do (just to learn how the coordinates work and to see in which direction the npc will be moved [hence the akward position data]):

Code: Select all

<replace sel="components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc_crouch_01']">
	<offset>
		<position x="3.58038" y="8.183068E-02" z="-8.260416"/>
		<quaternion qx="-4.888606E-08" qy="0.9217615" qz="5.245708E-09" qw="-0.3877573"/>
	</offset>
</replace>

<replace sel="components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc0_stand_02']">
	<offset>
		<position x="-3.239682" y="-5.476705E-03" z="-0.205711"/>
		<quaternion qx="-5.15515E-08" qy="0.9659258" qz="1.161508E-08" qw="0.2588191"/>
	</offset>
</replace>

<replace sel="components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc0_stand_01']">
	<offset>
		<position x="-13.51626" y="-5.431704E-03" z="4.06802"/>
		<quaternion qx="6.035442E-08" qy="0.5709782" qz="2.412081E-08" qw="-0.8209652"/>
	</offset>
</replace>

<replace sel="components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc_leanwall_03']">
	<offset>
		<position x="9.56145" y="8.287364E-02" z="2.784738"/>
	</offset>
</replace>	
i get in rebirth game log:

Code: Select all

[General] ======================================
[=ERROR=] Cannot match path 'components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc_crouch_01']' in patch file 'extensions\ObservationDeck\assets\interiors\rooms\\interiors_rooms_dockingbay_repairdock'. Skipping node.
[General] ======================================
[General] ======================================
[=ERROR=] Cannot match path 'components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc0_stand_02']' in patch file 'extensions\ObservationDeck\assets\interiors\rooms\\interiors_rooms_dockingbay_repairdock'. Skipping node.
[General] ======================================
[General] ======================================
[=ERROR=] Cannot match path 'components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc0_stand_01']' in patch file 'extensions\ObservationDeck\assets\interiors\rooms\\interiors_rooms_dockingbay_repairdock'. Skipping node.
[General] ======================================
[General] ======================================
[=ERROR=] Cannot match path 'components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc_leanwall_03']' in patch file 'extensions\ObservationDeck\assets\interiors\rooms\\interiors_rooms_dockingbay_repairdock'. Skipping node.
[General] ======================================
:?: :?:

what am i doing wrong? thx :)
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

You're just missing the first / for the xpath syntax the game uses.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <replace sel="/components/component[@name='interiors_rooms_dockingbay_repairdock']/connections/connection[@name='Con_npc_crouch_01']">
    <offset>
      <position x="3.58038" y="8.183068E-02" z="-8.260416"/>
      <quaternion qx="-4.888606E-08" qy="0.9217615" qz="5.245708E-09" qw="-0.3877573"/>
    </offset>
  </replace>
</diff>
run as a test patch it went through without error spew on my 2.0 beta install.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

thx ... how could i miss that ?! :headbang:

but at least i now know how it happened... i was playing around with wildcards to make selections like /*/*[@name='stub']/*/*[@ref='stub']

i forgot to add the / back in ...
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

To be fair I think if you used say w3schools xpath tutorials you could easily get to the same error as your way is legal from that reference.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

:)

at the moment its more like .. reading how other modders do it and learn it by myself with guidance from your and Observes tuts/references ... thanks for the provided material..

another question which you may could answer for me?!..

from your tutorial

Code: Select all

Replace an attribute

Patch
Code:
  <replace sel="root/bar/foo[@a='1']/@a">3</replace>


Result
Code:
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <bar>
    <foo a="3"/>
    <foo a="2"/>
  </bar>
</root>

i get it that

Code: Select all

<replace sel="/components/component[name='interiors_rooms_dockingbay_repairdock']/layers/layer/waypoints/waypoint[@x='1.709161']/@x">0</replace>
should do it @

Code: Select all

<?xml version="1.0"?>
<components>
	<component name="interiors_rooms_dockingbay_repairdock" class="dockingbay">
		<source geometry="assets\interiors\rooms\\interiors_rooms_dockingbay_repairdock_data"/>
		<layers>
			<layer>
				<waypoints>
					<waypoint name="XU_Waypoint01" tags="typenormal sizeLevel1 interior start undock " x="1.709161" y="5.34844" z="17.97398">
						<links>
							<link ref="XU_Waypoint02"/>
						</links>
					</waypoint>
					<waypoint name="XU_Waypoint02" tags="typenormal sizeLevel1 interior " x="0" y="1.968226" z="0">
						<links/>
					</waypoint>
				</waypoints>
				<lights/>
			</layer>
		</layers>
	</component>
</components>
but it gets me

Code: Select all

[General] ======================================
[=ERROR=] Cannot match path '/components/component[name='interiors_rooms_dockingbay_repairdock']/layers/layer/waypoints/waypoint[@x='1.709161']/@x' in patch file 'extensions\ObservationDeck\assets\interiors\rooms\\interiors_rooms_dockingbay_repairdock'. Skipping node.
[General] ======================================
maybe you could help me with that one too ? :)
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Well, it's not my tutorial, it's theqmann's :)

Your issue here is that the <layer> has 2 <waypoint> sections that both contain an x value and XR doesnt know which one you mean.

Since I don't have your mod handy to test actual result of modding the x value I think that a full block replace would work better here given my limited xpath knowledge. Perhaps someone more fluent can chip in and tell you how to do it better. This way you can at least change all co-ords to your hearts content with reasonable certainty that future patches that do not drastically overhaul interiors wont break your mod.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <replace sel="/components/component[name='interiors_rooms_dockingbay_repairdock']/layers/layer/waypoints">
    <waypoint name="XU_Waypoint01" tags="typenormal sizeLevel1 interior start undock " x="1.709161" y="5.34844" z="17.97398">
      <links>
        <link ref="XU_Waypoint02"/>
      </links>
    </waypoint>
    <waypoint name="XU_Waypoint02" tags="typenormal sizeLevel1 interior " x="0" y="1.968226" z="0">
      <links/>
    </waypoint>
  </replace>
</diff>
disclaimer : I was too lazy to test this for debug spew, but it should be fine.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

try this one, should have your intended effect and is more clear:

Code: Select all

<replace sel="//waypoints/waypoint[@name='XU_Waypoint01']/@x">0</replace>
( // ist for any path which matches the rest of the Pattern, you dont need to specify the full path ;)
@name= is better suited as indentifier since it is clear what you mean, the x attribute requires searching through the file)
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 ;)
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

UniTrader wrote: (// ist for any path which matches the rest of the Pattern, you dont need to specify the full path ;)
Seriously? Das saves a lot of headache ;) thx Uni!! Will adapt my script as soon as i get home...
Deleted User

Post by Deleted User »

since when new models can be added?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

Dark_Ansem wrote:since when new models can be added?
as long as you use existing Ship Parts since release ;) just adding new parts requires not-yet-released (?) Modding Tools, although Model Creation/Change via xmls only is a bit tricky
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 ;)
42parsec
Posts: 34
Joined: Sat, 17. May 14, 16:42

Post by 42parsec »

Thats true .. it would be VERY tricky ... but a friend of mine (who is a physics student) and i are working on a position calculator with which you can transform pos=x/y/z rot=x/y/z into quaternions .... i will write about it as soon as it is finished ... maybe we can add a nice GUI to it which can read the xml files directly and show you the position for each object in an human-understandable form....

seriously ego ... quaternions .... you are freaks
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

42parsec wrote: but a friend of mine (who is a physics student) and i are working on a position calculator with which you can transform pos=x/y/z rot=x/y/z into quaternions ....
not necesary, you can also use abg-rotation-values instead of quarternions in the model xmls ;)
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 ;)

Return to “X Rebirth - Scripts and Modding”