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-09-10, 07:37 AM   #1
Dowly
CINC Pacific Fleet
 
Join Date: Apr 2005
Location: Finland
Posts: 23,477
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   #2
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   #3
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, 11:16 AM   #4
oscar19681
Admiral
 
Join Date: Jan 2004
Location: netherlands
Posts: 2,021
Downloads: 131
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
Reply

Thread Tools
Display Modes

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 10:58 AM.


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