Adding a Jump Dirve to "I" (capital shhip) Help~

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

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

u571x15
Posts: 17
Joined: Fri, 28. Feb 14, 11:00
x4

Adding a Jump Dirve to "I" (capital shhip) Help~

Post by u571x15 »

Yesterday I modified a mod I downloaded from nexus mods
it's the build Titurel mod from CHMS (Thanks!)
http://www.nexusmods.com/xrebirth/mods/348/?
I change it to build "I"(some crazy Xenon warship)
It worked, but....I found this capital ship has no jump drive!

now I have trouble adding a jump drive to this ship
anyone have any idea how to add surface elements?
because this monster is sitting in a sector and can't jump!
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

*** moved to EN S&M since this request was postend in English ***


basically you have to copy the connection Node for the Jumpdrive from another ship in both the Macro and Components files.
the related files are
assets/units/size_xl/units_size_xl_xenon_01.xml (component file)
assets/units/size_xl/macros/units_size_xl_xenon_01_macro.xml (macro file)

first file defines the position and shield groups, second defines what exactly is attached to this connection - just copy it over from e.g. the Taranis (units_size_xl_capital_destroyer_1) with the Code here:
component:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <add sel="//connections">
			<connection name="connection_jumpdrive01" group="group17 " tags="jumpdrive ">
				<offset>
					<position x="0" y="-93.39178" z="-810.0069"/>
					<quaternion qx="-1" qy="4.500026E-15" qz="-5.960464E-08" qw="-7.54979E-08"/>
				</offset>
			</connection>
  </add>
</diff>
macro:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
  <add sel="//connections">
      <connection ref="connection_jumpdrive01">
        <macro ref="props_surf_ar_jumpdrive_macro" connection="Connection01" />
      </connection>
  </add>
</diff>
after that you should concentrate on finding a Shield Group ( group="group17 " ) for the Jumpdrive since the one copied over from the Taranis probably doesnt fit and find a better Position for the Jumpdrive since it is probably somewhere inside the Ship and therefore not reachable (although this can be tricky if you are unexpierienced)
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 ;)
u571x15
Posts: 17
Joined: Fri, 28. Feb 14, 11:00
x4

Post by u571x15 »

thanks UniTrader
but sadly it didn't work(probably I did wrong)
first I tried the script you gave me(also setting it to a group(7) and the XYZ position too)
but the jump drive didn't show up
then, I tried replacing it with a turret.......
The turret disappear, but the jump drive didn't show up either :(

is there something so different for the jump drive?
or maybe it is the wrong XYZ position I set?(does it affect that much?)
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

does the Ship jump after the changes i suggested (or is the jumpdrive now available in the Ship Info)? if yes the Jumpdrive is present, its probably just hidden inside the Ship Geometry ;) if you want to improve the Position the first step is to get it somewhere visible, best nearby the final Position where you want it ;) (you can for example simply copy the coordinates of a nearby turret - and maybe also its rotation/quarternion if the target surface is the same ;) ) and them slowly moving it to the target position by try&error ;)


and the method of simply replacing a turret is bound to fail since this connection doesnt allow a jumpdrive - you have to change the tags in the component for that ;)
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 ;)
dez505
Posts: 172
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dez505 »

for that to work you'd need to edit the save game for current ships already spawned.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

dez505 wrote:for that to work you'd need to edit the save game for current ships already spawned.
thanks, you're right...
completely forgot about that since i usually test stuff in clean newgames.
alternatively re-spawning the Ship or apply a <patch_macro object="$ship" /> should help, too since the data is read again from game files or updated from there instead of being read from the savegame.
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 ;)
dez505
Posts: 172
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dez505 »

Intresting would that re-read all ship data from the game/extension files?

How would this patch code work?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

at least it restores the weaponcycle (thats the thing i am currently abusing it, didnt use it as intended yet) but basically yes, for the single Object given there. If you have more Objects to patch you may consider using <patch_macros /> which does the same for multiple Objects where the given criteria apply (simplest and most obvious method for search would be <patch_macros macro="macro.your_changed_macro" /> but not really sure if thats enough as criterium - if it is thats all necesary to execute to update all Objects of a certain Macro) - in combination with <conditions><event_game_loaded /></conditions> and some Version Variable stored globally a full update for Mods seems to be simple to achieve..

not familiar with MD enough yet, but it should look like this: (assuming updating from 100 to 120), with a previous Version 80 which had a change but doesnt need to be executed anymore

Code: Select all

<cue name="Update_Mod_***">
  <conditions>
    <event_game_loaded />
  </conditions>
  <actions>
    <!-- update if Save Version is less than Version 100 -->
          <!-- not executed since save version is already 100 -->
    <do_if value="global.$***_version lt 100" >
      <patch_macros macro="macro.not_changed_in_this_update_macro" />
    </do_if>
    <!-- update if Save Version is less than current Version 120 -->
    <do_if value="global.$***_version lt 120" >
      <patch_macros macro="macro.your_changed_macro" />
    </do_if>
    <!-- set Version stored in Save to current Version -->
    <set_value name="global.$***" exact="120" />
    <!-- reset cue for further Patching Actions in the future -->
    <reset_cue cue="this" />
  </actions>
</cue>
note that this code is just written from head with my current, negligable MD knowledge and some lookup with the xsds and was never tested in practice. Feedback if it works or changes are necesary would be nice so we have a template Code for updating in the future
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 ;)
dez505
Posts: 172
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dez505 »

Tried but just unsure how to use really.

Maybe try getting into how MD works later...I have lots to learn :P
u571x15
Posts: 17
Joined: Fri, 28. Feb 14, 11:00
x4

Ha, Start new game and it all worked!

Post by u571x15 »

Thanks gentlemen s, so at last, it is the problem that I didn't start a new game....
as for the "update mod", I haven't test it, should I just add it directly in to my mod?(yep sure it is quite annoying to start new game again and again)
u571x15
Posts: 17
Joined: Fri, 28. Feb 14, 11:00
x4

Player dock

Post by u571x15 »

after the succeed of the jump drive, I've manage to modify more weapons of the ship, no problem after all, except the player dock

Is it the material problem causing it not showing up? (since xenon ships never need a dock)

Return to “X Rebirth - Scripts and Modding”