VR Modding

Feedback and information for X Rebirth VR Edition

Moderator: Moderators for English X Forum

Post Reply
Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

VR Modding

Post by Archaine » Sat, 4. Aug 18, 06:47

I would like to try my hand at modding the VR version, I am downloading from oculus as I type here.

I downloaded the extensions zip that was available, but I would like to create my own mods. I did this with X3AP after getting the required tools.

I see there is a toolset for the vanilla rebirth, but I do not see one for VR, and I do not own the vanilla so those tools are restricted.

Please, how do I get the tools I need for modding VR version?

Thanks

Archaine

User avatar
ubuntufreakdragon
Posts: 5189
Joined: Thu, 23. Jun 11, 14:57
x4

Re: VR Modding

Post by ubuntufreakdragon » Sat, 4. Aug 18, 11:06

Archaine in DevChat wrote:I press the new topic button in the forum and it just jumps back to the main forum page??
Delete your recently cached pages.
Oh and the chat normally takes 4hrs for an answer.


You may want to ask your question here too:
https://forum.egosoft.com/viewtopic.php?t=357464
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist

Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Thanks

Post by Archaine » Sun, 5. Aug 18, 05:40

I tried the tool download once more and it worked this time.

Thanks again

Archaine

Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Scripting more than modding

Post by Archaine » Sun, 5. Aug 18, 19:48

I read through the documentation.
I guess I was more interested in scripting modification.

Is this possible in XRebirthVR?

Here is an example of what I mean.
in Alb Prelude I got into the scripting and was able to call them from the command menu through the script editor.


Example of Script to generate orbita defense platform with surrounding laser tower rings and set rules of engagement

$pSector = [PLAYERSHIP] -> get sector
$xCenter = [PLAYERSHIP] -> get x position
$x = $xCenter
$yCenter = [PLAYERSHIP] -> get y position
$y = $yCenter
$zCenter = [PLAYERSHIP] -> get z position
$zCenter = $zCenter + 4000
$z = $zCenter
$Platform = create ship: type=Large Orbital Weapons Platform owner=Player addto=$pSector x=$xCenter y=$yCenter z=$zCenter
= $Platform -> install 3 units of 2 GJ Shield
= $Platform -> install 48 units of Concussion Impulse Generator
= $Platform -> install 1 units of Duplex Scanner
= $Platform -> install 1 units of Triplex Scanner
= $Platform -> install 1 units of Fight Command Software MK1
= $Platform -> install 1 units of Fight Command Software MK2
= $Platform -> install 1 units of Carrier Command Software
= $Platform -> install 1 units of Special Command Software MK1
= $Platform -> install 1 units of Singularity Engine Time Accelerator
= $Platform -> install 250 units of Firestorm Torpedo
= $Platform -> install 250 units of Hammerhead Missile
= $Platform -> install 300 units of Hornet Missile
= $Platform -> install 300 units of Tempest Missile
= $Platform -> install 1000 units of Hurricane Missile
= $Platform -> install 777 units of Mosquito Missile
$TurretCount = $Platform -> get number of turrets
$tCounter = 0
while $tCounter <= $TurretCount
$Platform ->start task $tCounter with script !turret.killenemies.std and prio 0: arg1=$tCounter arg2=null arg3=null arg4=null arg5=null
inc $tCounter =
end
START $Platform -> command COMMAND_KILL_ENEMIES : arg1=null, arg2=null, arg3=null, arg4=null
$Platform ->set fire missile probability to 75
$Platform ->start task 10 with script plugin.missile.def.main and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
$Platform ->start task 11 with script ArchOrbitalDefenseBlockSCMiCa2 and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
$Platform ->start task 12 with script ArchOrbitalDefenseBlockSCMiFi2 and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
$Platform ->start task 13 with script ArchOrbitalDefenseBlockSCMiDe2 and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
@ = [THIS] -> call script DevilsHalo16LtowerSmlRngSmlPXZSC :
@ = [THIS] -> call script DevilsHalo16LtowerSmlRngSmlPXYSC :
@ = [THIS] -> call script DevilsHalo16LtowerSmlRngSmlPZYSC :
return null
Last edited by Archaine on Mon, 13. Aug 18, 03:19, edited 1 time in total.

User avatar
ubuntufreakdragon
Posts: 5189
Joined: Thu, 23. Jun 11, 14:57
x4

Post by ubuntufreakdragon » Sun, 5. Aug 18, 19:59

the main script language of XR is md look up the folders aiscripts and md. (inside the cats)
btw. many of your scripts especially the last one a rather stupid and you can enclose code in [co.de][/co.de] - the points tags

Code: Select all

$counter = 0
$quantity = 16
$angle.step = 65535 / $quantity
while $counter < $quantity
  $angle = $counter * $angle.step
  $x = fixed sin $angle
  $z = fixed cos $angle
  $x = $xCenter + $radius * $x
  $z = $zCenter + $radius * $z
  inc $counter =
  *create stuff
end
 
eliminates all if clauses and work with quantity which are not a power of 2
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist

Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Post by Archaine » Sun, 5. Aug 18, 22:59

Thanks for that, thought there was a better way.
I'm not a programmer, well wasn't then, kinda pulled all of that out of my butt at the time.


What is the interface to call scripts while in game? There is no script editor, that I have found.

Got the Cat tool running, totally lost at this point, I assume I write my script and append it to a cat, then again how is it envoked in game?

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 6. Aug 18, 00:07

actually you can just create a new folder in the extensions folder (which is your own mod you can select from the ingame menu ;) ) and in there create an MD folder where you just add our own MD files. Far easier than messing with Cats/Dats (and also it is not necesary to change the game cats/dats themselves or add such files to the game root - there is always a way to do it with extensions )

Regarding calling Scripts: in for MD you have to define fitting conditions for it to trigger a cue. for Testing purposes <event_object_cycled_weapons object="player.primaryship"/> is a good start since you can easily trigger it.*
example script to print a message on the screen each time the weapons are cycled:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<mdscript name="Example" xsi:noNamespaceSchemaLocation="./md.xsd">
  <cues>
    <cue name="ExampleCue">
      <conditions>
        <event_object_cycled_weapons object="player.primaryship"/>
      <conditions/>
      <actions>
        <show_help custom="'Hello World'"/>
        <reset_cue cue="this"/> <!-- to repeat this cue when done -->
      </actions>
    </cue>
  </cues>
</mdscript>

*there are more events available. best get an autocompleting xml editor (based on xsd files) and put both the md.xsd and common.xsd from the games libraries folder inside your md folder, and use the xsi:noNamespaceSchemaLocation="./md.xsd" to use it in your script (maybe needs reloading the File). Alternatively you can search the aforementoined Files with a Text Editor.
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 ;)

Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Post by Archaine » Mon, 6. Aug 18, 00:23

Thanks for the assistance. Just getting up and running, lots to absorb.

About to go through the "How to Create a Custom Gamestart tutorial" to get a feel for the system.

I will try you example as a first step.
Is there a way to create a menu button and use that as the trigger?

Any recommendations for free xml editor?

My eventual goal is to import my own custom ship, I have one in Unreal editor that I can explore in VR mode, but it's a static experience. Thought it would be neat to see it working in a real game environment.

Again thanks.

Archaine

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 6. Aug 18, 00:41

Is there a way to create a menu button and use that as the trigger?
Technically yes, but UI stuff is very diffrent from MD/AIScript. Also it only supports complete file replacements afaik, so each menu can only be changed by one mod each (there is a Mod available which allows multiple mods to hook into the Sidebar though, but i am not familiar with it)
In short too much to learn for some quick experimenting imo....
Any recommendations for free xml editor?
i personally use XmlCopyEdit as Editor and Notepad++ to crawl through Files. Egosoft afaik uses the MS Visual Web Developer.

Code: Select all

My eventual goal is to import my own custom ship, I have one in Unreal editor that I can explore in VR mode, but it's a static experience. 
For that purpose the UI and MD Stuff is at best tangential... basically you have to convert the Ship into the Mesh Format for XR (including macro and component files), register aforementoined files in the two index files so the Game finds them, give your new Ship some Build Ressources in the wares.xml and finally make it buildable in a Shipyard Module or spawn it via Jobs files. Most of this involves xml, but none of them involve MD or AIScript... or UI for that matter.. (although MD is still useful for Testing because you can just spawn your Ship on Gamestart with it)

got an older mod of mine here which adds a Kitbashed new Ship to the Game. not an entirely new Mesh, but its a good start i think:
https://www.dropbox.com/s/zgyoywmi6oqy5 ... us.7z?dl=0
(Not sure if this is the updated Version or the initial one from 2013 though, but as example to build upon it should still work good enough)
Regarding Importing new Meshes i think its best to ask J.L. - he is one of the few i am aware of who has imported custom Meshes into the Game..


will answer further Questions this Afternoon. its already past Midnight here... :S
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 ;)

Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Post by Archaine » Mon, 6. Aug 18, 01:00

Ok, I have Notepad++ getting XmlCopyEdit now.
Grabbed your dropbox, will work with that a bit.
I will get back with you tomorrow for sure.

Thanks again for the assistance.

Archaine


I got your ship running in the game, I will spend some time to disect it after reading up on the ship system.
(bounced around in the docking bay for five minutes before escaping :)) huh emoticons not working?

XML copy editor gives me validate errors on most of these documents, even the official egosoft ones.

"no decleration found for element 'mdscript, content, etc..'
I assume it is harmless.

I got it to validate my test script by adding a xmlns namespace, still don't fully understand that.

<mdscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Arc_Mod" xsi:noNamespaceSchemaLocation="md.xsd">

Completed the XML tutorial on w3schools, makes a little more sense now.
So the xsi namespace pointer gives xml editor the connection to the library for the handy dandy auto-completes. Insanely helpful!

Anyway back to it.

Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Post by Archaine » Mon, 6. Aug 18, 21:43

UniTrader,

I used your convert tools on my extracted directory to get at the dae mesh versions.

Playing with them in Max now.

Thanks again for you help and your tools!

Archaine

PS: Will any of this apply to X4, as my true desire will be to use this experience for modding that baby!

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 6. Aug 18, 23:38

not my tools - they were created by another user ;)

Also i assume that yes, it will help with X4 because from a technical standpoint its like an Upgraded XR (i would guess its a step similiar as from X2 to X3, but we will see)
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 ;)


Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Post by Archaine » Fri, 10. Aug 18, 06:10

Hey UiTrader,

I was going to use your "UTRahanasHybridPlus" as a template and reverse engineer it. After looking through the content in detail, I think maybe a simpler ship might be a better choice. (Like the police car)

The big part I am missing is the connections to the xmf content that represents the ship. Since you were not using any custom meshes, I see no example of where the connections to the mesh data are made, I assume some pointer in your files makes this connection through a xml called out in there somewhere, could you point me in the right direction. I will start picking apart a smaller ship in the mean time, and may find this connection in doing so.

I will be exporting my mesh data from Max and will mimic the format for materials etc. that I am seeing in the imports I have tested. Once I have the dae from max, I assume using the convert tool to turn it into a xmf and then into xml will be the steps needed.

Also finally found the skunk in the dock with the landing gear down, am planning a render for that, took awhile to find, and some skunk parts I was missing are included, like the mining laser, looked everywhere for that and could not find the dae for it. And the weird reverse engine looking things on each side of the lower hull, not sure what those are or where to find them. But they are in the docked version.

Man this is getting thick. But I'm hanging in there.

Archiane


Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Getting there.

Post by Archaine » Mon, 13. Aug 18, 02:55

UtiTrader,

I now have my ship in the game!
Complete with Lod's, Collision, and textures.
It has it's own ship group, texture group, etc.

Questions

No need, figured it all out.

Thanks
Archaine

Though I still cannot spawn actors in the skunk and have them work properly, they only have one dialogue option and that is "goodby" If I spawn them on a ship with a dock and assign them to the skunk they work fine. How do you create actor that works directly in the skunk. Does it have a platform entity?

I use the search tool on the forum, but I get no results for anything with it.
I search for "pilot" and it says no results (and I know pilot is mentioned a thousand times in the modding forum?) Just saying my questions are not out of lazyness, I haves spent hours searching.

Archaine
Posts: 19
Joined: Mon, 7. Dec 15, 23:21
x3ap

Mesh Modding

Post by Archaine » Sat, 18. Aug 18, 06:41

Not too many mesh modding post here, so I will contribute from what I have learned.

All of this can exist in a mod folder under extensions - no core packing.

First you have to unpack all the existing data convert xmf to dae with the XRConvertersMain.exe - This will give you a library of examples to work from. Also copy XRConvertersMain.exe and XRConverters.dll into your mod's assets folder to later reconvert your data when your ready. I have a temp folder in my assets directory that I put the dae exported from max in and run the bat file below to reconvert, then copy the xmf's back into the ships data folder.

FOR /R "temp" %%f IN (*.dae) do (
XRConvertersMain.exe exportxmf "temp" "%%f"
)
pause

Set 3dsmax system units to cent and working units to cent or generic.

Importing/exporting max2017-18
Autodesk collada import/export - works best, but does not handle vertex colors and will mess them up so you will have to recolor and alpha these.
Import scale = 1, rest of the settings = default.
Open collada plugin - You get vertex colors, but the mesh is buggy in game, normals or tangents or something messed up. The x-converter will not convert meshes exported with open collada, so Autodesk native will have to be used for export.

I import existing ships dae data in to get proper node layout and naming conventions, node names equate to parts and child names have material data in name (naming conventions is all important in the node tree)

Example.
units_size_xl_capital_destroyer_1 (root node)
......part_heck (dummy node for rear part)
...........part_heckXcollision (collision mesh)
...........part_heckXlod0 (dummy node for rear lod0)
.....................part_heckXlod0XargonXar_hullpattern_01 (visual mesh)
.....................more parts
...........part_heckXlod1 (other levels of detail, usually 4 total)
.....................repeat of the above node with less detailed geo.

The end of the part name is the material info for the part. XargonXar_hullpattern_01 (X's are dividers, first part = directory last part = material name)

Model up your own stuff, rename but keep the node format and create your own mats if you like, create a material group for them in material_library.xml, and put your textures in the assets/textures folder. (tie it all together in material xml - (open it up and look at existing material formats and mimic those but with your own names)

Import in weapons and props from the props folder in the extracted data.
place these where you need, and model around them, (don't export them with your model, they will be replaced by the prop in game, you just need to call out its name an position/rotation in the master ship xml. (I have a script at the end to help get this location data from your model and explain the process in more detail.)

Create your own ship group in shipgroups.xml, and ship type in ships.xml.

I used the existing ship's xml and macro, just renaming stuff and pointing to my new parts(and removing old ones). when you convert your dae's back to xmf it creates an xml that has the part info for your new model, paste new part component data into the ships master xml. (don't forget to point the data connection at the top of the master xml to your own data ie. extensions\modname\assets\shipsize\yourshipname.

Anyway, if anyone wants a clearer tutorial I might put something together, just hard to do without images, and can't post those here.


Here is a maxscript to get location data from your props. open max script editor, create a new script and paste it in, open the listener to see the data.

(--ARC-XpropData - 3dsMax 2018 - should work in lower versions too.
--List of steps you need to do first.
--Zero props to match xworld (ie. turrets - apply xform modifier to prop node(and children) and rotate 180 about x-axis then collapse)
--Zeroing props may differ depending on prop, have not tired very many.
--Place props in relation to master model, and then place prop nodes under root node.
--Rotate root node -90 about x-asis to zero out rotational transforms (y-z axis flip compensation) if woking with z up.
--Select a single prop (just it's main node is fine) and run script to get positon and rotation, cut and paste from script listener into xml.
--I never used Yaw Pitch and Roll rotations, so they will need to be converted (swaped around, made neg/pos, or a mixture)
--Re-rotate your root node back to it's original position before exporting.
--Don't export the props (selectively export or delete props first)

xpos = $.position
px = xpos.x * -1
py = xpos.y
pz = xpos.z

xquat = $.rotation
qw = xquat.w
qx = xquat.x
qy = xquat.y * -1
qz = xquat.z * -1

xrot = $.rotation as eulerAngles
yaw = xrot.z
pitch = xrot.x
roll = xrot.y

format "<position x=\"%\" y=\"%\" z=\"%\" />\n" px py pz
format "<quaternion qx=\"%\" qy=\"%\" qz=\"%\" qw=\"%\" />\n" qx qy qz qw
format "<rotation yaw=\"%\" pitch=\"%\" roll=\"%\" />\n" yaw pitch roll
)


Anyway, hope this helps anyone wanting to work with their own geometry.

Archaine

Post Reply

Return to “X Rebirth VR Edition”