![]() |
[TEC] Crew Scripting
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. |
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) |
So here's an example using the Chief. His idles entry are defined in the submarine files
Quote:
Quote:
|
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. Quote:
Quote:
Quote:
Quote:
Quote:
|
: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. |
Quote:
|
|
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. :-? |
Availiable jobs in GoblinEd:
http://img532.imageshack.us/img532/8739/jobsb.jpg Notice: Deck gun and flak loader 1 and 2 |
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. |
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. |
Manning Guns
To assign a crewman to a gun, you first must move him the appropriate waypoint. The easiest way is to use Teleport(). Quote:
Quote:
|
Quote:
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. |
thanx this is def were ill spend my time
|
All times are GMT -5. The time now is 03:48 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.