SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-12-10, 01:15 AM   #1
maerean_m
Captain
 
Join Date: Mar 2007
Location: Bucharest, Romania
Posts: 529
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Racerboy View Post
Is there a way to get the goblin editor to give you the x,y,z coodinates of a position on a loaded 3D model? Like below, I loaded up the VIIa sub and I'm trying to get the coordinates of the center of the exhaust port. I move my mouse over the exhaust port but don't see any coordinates showing anywhere.
picture of GoblinEditor
Handling 3D coordinates by hand is a very bad practice. The correct way is to have a dummy 3D object (and maybe attach controllers to it).
__________________
Kilroy was here
maerean_m is offline   Reply With Quote
Old 03-12-10, 01:16 AM   #2
maerean_m
Captain
 
Join Date: Mar 2007
Location: Bucharest, Romania
Posts: 529
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith
Quote:
Originally Posted by maerean_m
Quote:
Originally Posted by TheDarkWraith
ah, so trying to add them to the UZO won't work because of the restriction right? got it. So by importing them into the UZO or periscope they will work? Do I understand this correctly?
See here
thanks. I'm trying to import them into the UZO currently but it's not working. Throwing some 'debug code' (ala MessageBox.Show()) to see if the functions to show the TDC page are getting called or not.
Use ScriptManagerManaged.ShowPythonError("") instead of MessageBox.Show()
__________________
Kilroy was here
maerean_m is offline   Reply With Quote
Old 03-13-10, 06:18 PM   #3
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

@maerean_m, is there a way to have completely 'new' .py scripts to autoload when the game starts, without the need to hook into a stock .py file and calling "MakeSureIsLoaded( MenuPageWrapper.InitializeScript.Now )" (I have made a blank/empty Page in menu editor). I have completely isolated functionality and would like to be able to install my mod without overwriting a stock file (which could potentially conflict with other mods).
skwasjer is offline   Reply With Quote
Old 03-13-10, 07:12 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by skwasjer View Post
@maerean_m, is there a way to have completely 'new' .py scripts to autoload when the game starts, without the need to hook into a stock .py file and calling "MakeSureIsLoaded( MenuPageWrapper.InitializeScript.Now )" (I have made a blank/empty Page in menu editor). I have completely isolated functionality and would like to be able to install my mod without overwriting a stock file (which could potentially conflict with other mods).
import it. In the Page Default Hud.py file add a line in InitializeScript:

from xxx import xxx
where xxx = name of page (i.e. Pageobsperiscope).
Oh you're probably wanting to have the game automatically import a new Page without having to use import huh?
TheDarkWraith is offline   Reply With Quote
Old 03-13-10, 07:45 PM   #5
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Ya

I really don't want to distribute a new Page Default Hud.py file for just one new line, when all of my code is in a seperate .py file and a DLL

Currently I hooked via Page Background.py which is empty. But still, others may want to do so too, and then there's the drama of merging scripts. Being able to just dump a file in a folder and have it's initializer called would be alot easier for us...


[edit] Oh and import doesn't do the same thing as my little script above, I also need to invoke the script to run (at least, it doesn't work without it). Yea, I want an autoload folder of some sorts...

Currently my Page background.py file only does this... note, this is only to run the entire script in another file 'MyModule.py'. The target script does nothing UI related...

Code:
from MyModule import MyModule
 
def InitializeScript():
 MyModule.MakeSureIsLoaded( MenuPageWrapper.InitializeScript.Now )
 
def StartGame():
 pass
 
def EndGame():
 pass
 
def UnloadScript():
 pass
Really wish this wouldn't be necessary...

Last edited by skwasjer; 03-13-10 at 08:00 PM.
skwasjer is offline   Reply With Quote
Old 03-12-10, 01:27 AM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by maerean_m View Post
Handling 3D coordinates by hand is a very bad practice. The correct way is to have a dummy 3D object (and maybe attach controllers to it).
The reason I was looking for the 3D coords is to attach a FastParticleGen controller to that exact location (sub exhaust).
explain what you mean by a dummy 3D object. I've seen these before in SH3/4 but never really understood what they were for.
TheDarkWraith is offline   Reply With Quote
Old 03-12-10, 01:54 AM   #7
maerean_m
Captain
 
Join Date: Mar 2007
Location: Bucharest, Romania
Posts: 529
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith
Quote:
Originally Posted by maerean_m
You haven't created the Page TDC.py . That file translates in the module the error is talking about.

And yes, there is a glitch in the Matrix. The script for menu pages are initialized when they are made visible for the first time. So you won't catch the first PageActivated. The solution is to call Menu_PageActivated( PageUZO ) as the last line in InitializeScript.
thanks maerean_m. I got it working now! I hadn't created a Page TDC.py like you said. Now how do I give the imported page a higher Z order priority (I want it on top of everything in the page that imported it)? Since I imported it does it fall under the hierarchy of the page that imported it (i.e. Page UZO imports Page TDC...does heirarchy look like this: PageUZO_PageTDC_XXXX?
The import keyword in python only imports the Globals from that script into your script so you can call those globals by their name. It has nothing to do with anything else.

The Z order is the one from the tree you see in the menu editor. If you want to bring a page closer to the player, drag it down in that tree. The Z order is saved in data\Menu\Pages\menu_1024_768.ini (so you include that file too in your mod).

The menu items also have methods for the z-order: MakeSureIsBehindOfZOrder, MakeSureInFrontOfZOrder, SendToBackZOrder and BringToFrontZOrder. BringToFrontZOrder must NOT be used on menu pages (will cause BIG bugs).

Mihai
__________________
Kilroy was here
maerean_m is offline   Reply With Quote
Old 03-12-10, 01:59 AM   #8
maerean_m
Captain
 
Join Date: Mar 2007
Location: Bucharest, Romania
Posts: 529
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Racerboy View Post
The reason I was looking for the 3D coords is to attach a FastParticleGen controller to that exact location (sub exhaust).
explain what you mean by a dummy 3D object. I've seen these before in SH3/4 but never really understood what they were for.
A dummy is a 3D object with no geometry that's used for exactly that: to indicate a position in space. The very good part is that the object is placed using 3D Studio Max by using very friendly tools (you drag an object with your mouse). If you were a 3D modeler, you would hate to have to work with 3D coordinates by hand (each being made of 3 numbers with 7 decimals).

For you, it means you need to find an already existing dummy object on sub's hierarchy (there are plenty of those) and attach your controller to it.
__________________
Kilroy was here
maerean_m is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.