Author Topic: Changing bridge of AI captain  (Read 1780 times)

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Changing bridge of AI captain
« on: November 12, 2018, 11:28:20 PM »
I'm modding the single player campaign and I want to add a bit of variety to the bridges of the AI captains that talk to the player throughout the story.

For example, I'm attempting to move Captain Haley of the USS Berkeley from sitting in a Galaxy Class bridge set to an Intrepid class bridge. I have the intrepid bridge already installed in my game and it works perfectly. I have also figured out how to change the actual set when you hail the Berkeley and the intrepid bridge now fills the background. However, Captain Haley is not sitting in the captains chair. I can hear her talk, but the camera focuses on the empty seat.

How do I 'position' Haley's body in the captain's chair? Also, can the angle of the camera be modified?

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: Changing bridge of AI captain
« Reply #1 on: November 13, 2018, 12:51:43 PM »
Check with Lurok - he did this for BCSP for all of the backgrounds of characters displayed on the viewscreen.
BCSP will be released soon, I found an old backup and just the last few missions to play through (everything has been working perfectly so far) and then just a couple quick things to add in, and then it is finally done. (i mean it this time! lol)

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #2 on: November 13, 2018, 03:52:33 PM »
Don't ask me (but do  :D)

I was inspired/fired up when did all that...

now...

not so much sadly.


Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: Changing bridge of AI captain
« Reply #3 on: November 13, 2018, 07:11:20 PM »
it is all scripted in, Lurok - as soon as BCSP is out, everyone can look into how you were able to achieve the amazing things you did for SP on every minor to major level :)

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Changing bridge of AI captain
« Reply #4 on: November 13, 2018, 10:07:43 PM »
Check with Lurok - he did this for BCSP for all of the backgrounds of characters displayed on the viewscreen.

I suppose I'll wait then? Assuming I can figure out how Lurok did it by sifting through the files.

Don't ask me (but do  :D)

Does that mean you can tell me?  :P
I feel like I'm already really close to making it work. There's probably just one little thing that I'm unaware of that will fix my issue.

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #5 on: November 14, 2018, 04:39:31 PM »
First things first:   original BC scripted characters against 3D backgrounds.  I needed to work out how to script against 2D (nif) backgrounds.   MissionLib.py was the key...

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Changing bridge of AI captain
« Reply #6 on: November 14, 2018, 06:47:10 PM »
MissionLib.py was the key...

No luck there.

In my mind, the issue Im having is what to put in this line of the Character's file:

Code: [Select]
pHaley.SetLocation("GalaxySeated")
This obviously relates to the location of the character and identifies them on the Galaxy Class bridge captains chair. Commander Willis (who does not sit in the captains chair) has his location listed as 'DBGuest" (D-Bridge Guest seat) which correctly corresponds to where he is seated when he hails the player.

So the bridge where I intend to place Captain Haley (along with other bridges) must have an identifier to locate the 'Captains Chair' somewhere. The question is, what is it called and where are these 'waypoints' listed? I cant even find the ones for the stock bridges anywhere.

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #7 on: November 18, 2018, 11:28:28 AM »
If your Intrepid bridge is showing up as background,  in MissionLib.py -  SetupBridgeSet(),  try and add a new config:

Code: [Select]
elif (pcModelName == "data/Models/Sets/bridgename/bridgename.nif"):
pCamera = App.CameraObjectClass_Create(0, 95, 64, -1.55, 0, 0, 1, "maincamera")


Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Changing bridge of AI captain
« Reply #8 on: November 18, 2018, 09:15:27 PM »
If your Intrepid bridge is showing up as background,  in MissionLib.py -  SetupBridgeSet(),  try and add a new config:

Code: [Select]
elif (pcModelName == "data/Models/Sets/bridgename/bridgename.nif"):
pCamera = App.CameraObjectClass_Create(0, 95, 64, -1.55, 0, 0, 1, "maincamera")

I actually have this already:

Code: [Select]
if (pNiCamera is None):
pSet.SetBackgroundModel(pcModelName, fMX, fMY, fMZ)

# Do special checks for the D and E bridges, we know what numbers we want for them...
if (pcModelName == "data/Models/Sets/DBridge/DBridge.nif"):
pCamera = App.CameraObjectClass_Create(0, 30, 47, -1.55, 0, 0, 1, "maincamera")
elif (pcModelName == "data/Models/Sets/EBridge/EBridge.nif"):
pCamera = App.CameraObjectClass_Create(0, 75, 64, -1.55, 0, 0, 1, "maincamera")
elif (pcModelName == "data/Models/Sets/intrepidbridgev3/intrepidbridge.nif"):
pCamera = App.CameraObjectClass_Create(-32, 10, 47, -1.55, 0, 0, 1, "maincamera")
elif (pcModelName == "data/Models/Sets/defiantbridge/defiantbridge.nif"):
pCamera = App.CameraObjectClass_Create(0, -50, 0, -1.55, 0, 0, 1, "maincamera")
else:
pCamera = App.CameraObjectClass_Create(fX, fY, fZ, 0, 0, 0, 1, "maincamera")

This is how the game knows where to position the camera on the set, correct?

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #9 on: November 19, 2018, 11:48:48 AM »
 :thumbsup:

Notice your intrepidbridge numbers are different?   Try adjusting them, and hopefully Haley will appear on screen  :)

The numbers I cited will generally place/'film' any character centre-stage even if background is just a nif-screen (which was trick I used for getting around original BC nif-model issues)

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Changing bridge of AI captain
« Reply #10 on: November 19, 2018, 01:49:42 PM »
:thumbsup:

Notice your intrepidbridge numbers are different?   Try adjusting them, and hopefully Haley will appear on screen  :)

The numbers I cited will generally place/'film' any character centre-stage even if background is just a nif-screen (which was trick I used for getting around original BC nif-model issues)

She does appear on screen now, but since the only thing that moved was the camera, this is the rather humorous result:



The problem is how to move Haley to the captains chair.

In her character file, changing
Code: [Select]
pHaley.SetLocation("GalaxySeated")to
Code: [Select]
pHaley.SetLocation("SovereignSeated")slightly alters her location, so this line of code is the secret as far as I have been able to determine. The problem is, what are the names for the 'seats' on custom bridges?

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #11 on: November 19, 2018, 02:22:53 PM »
Result!  :D

I'd just keep playing with the x, y, z  axis until you have Haley where want her

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Changing bridge of AI captain
« Reply #12 on: November 19, 2018, 02:48:35 PM »
Result!  :D

I'd just keep playing with the x, y, z  axis until you have Haley where want her

But Haley doesn't move.

The camera moves around the bridge depending on the values I input, but Haley remains seated in the same place no matter what.

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #13 on: November 19, 2018, 04:02:06 PM »
All I can suggest is keep experimenting with  SetLocation parameters.

Or do what I did:  create 2D nif version of bridge and add to MissionLib.py. 

Works perfectly

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Changing bridge of AI captain
« Reply #14 on: November 20, 2018, 12:17:21 AM »
Ok. So I've solved the problem by approaching it from a completely different direction.

Instead of trying to move the characters to a new 'hardpoint' in the bridge set, I've simply created a new animation file for the seated locations of every modded bridge I want to include.

By copying the existing "GalaxySeated01.nif" animation file and offseting the body of the chatacter, I can match it up with the captains chair of any set I want.



Next, I added a new reference to this animation in the "commonanimations.py" file.



After that, I just change the character's .py file to represent the new animation ID under the "SetLocation()" function, and thats it!



Works for any character that I modify the files of. The hardest part was tweaking the offset values to actually get them sitting in the chairs properly, but it was just a matter of trial and error. The great thing is that the same procedure can be used to replace the crappy 'background bridges' that many of the alien races use as well. Makes the NPC dislodge much more immersive.



Thanks to everyone for the help, especially Lurok91!  :Metal:
Hopefully this can help others who want to do something similar in their installs.

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #15 on: November 20, 2018, 09:53:48 AM »
Cookies  :D

That's actually a far more elegant solution than mine  :thumbsup:

(it's a sign of age/times that such a breakthrough gets so little response  :D)

Offline vonfrank

  • Posts: 447
  • Cookies: 182
Re: Changing bridge of AI captain
« Reply #16 on: November 21, 2018, 01:17:21 AM »
(it's a sign of age/times that such a breakthrough gets so little response  :D)

Yeah, our little community seems to be getting smaller and smaller as the days go by...

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: Changing bridge of AI captain
« Reply #17 on: November 21, 2018, 09:52:38 AM »
Just out of curiosity, when you call up the bridge on screen do you get all the bridge animations?  Animated LCARS.  NPCs walking on and off the bridge.  Or just a static bridge background?

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Changing bridge of AI captain
« Reply #18 on: November 22, 2018, 11:28:46 AM »
Dude this is excellent work!  Thanks for posting this!

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: Changing bridge of AI captain
« Reply #19 on: November 22, 2018, 11:34:10 AM »
Holy shit - that is awesome!   :thumbsup:
Nicely done!