View Full Version : [TEC] Crew Scripting
Heretic
03-06-10, 09:17 PM
The crewmen are referenced by the waypoint they are initially assigned to. Waypoints are prefixed by the compartment.
CR - Control Room
CT - Conning Tower
DER - Diesel Engine Room
QRF - Forward Quarters
RR - Radio Room, part of QRF
SQ - Stern Quarters
TRA - Aft Torpedo Room
TRF - Forward Torpedo Room
WP - Weapon?
WT - Watch Tower
The waypoints for the Control Room are:
CR_CHIEF - Chief starts here so he is CR_CHIEF
CR_CHIEF_MAP
CR_HA - Aft Hydroplane operator
CR_HELM - Helmsman
CR_HF - Fore Hydroplane
CR_LADDER - halfway up the ladder
CR_NAV - Navigator
CR_SO_01 - Second officer
CR_SO_MAP01
CR_SO_MAP01
CR_SO_PER
CR_STAIRS - foot of the ladder
CR_VALVE - Ballast tank operator
etc...
These are the Crewmen we currently have to work with:
CR_CHIEF - Chief Engineer
CR_HA - Aft Hydroplane Operator
CR_HELM - Helmsman
CR_HF - Fore Hydroplane Operator
CR_NAV - Navigator
CR_SO_01 - Second Officer
CR_VALVE - Ballast Tank Operator
DER_DE_CPO - Engine Room Chief
DER_DE_PORT01 - Port Diesel Operator
DER_DE_STB01_A - Starboard Diesel Operator
QRF_Petty_01 - Petty Officer 01
QRF_Petty_02 - Petty Officer 02
QRF_WATCH - Watch Officer
RR_HIDRO - Hydrophone Operator
RR_RADIO_A - Radio Operator
SQ_BED01 - Crewman in Bunk 01
SQ_BED02 - Crewman in Bunk 02
SQ_BED03 - Crewman in Bunk 03
SQ_BED04 - Crewman in Bunk 04
SQ_BOSUN_A - Bosun
SQ_COOK_A - Cook
TRA_EE_PORT01_A - Port Motor Operator 01
TRA_EE_PORT02 - Pot Motor Operator 02
TRA_EE_STB02 - Starboard Motor Operator
TRA_LOAD01 - Aft Torpedo Crewman
TRF_LOAD01 - Forward Torpedo Crewman 01
TRF_LOAD03 - Forward Torpedo Crewman 02
TRF_LOAD05 - Forward Torpedo Crewman 03
The animations are designed to work from specific waypoints. They are prefixed with that compartment and waypoint. So "CR_CHIEF_Idle01" is set up to work on a character in waypoint CR_CHIEF. It doesn't have to be the Chief and is doesn't have to be used only in that waypoint. Things might not line up, you may get clipping, etc, if you use it somewhere else. The animations are in data\Characters\Animations.
Heretic
03-06-10, 09:23 PM
Scripting commands
The script files are text files with an aix suffix in data\scripts\AI\crew. they can be edited using any text editor. You define 'strategies' that the crewmen will perform when the circumstances you define for them are met. So, you can have different behaviors when surfaced or submerged, etc. I've mostly dealt with the idle strategies, so that's what I'll describe. You can also set up strategies for use with commands.
Here are the functions I've identified
Wp:GetCurrentlyLoadingTube()
Wp:GetGlobalVariable(variable)
Wp:IsBunkerState()
Wp:IsCharacterPosture(val) A,B,C,D,E (don't know what the postures are)
Wp:IsConningTower("tower")
Wp:IsCrewState(val) DMG_TKN, HUNTER, HUNTED, PROX_EXPL, T_FIRED, T_TRAVEL, T_HIT, T_MISS, SIL_RUN, B_STATIONS - B_STATIONS doesn't appear to work
Wp:IsCurrentWaypoint("waypoint")
Wp:IsGunManned(slot)
Wp:IsSubmerged()
Wp:IsSurfaced()
Wp:IsTorpedoLoadingInProgress()
Wp:IsTutorial()
Wp:BindAvatarCameraToObject("object", var)
Wp:DeactivateCrewState(val)
Wp:DoNothing()
Wp:ExecuteCommand
Wp:GetDistanceToAvatar()
Wp:GetGunType(slot)
Wp:GetHydrophoneState()
Wp:GetRadarState()
Wp:Goto("waypoint")
Wp:LoadTorpedo("animation", val)
Wp:ManTheGun(slot, "text", role) - ROLE_GUNNER, ROLE_TRAV, ROLE_ELEV
Wp:PlayAnimation("animation")
Wp:PlayAnimationAndWait("animation")
Wp:PlayAttenuatedSoundWithLipsync("file", delay);
Wp:PlaySoundWithLipsync("file", delay);
Wp:ScriptCompleted();
Wp:SetBodyPartVisibility(part, 0/1) VERY nice. Can change and add parts
Wp:SetGlobalVariable(variable, value)
Wp:SetNonInteractive()
Wp:Teleport("waypoint")
Wp:UnbindAvatarCamera(1)
Wp:UnmanTheGun(slot, role)
Heretic
03-06-10, 09:24 PM
So here's an example using the Chief. His idles entry are defined in the submarine files
strategy CR_CHIEF_IDLE01(wp)
{
strategies Define the strategies
{
CR_CHIEF_TUTORIAL,
CR_CHIEF_NORMAL,
CR_CHIEF_DAMAGE_TAKEN,
CR_CHIEF_PROXIMITY_EXPLOSIONS,
CR_CHIEF_HUNT
}
}
Now here's his NORMAL strategy. The precond statement tells under what conditions this strategy will be used. This one is when the CrewState is not ("!" means not) DMG_TKN, PROX_EXPL, HUNTER, or HUNTED and it's not both the Tutorial and not in the bunker
strategy CR_CHIEF_NORMAL(wp)
{
precond
{
!Wp:IsCrewState(DMG_TKN|PROX_EXPL|HUNTER|HUNTED) and !(Wp:IsTutorial() and !Wp:IsBunkerState())
}
action
{
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_CHIEF");
}
endif;
Wp:ScriptCompleted(); <---- IMPORTANT
}
}
So if he's currently at waypoint "CR_CHIEF", he'll perform a series of animations, then move to "CR_CHIEF_MAP". If he's at the "CR_CHIEF_MAP", he'll do a different set and move back to "CR_CHIEF". Browse through the files and it's pretty easy to figure out what's going on and the potential of this.
Heretic
03-08-10, 11:45 AM
Here's some simple examples using the function Wp:SetBodyPartVisibility().
syntax is Wp:SetBodyPartVisibility("object", 1 or 0); 1 for on, 0 for off. Objects are defined in the body parts file in Characters folder.
Crewmen are made up of Head, Left Eye, Right Eye, Torso, and Pants. Optionally they can have a Hat and an Object. They start out as defined in the CHR files, be can all be changed with this function.
Add binoculars to a crewman.
Wp:SetBodyPartVisibility("object1_Binocular", 1);
Adding a hat. Not all hats work on all heads. Some of the larger heads will show through the hat.
Wp:SetBodyPartVisibility("A_Hat01", 1);
Changing a uniform. Important to remove the old one or both will be displayed.
Wp:SetBodyPartVisibility("D_Torso05", 1); <-- adds Torso05
Wp:SetBodyPartVisibility("D_Torso01", 0); <-- Removes Torso01
Adding a beard.
Wp:SetBodyPartVisibility("object1_Barba_CAP13", 1);
Changing a head. It's best to also use the proper eyes. It's not required, but they might not line up right otherwise.
Wp:SetBodyPartVisibility("B_Head03", 0);
Wp:SetBodyPartVisibility("B_EyeL03", 0);
Wp:SetBodyPartVisibility("B_EyeR03", 0);
Wp:SetBodyPartVisibility("D_Head10", 1);
Wp:SetBodyPartVisibility("D_EyeL10", 1);
Wp:SetBodyPartVisibility("D_EyeR10", 1);
The stock scripts use this function to convert the XO into the Captain for the tutorial. Whenever you see someone with something in their hand, a book, knife, screwdriver, whatever, it's done with this function.
urfisch
03-08-10, 11:50 AM
:o
:yeah:
definitely a sticky...
thanks a lot!!
Thanks a ton! Very good info! :rock:
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. :hmmm:
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.
Heretic
03-08-10, 12:27 PM
Thanks a ton! Very good info! :rock:
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. :hmmm:
As near as I can tell, waypoints are added with the Goblin Editor. They are associated with the submarine and bunker files. The problem with that is your scripts cease to be generic and have to be included with whatever sub mod added the waypoints. Assuming, I understand it correctly of course. To get a good deck gun crew and guys standing on the deck in the bunker, it'll be worth it. But once we start seeing submarine mods, compatibiltiy will become a real issue.
Therion_Prime
03-08-10, 12:49 PM
Heres a list with all waypoints of the 7a:
http://img31.imageshack.us/img31/7046/waypoints.jpg
Therion_Prime
03-08-10, 12:59 PM
EDIT: SOLVED! Set Actors directory in the GoblinEditors options to SH5 root folder.
Hmm, I get an error message when opening a waypoint gr2 file in the goblin editor:
http://img242.imageshack.us/img242/7493/errorvc.jpg
I hope this is not a showstopper. :-?
Therion_Prime
03-08-10, 01:12 PM
Availiable jobs in GoblinEd:
http://img532.imageshack.us/img532/8739/jobsb.jpg
Notice: Deck gun and flak loader 1 and 2
Heretic
03-08-10, 01:44 PM
Nice! I'm not sure what effect the jobs has. I noticed a lot of them are set incorrectly.
I really need to make a map using a uboat layout with all the waypoints marked.
Therion_Prime
03-08-10, 01:53 PM
Ok, i found out how to load a sub into the goblin editor and display waypoints. Lots of stuff can be adjusted here:
http://img709.imageshack.us/img709/7528/wpchief.jpg
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.
Heretic
03-08-10, 01:54 PM
Manning Guns
To assign a crewman to a gun, you first must move him the appropriate waypoint. The easiest way is to use Teleport().
Wp:Teleport("WP_A01_GUN"); This is the AA mount
Then you need to man the gun using ManTheGun() using the appropriate slot, animation and role
Wp:ManTheGun(SLOT_A01, "20mm_C38_shield_twin_UP_DW", ROLE_GUNNER)
Some guns have one slot, some have more. The deck gun only has two slots which limits what we can do to add more crew. There are workarounds, but I have found one yet that works well enough.
Heretic
03-08-10, 01:57 PM
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.
Cool stuff huh? I've gotten that far but never figured out how to change anything but the crew parts. That was before I figured out I could change them with scripts.
Be careful moving waypoints. The animations are built for them. If you move them, you may throw off an animation and have guys walking through walls or something.
GermanGS
03-08-10, 07:42 PM
thanx this is def were ill spend my time
GermanGS
03-08-10, 07:43 PM
Ok, i found out how to load a sub into the goblin editor and display waypoints. Lots of stuff can be adjusted here:
http://img709.imageshack.us/img709/7528/wpchief.jpg
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
03-09-10, 01:17 AM
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???
Therion_Prime
03-09-10, 03:42 AM
if Wp:IsCurrentWaypoint( "CR_LADDER" );
Wp:IsCurrentWaypoint( "SAILOR01_Wait_near_ladder" );
1) You forgot a "then"
2) Replace Wp:IsCurrentWaypint with Wp:PlayAnimationAndWait
oscar19681
03-09-10, 07:14 AM
Thanks a ton! Very good info! :rock:
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. :hmmm:
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)
If you will be able to do this! Then you may have my girlfriend (she,s worth is)
Haha! :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. :03:
kapitan_zur_see
03-09-10, 12:47 PM
this thread is of top interest!
I can't thank you enough for sharing your knowledge, Heretic :know:
Hell I could kiss you...
Hey, point that torpedo somewhere else!! :stare:
Heretic
03-09-10, 01:43 PM
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:
Wp:Goto("QRF_Watch");
It looks better to do this:
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.
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.
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.
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;
http://img532.imageshack.us/img532/8739/jobsb.jpg
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.
JotDora
03-10-10, 05:40 AM
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
urfisch
03-10-10, 06:37 AM
please keep us informed! this topic is very, very promising!
:yeah:
oscar19681
03-10-10, 11:16 AM
Haha! :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. :03:
See ya in 5 months then.
Therion_Prime
03-10-10, 12:51 PM
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
kapitan_zur_see
03-11-10, 09:27 AM
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!!!
Heretic
03-11-10, 10:13 AM
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.
kapitan_zur_see
03-11-10, 10:59 AM
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
Heretic
03-12-10, 11:07 AM
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.
Thanks! I don't know if it's of any use as a real-time script tweaker, seems to always crash. But it's a great debugger because it shows the values in the variables. Very handy.
piri_reis
03-12-10, 11:34 AM
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
Using GE, I haven't found a way to move points or play around with the meshes.. But you can definitely add controllers. The easiest being the free camera optics. Done it myself.
Some Modders are sure to be using this to add/modify controllers, as we speak .
GermanGS
03-12-10, 02:39 PM
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
Thanks Alot it really helps to see were i want the crew to go to.
Heretic
03-22-10, 01:17 PM
Working with sound files
Wp:PlayAttenuatedSoundWithLipsync("file", delay);
Wp:PlaySoundWithLipsync("file", delay);
These two functions work the same, with PlaySoundWithLipsync having the same volume regardless of distance, and PlayAttenuatedSoundWithLipsync having the volume fade over distance.
You can play any ogg file with these functions. I haven't tried mp3 but wav files definitely don't work. The "file" component is the path name within the speech folder followed by the file name without the extension. The delay variable tells how long, in seconds, to delay before playing the sound, so you can sync it up with a movement, tie multiple sounds together etc.
Wp:PlayAttenuatedSoundWithLipsync("ChiefEngineer\Normal\MC_CR_CHIEF_53", 15.0); # "fore planes"
Wp:PlayAttenuatedSoundWithLipsync("ChiefEngineer\Normal\MC_CR_CHIEF_140", 16.4); # "eight"
Wp:PlayAttenuatedSoundWithLipsync("ChiefEngineer\Normal\MC_CR_CHIEF_55", 17.2); # "degrees down"
Note that the delay is from the first command. Each character can only be playing one sound at a time, it you set the delay too low, and the previous sound isn't finished, the sound won't play. The German and English speech files are not exactly the same length, so you should test with both to make sure it works ok in both versions.
You can't play any of the sounds other than those in the speech folder. There's ways around that though. Just copy the sound you want, convert it to an ogg, then put it in the speech folder.
I used the helmsman to 'speak' the dive alarm bell when the dive command is given. I used the non-attenuated version, so the sound isn't localized. I copied the Submarine Bell.wav file from the sounds folder, used an audio editor to loop it three times so it'd play longer, then saved it as an ogg. Note, you can't have spaces in the file name.
Wp:PlaySoundWithLipsync("MFCM\Submarine_Bell", 0.0);
Heretic
03-22-10, 01:29 PM
Using Global Variables.
Wp:SetGlobalVariable(variable, value)
Wp:GetGlobalVariable(variable)
Sometimes it's useful to use a variable to control things in your script. The tutorial strategies use this to control things. The interaction between the cook and bosun are also controlled by variables. Variable values are stored with the save game.
You add a new variable to file init.aix. Increment the index by one for each variable you add. These variables are single digit only 0-9. I haven't tried letters.
VAR_SQ_BOSUN_STATE = 13;
VAR_CR_NAV_STATE = 14;
VAR_CR_CHIEF_STATE = 15;
VAR_CR_SO_STATE = 16;
VAR_CR_SO_KILL_COOK_TRIGGER = 17; <-- here's our new entry
To set the variable:
Wp:SetGlobalVariable(VAR_CR_SO_KILL_COOK_TRIGGER, 1);
To check the variable:
if Wp:GetGlobalVariable(VAR_CR_SO_KILL_COOK_TRIGGER) == 1
{
Wp:PlayAnimationAndWait( "Use_Machete_on_Cook" );
}
endif;
KarlSteiner
04-01-10, 09:39 AM
Hi Heretic,
thanks to your geat work and information about the Crew-animations e.t.c..:up::up::up:
We in Germany say: SH5 is a banana-product. It ripes under at the clients.
Thanks to you the banana grows riper!
Best regards
Karl :rock:
My poor work for SH3:
http://forums-de.ubi.com/eve/forums/a/tpc/f/2371008762/...431054756#9431054756 (http://forums-de.ubi.com/eve/forums/a/tpc/f/2371008762/m/9831054534?r=9431054756#9431054756)
http://forums.ubi.com/eve/forums/a/tpc/f/857101043/m/6011016756?r=6011016756#6011016756
THE_MASK
06-13-12, 01:21 AM
Ok, i found out how to load a sub into the goblin editor and display waypoints. Lots of stuff can be adjusted here:
http://img709.imageshack.us/img709/7528/wpchief.jpg
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.anyone know how i get the dropdown box to work with windows 7 ? It just flickers .
TheDarkWraith
06-13-12, 06:15 AM
anyone know how i get the dropdown box to work with windows 7 ? It just flickers .
Right click on the exe file and select Properties. Under the compatibility tab ensure Disable visual themes is checked :up:
THE_MASK
06-13-12, 06:40 AM
Right click on the exe file and select Properties. Under the compatibility tab ensure Disable visual themes is checked :up:thanks .
anyone know how i get the dropdown box to work with windows 7 ? It just flickers .
Right click on the exe file and select Properties. Under the compatibility tab ensure Disable visual themes is checked :up:
Thank you Sober for asking and TDW for answering. :up:
Until now I thought that this flickering issue was only my problem :oops:
Echolot
06-13-12, 05:25 PM
Quote:
Originally Posted by sober http://www.subsim.com/radioroom/smartdark/viewpost.gif (http://www.subsim.com/radioroom/showthread.php?p=1896879#post1896879)
anyone know how i get the dropdown box to work with windows 7 ? It just flickers .
Quote:
Originally Posted by TheDarkWraith http://www.subsim.com/radioroom/smartdark/viewpost.gif (http://www.subsim.com/radioroom/showthread.php?p=1896942#post1896942)
Right click on the exe file and select Properties. Under the compatibility tab ensure Disable visual themes is checked :up:
Thank you Sober for asking and TDW for answering. :up:
Until now I thought that this flickering issue was only my problem :oops:
:rock:
Thanks, guys.
:ping:
Edit: It works, great.
:Kaleun_Thumbs_Up:
Brodi74
08-05-14, 10:20 AM
Hello community,
does anyone have a guide to all the officers always to be able to put an officer's cap?
I think the Mighty Fine Crew Mod v1.2.1 - Stock Faces Mod is the base but what needs to be changed exactly?
Can someone help me ...?
Thx Brodi74 :D
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.