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-08-10, 07:43 PM   #16
GermanGS
Sailor man
 
Join Date: Feb 2010
Location: New Jersey
Posts: 49
Downloads: 32
Uploads: 0
Default

Quote:
Originally Posted by Therion_Prime View Post
Ok, i found out how to load a sub into the goblin editor and display waypoints. Lots of stuff can be adjusted here:


You can barely see the chiefs waypoint on the white collision floor to the right. Now I have to figure out how to move it and how to add more waypoints.

Please describe the steps of how you done it
__________________
GermanGS is offline   Reply With Quote
Old 03-09-10, 01:17 AM   #17
GermanGS
Sailor man
 
Join Date: Feb 2010
Location: New Jersey
Posts: 49
Downloads: 32
Uploads: 0
Default

strategy CR_CHIEF_NORMAL(wp)
{
precond
{
!Wp:IsCrewState(DMG_TKN|PROX_EXPL|HUNTER|HUNTED) and !(Wp:IsTutorial() and !Wp:IsBunkerState())
}
action
{
Wp:SetBodyPartVisibility("D_Torso01", 0);
Wp:SetBodyPartVisibility("D_Pants01", 0);
Wp:SetBodyPartVisibility("B_Torso03", 1);
Wp:SetBodyPartVisibility("B_Pants03", 1);
Wp:SetBodyPartVisibility("D_Hat02", 1);

if Wp:IsCurrentWaypoint( "CR_CHIEF" ) then
{
Wp:PlayAnimationAndWait( "CR_CHIEF_Idle01" );
Wp:PlayAnimationAndWait( "CR_CHIEF_Talk2HA_01" );
Wp:PlayAnimationAndWait( "CR_CHIEF_Idle02" );
Wp:PlayAnimationAndWait( "CR_CHIEF_Talk2HELM_01" );
Wp:PlayAnimationAndWait( "CR_CHIEF_Idle01" );
Wp:PlayAnimationAndWait( "CR_CHIEF_Talk_VALVE01" );
Wp:PlayAnimationAndWait( "CR_CHIEF_Idle01" );
Wp:Goto("CR_CHIEF_MAP");
}
endif;
if Wp:IsCurrentWaypoint( "CR_CHIEF_MAP" ) then
{
Wp:PlayAnimationAndWait( "CR_CHIEF_MAP_Idle01" );
Wp:PlayAnimationAndWait( "CR_CHIEF_MAP_Idle02" );
Wp:PlayAnimationAndWait( "CR_CHIEF_MAP_Idle03" );
Wp:Goto("CR_LADDER");
}
endif;
if Wp:IsCurrentWaypoint( "CR_LADDER" );

Wp:IsCurrentWaypoint( "SAILOR01_Wait_near_ladder" );
{
Wp:Goto( "CT_ATTAK" );
}
endif;
if Wp:IsCurrentWaypoint( "CT_ATTAK" );
{
Wp:PlayAnimationAndWait( "CT_ATTAK_Idle01" );
Wp:Goto( "CT_STAIRS" );
}
endif;
if Wp:IsCurrentWaypoint( "CT_STAIRS" );
{
Wp:Goto( "CR_CHIEF" );
}
Wp:ScriptCompleted();
}
}



What Am i doing wrong here that the game CTD???

Can anyone figure out???
__________________
GermanGS is offline   Reply With Quote
Old 03-09-10, 03:42 AM   #18
Therion_Prime
Helmsman
 
Join Date: Apr 2005
Posts: 105
Downloads: 27
Uploads: 0
Default

Quote:
Originally Posted by GermanGS View Post
if Wp:IsCurrentWaypoint( "CR_LADDER" );

Wp:IsCurrentWaypoint( "SAILOR01_Wait_near_ladder" );
1) You forgot a "then"
2) Replace Wp:IsCurrentWaypint with Wp:PlayAnimationAndWait
Therion_Prime is offline   Reply With Quote
Old 03-09-10, 07:14 AM   #19
oscar19681
Admiral
 
Join Date: Jan 2004
Location: netherlands
Posts: 2,020
Downloads: 119
Uploads: 0
Default

Quote:
Originally Posted by Dowly View Post
Thanks a ton! Very good info!

Say, have you looked into adding more waypoints? I was thinking if it would be possible with the IsBunkerState and some new waypoints have the crew standing on the deck of the uboat when it's in the bunker.

Or even better by adding new waypoints and (if possible) new state that is triggered by the player pressing a certain button have the crew standing on deck. Would be AWESOME to slowly sail through the harbor, returning from a long patrol with the crew standing on deck.
If you will be able to do this! Then you may have my girlfriend (she,s worth is)
__________________
we live we die but death does not ends it.

Jim Morrison 1943-1971
oscar19681 is offline   Reply With Quote
Old 03-09-10, 07:37 AM   #20
Dowly
Lucky Jack
 
Join Date: Apr 2005
Location: Finland
Posts: 25,005
Downloads: 32
Uploads: 0


Default

Quote:
Originally Posted by oscar19681 View Post
If you will be able to do this! Then you may have my girlfriend (she,s worth is)
Haha!

I think Heretic will be the first to do this. I'm in middle of 1xTC patrol and will not start looking into files before I've finished that.
Dowly is offline   Reply With Quote
Old 03-09-10, 12:47 PM   #21
kapitan_zur_see
Commodore
 
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
Default

this thread is of top interest!
I can't thank you enough for sharing your knowledge, Heretic
Hell I could kiss you...


Hey, point that torpedo somewhere else!!
__________________

kapitan_zur_see is offline   Reply With Quote
Old 03-09-10, 01:43 PM   #22
Heretic
Commodore
 
Join Date: Mar 2005
Location: Nebraska
Posts: 617
Downloads: 240
Uploads: 2


Default

Moving people around

Wp:Teleport("waypoint"); Instantly teleports actor to the waypoint
Wp:Goto("waypoint"); actor walks to the waypoint.

If the waypoint you're trying to reach is in another room, the actor will reach the transition waypoint, go into the crucifiction pose (default unanimated postion), and teleport to the transition waypoint in the next room. Looks goofy. It's better to take control and only goto the transition waypoint, then teleport to the next room and continue from there.

Example: I want the WO to move from the control room ladder (CR_Stairs) back to his regular position in the fore quarters.

Rather than doing this:
Quote:
Wp:Goto("QRF_Watch");
It looks better to do this:
Quote:
Wp:Goto("CR_WP08_DOOR");
Wp:Teleport("RR_WP01_DOOR");
Wp:Goto("QRF_Watch");
CR_WP08_DOOR is the waypoint in the control room next to the foreward hatch. RR_WP01_DOOR is the waypoint on the other side of the hatch. Ideally we'd perform an animation there to have him duck thru the hatch, but we don't have one that'll work.

Generally, when you want to move people around, it's best to find out where they are first. You don't want to trigger your new sequence if he's already there, right? Wp:IsCurrentWaypoint("waypoint") will tell you that.

For the example above, we'd only want the WO to walk from the ladder if that's where he's currently located, so we put our move logic into an if statement conditioned off his current waypoint. If he's not at CR_STAIRS, it won't be executed. I've highlighted the syntax.

Quote:
if Wp:IsCurrentWaypoint("CR_STAIRS") then
{
Wp:Goto("CR_WP08_DOOR");
Wp:Teleport("RR_WP01_DOOR");
Wp:Goto("QRF_Watch");
}
endif;

It's sometimes preferable to use 'not' logic on that check. Suppose I want to send the WO to waypoint WT_CR02 on the bridge when surfaced. I don't care where he's currently at, if he's not on the bridge. An exclamation point in front of the check reverses the logic. So !Wp:IsCurrentWaypoint("waypoint") means not at that waypoint. If he's aready there, we'll add an else condition and have him perform the appropriate animation.

Quote:
if !Wp:IsCurrentWaypoint("WT_CR02") then
{
Wp:Teleport("WT_CR02");
}
else
{
Wp:PlayAnimationAndWait( "WT_CR02_Contact01_7A" ); <--- this is the 'mad pointer' animation, btw
}
endif;
The if check is also where you should perform any uniform changes and whatnot. Let's give him binoculars and since his default torso already show binoculars around his neck, we'll swap his torso for a similar one without them. When we bring him back, we'll have to remember to swap them back.
Quote:
if !Wp:IsCurrentWaypoint("WT_CR02") then
{
Wp:Teleport("WT_CR02");
Wp:SetBodyPartVisibility("object1_Binocular", 1);
Wp:SetBodyPartVisibility("D_Torso03", 0);
Wp:SetBodyPartVisibility("D_Torso01", 1);
}
else
{
Wp:PlayAnimationAndWait( "WT_CR02_Contact01_7A" );
}
endif;

Last edited by Heretic; 03-09-10 at 02:45 PM.
Heretic is offline   Reply With Quote
Old 03-10-10, 04:09 AM   #23
LukeFF
Silent Hunter
 
Join Date: Apr 2005
Location: Riverside, California
Posts: 3,610
Downloads: 41
Uploads: 5
Default

Quote:
Originally Posted by Therion_Prime View Post


Notice: Deck gun and flak loader 1 and 2
Very interesting. I'd definitely like to see more deck gun and flack gun crewmen on deck.
__________________


ROW Sound Effects Contributor
RFB Team Leader
LukeFF is offline   Reply With Quote
Old 03-10-10, 05:40 AM   #24
JotDora
Sailor man
 
Join Date: Feb 2010
Location: Germany
Posts: 43
Downloads: 26
Uploads: 0
Default

Thanks for patiently updating this thread. Im reading all your statements very carefully, to build up know-how.

I'm a programmer (leading a team of programmers) so scripting should not be a problem.

Thanks again for your time and for sharing your knowledge!

Greetings from germany

JotDora
JotDora is offline   Reply With Quote
Old 03-10-10, 06:37 AM   #25
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default

please keep us informed! this topic is very, very promising!

__________________


urfisch is offline   Reply With Quote
Old 03-10-10, 11:16 AM   #26
oscar19681
Admiral
 
Join Date: Jan 2004
Location: netherlands
Posts: 2,020
Downloads: 119
Uploads: 0
Default

Quote:
Originally Posted by Dowly View Post
Haha!

I think Heretic will be the first to do this. I'm in middle of 1xTC patrol and will not start looking into files before I've finished that.
See ya in 5 months then.
__________________
we live we die but death does not ends it.

Jim Morrison 1943-1971
oscar19681 is offline   Reply With Quote
Old 03-10-10, 12:51 PM   #27
Therion_Prime
Helmsman
 
Join Date: Apr 2005
Posts: 105
Downloads: 27
Uploads: 0
Default

Quote:
Originally Posted by GermanGS View Post
Please describe the steps of how you done it
Just open the main submarine *.gr2 with the goblin editor and it will load all "child" gr2s automatically. i.e. ..\SH5\data\Submarine\NSS_Uboat7a\NSS_Uboat7a.GR2
Therion_Prime is offline   Reply With Quote
Old 03-11-10, 09:27 AM   #28
kapitan_zur_see
Commodore
 
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
Default

How do you make it to show the result of a script editing without having to restart the entire game from desktop to loading a patrol?

I can't make the game to sort of "reload" my saved script whilst staying ingame? I tried with the AI debugger script editor using the "reload script" function, but no luck, except it messes the AI debugger itself and end up showing CR_NAV_IDLE in the CR_HF tree and causing CTD.

Do you always have to start all the game through to take a new script in effect? painfull!!!
__________________


Last edited by kapitan_zur_see; 03-11-10 at 10:51 AM.
kapitan_zur_see is offline   Reply With Quote
Old 03-11-10, 10:13 AM   #29
Heretic
Commodore
 
Join Date: Mar 2005
Location: Nebraska
Posts: 617
Downloads: 240
Uploads: 2


Default

I've always restarted between changes. Takes a while, but I guess I have a high tolerance for such things. I looked through the script editor but couldn't see anything that looked like it applied to Crew AI. Looks like you've found some way to at least view it? I'd be very interested in learning that. Perhaps I'd be able to find more functions.
Heretic is offline   Reply With Quote
Old 03-11-10, 10:59 AM   #30
kapitan_zur_see
Commodore
 
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
Default

Quote:
Originally Posted by Heretic View Post
I've always restarted between changes. Takes a while, but I guess I have a high tolerance for such things. I looked through the script editor but couldn't see anything that looked like it applied to Crew AI. Looks like you've found some way to at least view it? I'd be very interested in learning that. Perhaps I'd be able to find more functions.
Simply open ingame the AI script debugger, not the script manager, using windows taskbar. select "crew" in the first menu called "select unit type", then in the "select unit" one, scroll down to "CR_HF" for example. But it doesn't show much if anything at all.

I'm stuck trying to find a way editing anims in gmax or 3dsmax though. And that goblin editor is nothing but a controller parameters editor, you can't move objects, can't add waypoints and most importantly, you can't ADD controllers also! more of a viewer than anything else... A tweaker, shall we say. It looks powerfull at first sight, but it's very restrictive
__________________

kapitan_zur_see 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 04:49 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.