In-Game Model Viewer : Preview Ships At Shipyards (v1.2.0.3 - 26 Aug 08)

The place to discuss scripting and game modifications for X³: Reunion.

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

Does it work OK ?

Works great, straight off !
4
24%
Had to fiddle about a bit to make it work.
3
18%
Can't make it work whatever !
10
59%
 
Total votes: 17

exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

In-Game Model Viewer : Preview Ships At Shipyards (v1.2.0.3 - 26 Aug 08)

Post by exogenesis »

Here's an in-game utility for previewing ships at shipyards,
it can be activated with the player ship in space, or docked at a shipyard.

EDIT: 21st Oct 08

THIS IS NOT X3:TERRAN CONFLICT COMPATIBLE
(ONLY WORKS WITH X3:REUNION & POSSIBLY X2)



You need to enable the script editor for this to work - i.e. change your player name to Thereshallbewings
- Your game will be marked as **modified** when you do this


If you can't get it to work, please post in this thread to tell me,
& hopefully I can iron any problems out!


Version 1.2.0.3, 26 Aug 2008 = NO LONGER GIVES MULTIPLE HOTKEY ENTRIES

[ external image ]


For X3 only, it is designed to work with vanilla X3, or any X3 mod.

Based on the XModels3DViewer standalone utility (but improved), this in-game version shows a 3D rotating
animation of any ship available at shipyard(s) in the sector that the player is currently in.

- Gun turret identification and initial firing direction are textually/graphically indicated (this can be turned off)
- Ship scale is indicated with a jump-gate and an astronaut in the ship-view window (these can be turned off) :
[ external image ] [ external image ]
- Fixed-sized ship preview window can be switched to full-screen & back.
- Works with any of the ES supported languages.

This util does not add-to or affect any game-file contents in any way (modded or not),
and the scripts do not use any command IDs, log file log52915.txt is used.
The player can only control the viewer with 5 numpad keys, with NumLock turned on (see below).


Screenshots below are with the XTM mod installed:

In space, in a sector with shipyard(s):

fixed-window mode:
[ external image ]

full-screen mode
[ external image ]

Docked at shipyard:

[ external image ]

[ external image ]

In Russian:

[ external image ]

[ external image ]


INSTALLATION:
Download this:
http://www.Exogenesis.co.uk/X3_InGame_M ... .2.0.3.exe (1.9 MegaBytes)

Run this installer, browsing to your X3 main directory,
(you choose the directory manually, so multiple installations are possible).

the following files will be placed in your main X3 directory:
X3_LaunchWithModelViewer.bat
Launcher.exe
Direct3D-Hook.dll
ModelViewer.dll
x2fd.dll
d3dx9_29.dll
msvcr71.dll
MFC71u.dll

the following scripts are placed in the X3\scripts directory:
al.ModelViewer.EventHandler.xml
al.plugin.ModelViewer.Register.xml
plugin.ModelViewer.HotkeyCall.xml
plugin.ModelViewer.Main.xml
plugin.ModelViewer.TimerCall.xml
setup.plugin.ModelViewer.xml

A 'Start Menu Shortcut' called 'X3 with Model Viewer' will created in your 'Start / Programs' menu,
(if you have installed to multiple X3 directories, this links to the last installation only).

X3 can be launched via the above start menu shortcut, or by just double clicking on the batch file
called X3_LaunchWithModelViewer.bat that was added to your X3 directory.
(or if you want, use a command line e.g. D:\Games\X3\Launcher.exe X3.exe, this is what's in the batch file).


FIRST USE:
Create a hotkey:
the hotkey command can be found in Controls / Interface, scroll down to 'Model Viewer', assign a key in the usual way.

The AL setting can be found in Gameplay / Artificial Life Settings, scroll down to 'Model Viewer',
this will turn on/off automatic viewer activation when docking at a shipyard.

IN-GAME INSTRUCTIONS:

When X3 is run this way a small black 'command box' appears, then the normal X3 start-screen appears,
when the 'Start X3' button is clicked there will be an (extra) 5 sec pause at the initial black screen,
as the viewer reads the game-file info.

This viewer can be turned on/off with a designated hotkey.
Pressing the hotkey with your ship in space, will cause either:
1 If there is no shipyard in sector, 'Scan negative' will be announced.
2 If there is a shipyard, 'Selected' will be announced, and the viewer's menu will appear, listing the ships available.
....if the hotkey is pressed again, 'Removed' will be announced & the menu dissapears.

When the menu is showing, the following keys are used to control the viewer
(help-text describing these, is shown on-screen at all times when the viewer is active):

The Space bar will toggle the fixed-window / full-screen mode
the below keys are all on the keyboard numpad (with NumLock on):
'-' move ship-selection menu-line up one ('previous')
'+' move ship-selection menu-line down one ('next')
'.' view the selected ship
'0' toggle weapon turret high-lighting on/off
'/' toggle jump-gate and astronaut models on/off

When a ship is selected for viewing ('.' key), there is a brief pause while the model is created, then the ship-preview window appears.
Selecting the viewer's menu line that has the text 'Empty selection' means the ship-preview window is closed (but not the menu).

If you dock at a shipyard (with the viewer off), then viewer menu will automatically appear,
& will be removed automatically when your ship is undocked.
(this feature can be turned off in the 'artificial life' game-setting options).

When weapons are 'highlighted', the turrets are cycled through, the current
turret's aim is shown as a blue line, all others are shown as green lines.
Also in this mode the weapon bodies are highlighted in red.

When both of the viewer's menu & ship preview windows are showing, you can still
bring up the shipyard's menu, there is no window overlap.
There is also no overlap with X3's monitor windows.




Warts'n'all:

Don't forget to enable the script editor!
- but be aware that this will stop you from having your game-stats in the new X3 v2.5 patch stats league tables.

If any of the above keys clash with your existing hotkey designations, then the viewer will still respond the
same to the key press, but your hotkey action will also happen.

If your PC is under significant stress with X3 running, the keypress response will be significantly reduced
- you may need to press more than once, or even hold the key down till it responds.

Currently, there are some minor-ish graphic glitches that can occasionally occur, depending on the orientation of your ship
(for some reason I can't think of). This may show as temporarily dimmed planets, or brightened UI button graphics.

Also shift-O (game options) seems to not work with the viewer active,
you need to turn the viewer off (e.g. with the hotkey) to access the options.

Finally : currently, you will probably want to remember to turn the viewer off, if it's on, (use hotkey) before quiting the game to the
main ES game-start/load menu, cos atm game-quit is not detected & so the viewer carries on rendering, obscuring some of the main menu.

The ship models are rendered at maximum detail (lod), but currently some minor texture problems exists, esp with some 'light textures'.


edit: updated setup script, so that multiple hotkeys no longer interfere with other commands (no change to anything else).
Last edited by exogenesis on Tue, 21. Oct 08, 01:24, edited 13 times in total.
Moonsinger
Posts: 49
Joined: Fri, 2. Dec 05, 19:08
x3

Post by Moonsinger »

Pictures and File are 404 on the url's :wink:
russbo
Posts: 862
Joined: Sat, 12. Nov 05, 21:53
x4

Post by russbo »

I get a Microsoft C++ runtime error when I try to launch X3, latest version, with Extended Mod installed, running on Vista.

Great idea though. Hope you can work out that bug. Maybe it's Vista??
User avatar
Malakie
Posts: 1061
Joined: Tue, 13. Apr 04, 23:08
x4

crash upon load

Post by Malakie »

I get a crash also on load. It never even makes it to the first X3 splash screen before the initial animation. Simply crashes to desktop..
exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis »

Moonsinger:
perhaps you hit a bad patch on the server?, pictures links seem OK for me.

russbo:
Must admit to not having tried it on Vista (yet), I did have a dual boot XP/Vista
(but last time I booted to Vista it destroyed my XP partition, so it got dumped).
Maybe it's time to go fully over to Vista now...

Malakie:
Are you also running under Vista?


Anyone had success so far ?

Could anyone who has a crash or problem say what mods they have
installed (if any) - it'll help me to find any causes, cheers.
DIGSIN
Posts: 538
Joined: Fri, 28. Oct 05, 12:37
x4

Post by DIGSIN »

Nice program exogenesis, cant get it to work though.

After reading the problems Vista users have had i have had a little play.

running Vista, i have changed the permissions on all the exe and dll which have come with this program. they have been given full permissions for all users, as this is one of the problems i had with cycrows GUI.

Running both a save game and also a new game, both with just the Egosoft stock game, no mods.

I am getting different messages come through, these are 'selected', 'removed' and 'scan negative' this is happening in Argon Prime, and even when i am within 1km of the shipyard.

I have also tried to run each script manually from the script editor.
exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis »

Hi DIGSIN,

thanks for having a look & for the Vista possible workround, although I'd be surprised if there were any permission probs,
since nothing is being written to registry or 'Windows\Program Files'.

Do you mean that the voice messages are continuous, even when you haven't pressed the hotkey?
Occasionally a hotkey press gives 'scan negative' in a sector with a shipyard, when it should say 'Selected', another press works OK.

Running the script manually is unlikely to help, cos what it does all depends on a global flag state array-var.

Could you see if you're getting anything in log52915.txt when you press the hotkey (not docked at shipyard)?

In Argon Prime (vanilla) it should be either :

viewer off:

0 active from timer
0 active from hotkey
OFF

or viewer on:

0 active from timer
1 active from hotkey
MENU
Argon Prime
1
Federal Argon Shipyard
12
112
0
1
2
3
4
5
118
6
7
8
107

thanks
exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis »

Updated to 1.2.0.1, just realized that ordinary mods
(i.e. not 'false cat' mods like XTM),
have blank lines in the ship menu for new ships - fixed.

Also fixed a minor turret indication problem.

No need to remove the older version, just reinstall over the top of it.
User avatar
galytest
Posts: 2
Joined: Tue, 18. Sep 07, 21:13

Post by galytest »

I also encountered a problem of C + +, but I was running on the XP, and not VISTA.

I need help, thank you.

[ external image ]
exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis »

That was posted at a good time, was just finished looking through the new
player game-statistics database when your post popped up :)

Can you tell me at what point the crash happened, was it as
soon as you tried to run X3, or while you were playing ?

Have you got any mods installed - if so could you give any details ?,
if you have any .cat files you that you have changed yourself,
it would be a great help if it is possible for you to upload to a server somewhere, so I can try it out here.

I assume you are running X3 in 'English', since there isn't a Chinese option ?
User avatar
Malakie
Posts: 1061
Joined: Tue, 13. Apr 04, 23:08
x4

Post by Malakie »

exogenesis wrote:Moonsinger:
perhaps you hit a bad patch on the server?, pictures links seem OK for me.

russbo:
Must admit to not having tried it on Vista (yet), I did have a dual boot XP/Vista
(but last time I booted to Vista it destroyed my XP partition, so it got dumped).
Maybe it's time to go fully over to Vista now...

Malakie:
Are you also running under Vista?


Anyone had success so far ?

Could anyone who has a crash or problem say what mods they have
installed (if any) - it'll help me to find any causes, cheers.


I am running Vista. I am also running XTM mod and other scripts..

However..... it crashes BEFORE I ever get to even the first splash screen of X3. So it never gets to a point where any scripts or mods would be loaded. Thus they cannot be at fault since the game is never loaded at all before it dies.

Malakie
Take it light.....

Malakie

----------------------------------------------------
User avatar
Ecthelion
Posts: 612
Joined: Mon, 15. Dec 03, 20:36
x4

Post by Ecthelion »

Version 1.0 worked fine for me, and I'm running XTM and dozens of other scripts.

I have noticed something rather strange though. I changed the AL setting for the Model Viewer to "off", and it the setting doesn't seem to "stick". Whenever I dock at a shipyard, the model viewer comes up, and when I look in the AL menu, the Model Viewer settings is on "on". I'll try the new version of the viewer to see if this issue is resolved.

Other than that small problem (and the annoyance at not being able to task-switch, regardless of whether the viewer is on or not), it's great. It's very cool to see a preview of a ship before you buy it. Some of us actually care what a ship looks like, not just whether it has good stats. This is a feature that I noticed the absence of way back in X3 1.0. Your mod, or a modification of it, should be included in a later patch (or X4).

Keep up the good work!
Windows Windows 7 Release Candidate (64-bit)
Intel Core 2 Duo E8400
ATI HD 4850 1024MB
8GB RAM

-----------------------------------------------------
Pirate Identification Guide
MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe »

well...at first i thought it was going to work...everything seem ok right up to the point where i activitated it in game...

it didn't crash, and it functioned, but look what it did to the graphics

[ external image ]

im running a comp with 3.2ghz intel dual core (not core 2 duo), windows xp sp2 +all updates - fully updated versions of all 3 netframeworks, the video card is an nvidia 8800 gtx, and i've got 2gigs of ram

it did that on opening...and the screen was taken after clossing....i also waited a few minutes to see if it would correct itself - then i pressed escape right right right right right....enter right right right enter (to make sure i could still quit out, and hoping that loading a new screen might fix it)...anyways the intro menu for x3 was also fubared

im gona guess cause this happened with me and other people are having problems that its a coding problem with the direct3d hook
exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis »

Malakie
However..... it crashes BEFORE I ever get to even the first splash screen of X3. So it never gets to a point where any scripts or mods would be loaded. Thus they cannot be at fault since the game is never loaded at all before it dies.
The modelviewer dll does read a significant part of the game files before the main ES X3 splash screen,
so the crash could be during the read-in, extra scripts shouldn't be a problem (mod .cat files created ad-hoc might be - this is to be seen)

Do you see a black-filled window before the ES splash window ?,
the run-up sequence should be:

1: Direct-X 'hooking' cmd box, for about 1 second
[ external image ]
2: usual X3 start window
[ external image ]
3: blank fullscreen, for about 5 seconds (dll is loading some game files)
[ external image ]
4: X3 splash screen, as normal from here
[ external image ]

I suspect it's possibly a Vista compatibility prob., although have you tried what DIGSIN suggested a couple of posts up ?


Ecthelion
Thanks for that :), I was beginning to have doubts.
The AL setting not-sticking isn't occurring here, could possibly be a script global-variable initialisation problem - I'll take a closer look.
I'll have a look at the 'task switch-away from X3' problem (although it doesn't always do anything bad), should be straightforward.


MJALowe

That 'black-out' only happens here under occasional conditions, did you try moving the ship orientation significantly to
see if it went away. If not then maybe it's something to do with the DX10 compat GPU, can't see what, since it's still using DX9c.

The 'blackout' seems to be rendering interaction (i.e. X3 & the viewer dll, I'm just rendering extra graphic 'on-top' of the X3 graphics),
in theory it shouldn't happen cos I'm saving the render-engine 'state' & restoring it after my overlay is done.
Your X3 menu screen being obscured is probably because my menu is still being rendered (i.e. turn it off with the hotkey before quiting your to the main X3 menu).

---------
Hopefully I'll be able to figure out these sort of glitches as we progress,
thanks for all your input, so far ....
MJALowe
Posts: 461
Joined: Fri, 5. Jan 07, 06:27
x3

Post by MJALowe »

:) I did...and im on dx9c on my system, also i flew around a bit...

having taken a closer look in game...by flying through that first gate you can barely make out...the only things still being rendered are the glow maps...viewer goes on and everything but glow goes off, view goes off and still only glow, changed sector...still just glow (this also means i can't see the hud or ingame menues except where part of them glows...like on the weapon selector)....exit to main menu....still just the glow (text isn't vissible but the glow from the background scene is there...and only the glow...still)

note: i was testing it with a vanilla copy of x3 patched to 2.0.0.2 without the bonuspacks and no mods/scripts

is it possible that my graphics settings could be messing it up... here is a screenie of that settings page

[ external image ]

[edit]and before you say anything about the resolution, thats my lcd monitors native res...and i stay about 30fps at all times, even when the ppcs start flying[\edit]

also i tried turning off fraps, steam, etc....even my virus scanner and fire wall(no, im not using a steam version of the game)

al pluggin not sticking - after changing to no did you also press enter? if not then thats why
exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis »

Your setting are just like mine, except you've got 2x as many pixels & 2x as much AA as I can muster on my ageing GF6800Ultra.

I think perhaps I'd go with GF8800 & the viewer dll code not being happy together.
Maybe there's some render engine state setting I'm not restoring properly that only shows up with DX10 compat GPUs?.
Let me see if I can fathom the blackout I occasionally get here, then I'll update (assuming I can fix it) & you could try that.....

EDIT: but please don't let that stop anyone else trying the current version out - I don't know how long it'll be before a new version appears.
Last edited by exogenesis on Wed, 26. Dec 07, 16:42, edited 1 time in total.
User avatar
galytest
Posts: 2
Joined: Tue, 18. Sep 07, 21:13

Post by galytest »

exogenesis wrote:Can you tell me at what point the crash happened, was it as soon as you tried to run X3, or while you were playing ?
It happened when i try to run X3
exogenesis wrote:Have you got any mods installed - if so could you give any details ?,
if you have any .cat files you that you have changed yourself,
it would be a great help if it is possible for you to upload to a server somewhere, so I can try it out here.

I assume you are running X3 in 'English', since there isn't a Chinese option ?
Just the XTM mod & Chinese patch
It should create a new .cat file,perhaps this is?
DIGSIN
Posts: 538
Joined: Fri, 28. Oct 05, 12:37
x4

Post by DIGSIN »

Sorry it's taken so long to get back to you, i had to reinstall Vista.

Good news, it is now working under Vista,
im not sure if it was a problem with my install, the amount of mods and scripts i had installed, or your new version has fixed the problem.

Should be a nice addition to the lucky people who have time to play.
User avatar
Malakie
Posts: 1061
Joined: Tue, 13. Apr 04, 23:08
x4

still no go but different symptom

Post by Malakie »

Hi,

Ok the latest version now loads X3 just fine. I set up the hotkey and when I press it, the game either crashes or it locks up.

I wonder something.. I use XTM as mentioned. But I ALSO have added 20 more ships to the game using Cycrows ship installer tool. Mainly Stargate SG1, the Battlestar Galactica and fighters from both those shows. Do you think that might be the problem when it tries to 'read' the ships in the shipyard?

Finally I also use Ashleys FABs mod which also includes a shipyard.

I have tried different shipyards also.
I would love to get this working but so far...


{EDIT/UPDATE}: I uninstalled it and reinstalled the latest version. First I then loaded a game that put me in Home of LIght. I hit the hotkey and it crashes. So I I loaded again, saved INSIDE the Argon Prime shipyard. Then loaded up. This time it loaded and showed me a list of ships. In that list there were 3 or 4 entries that were listed as READTEXT errors. After being able to see this list for about 10 seconds, the game crashed. I reloaded to the shipyard again. This time I scrolled the list immediately to a vanilla ship, Nova, in the shipyard. I hit the period key and the 3D view appeared. Then again, about 10 seconds in, the game crashed.

I am going to start a completely new game and see what happens.
Take it light.....

Malakie

----------------------------------------------------
exogenesis
Posts: 2718
Joined: Sun, 9. Sep 07, 15:39
x4

Post by exogenesis »

galytest
Interesting Chinese patch, excellent work there.
I've got the viewer working with your .cat file, but just a couple of minor
extra chars (I think) turning up - which I'm sorting out now.
The reason it didn't work first time was because I forgot to decode XML UTF-8 3-byte codes
(all other languages only need 1 or 2 byte code).

Does this look anything like right ? :
[ external image ]


DIGSIN

Great!, thanks for that, makes me feel a sight more confident about this & Vista :)


Malakie

I suspect you're right about the extra cat files, any way to upload your cat file somewhere?
If you are using Ashley's as a normal mod, and XTM as a 'fake' or 'false' mod, this implies you've
added your extra ships into one or the other, if your added ships are integrated into the XTM cat file
then upload is almost certainly a no-go cos of the size.

I'm using X3 2.5b + XTM + Ashley 2.3, so I dont think Ashley's cat file itself is a problem.

Any possibility of trying it on a temporary vanilla install to rule out any system conficts?,
oops, beaten to it by your edit. The ReadTexts are only for your 'manually' added ships?

Return to “X³: Reunion - Scripts and Modding”