Sign in to follow this  
N-DReW25

Hyperspace and Med Bay scripts

Recommended Posts

Hello, I am trying to accomplish two things for a custom cut scene aboard the Ebon Hawk. 

 

First of all, I want the Skybox outside the Ebon Hawk to be the Hyperspace animation like the one seen below. 

img-18.JPG

 

The second one I imagine would be slightly harder, I want the player character to lie down on the Med Bay bed like Visas does when she is recruited.

img-102.JPG

 

Would anyone know how to do any of these?

Share this post


Link to post
Share on other sites

The first is easy enough. If you have a look at the SetBackground function in k_inc_hawk, you'll see that hyperspace is Case 10, or in other words room animation scriptloop 11. So in your custom module OnEnter, you can simply set

PlayRoomAnimation(003EBOq, ANIMATION_ROOM_SCRIPTLOOP11);

The med bay bed is potentially a bit more tricky, due to the finicky nature of walkmeshes. You should be to use the prologue's example as a guide if you simply want to show them already laying on the bed. If you want to actually show them walking in and laying down, that would require a custom stunt animation.

Share this post


Link to post
Share on other sites
1 hour ago, DarthParametric said:

The first is easy enough. If you have a look at the SetBackground function in k_inc_hawk, you'll see that hyperspace is Case 10, or in other words room animation scriptloop 11. So in your custom module OnEnter, you can simply set


PlayRoomAnimation(003EBOq, ANIMATION_ROOM_SCRIPTLOOP11);

The med bay bed is potentially a bit more tricky, due to the finicky nature of walkmeshes. You should be to use the prologue's example as a guide if you simply want to show them already laying on the bed. If you want to actually show them walking in and laying down, that would require a custom stunt animation.

So I put that code into my onenter script and I got this error.

Capture.PNG.373a3f79735c38c4fb30a738189ede4a.PNG

 

In case it matters, here is the script I am trying to modify (It is a stunt module btw)

Quote

void main() {
    object oEntering = GetEnteringObject();
    if ((oEntering == GetFirstPC())) {
        if (GetLoadFromSaveGame()) {
            return;
        }
        if ((GetGlobalNumber("650DAN_Revelation") == 1)) {
            SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
            NoClicksFor(2.0);
            PlayRoomAnimation(003EBOq, ANIMATION_ROOM_SCRIPTLOOP11);
            if (IsAvailableCreature(4)) {
                SpawnAvailableNPC(4, Location(Vector(52.04592, 44.41086, 1.80089), 123.975));
            }
            object oPC = GetFirstPC();
            AssignCommand(oPC, ClearAllActions());
            AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_hk47_cut_1", 0))));
            object object8 = SpawnAvailableNPC(0, GetLocation(GetObjectByTag("WP_301_player", 0)));
            object object11 = SpawnAvailableNPC(7, GetLocation(GetObjectByTag("WP_301_kreia", 0)));
            object object14 = SpawnAvailableNPC(9, GetLocation(GetObjectByTag("WP_301_mand", 0)));
            ApplyEffectToObject(1, EffectHeal(500), object14, 1.0);
            object object17 = SpawnAvailableNPC(1, GetLocation(GetObjectByTag("WP_301_disc", 0)));
            object object20 = SpawnAvailableNPC(2, GetLocation(GetObjectByTag("WP_gspawn_mand", 0)));
            object oTalker = CreateObject(64, "talker", GetLocation(GetWaypointByTag("WP_hologram")), 0);
            AssignCommand(oTalker, ActionStartConversation(oEntering, "pcdead_ebo", 0, 0, 0, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
        }
    }
}
 

 

Share this post


Link to post
Share on other sites

Ah, whoops. The room variable is a string, so it needs to be:

PlayRoomAnimation("003EBOq", ANIMATION_ROOM_SCRIPTLOOP11);

 

  • Thanks 1

Share this post


Link to post
Share on other sites
12 minutes ago, DarthParametric said:

Ah, whoops. The room variable is a string, so it needs to be:


PlayRoomAnimation("003EBOq", ANIMATION_ROOM_SCRIPTLOOP11);

 

That one worked! Thank you, I still have the med bay to worry about though.

 

1 hour ago, DarthParametric said:

The med bay bed is potentially a bit more tricky, due to the finicky nature of walkmeshes. You should be to use the prologue's example as a guide if you simply want to show them already laying on the bed. If you want to actually show them walking in and laying down, that would require a custom stunt animation.

So what I want to do is show the Exile lying down on the bed, the Exile will not be going anywhere during the duration of this scene. From my quick examination of the prologue, it uses a dummy NPC with a commoner's appearance and a "<FullName>" as its name, my guess is one of the scripts (probably the onenter script) is the script which sets this dummy to look like the PC based on whatever they chose at the main menu.

Share this post


Link to post
Share on other sites

Yeah:

	object oPCDummy = GetObjectByTag("MEDBAY_PC", 0);
	object oBedWP = GetObjectByTag("InvisibleLocationMarker", 0);
	location lBed = GetLocation(oBedWP);
	int nPCApp = GetAppearanceType(GetEnteringObject());
	effect eDisguise = EffectDisguise(nPCApp);
	
	oPCDummy = CreateObject(OBJECT_TYPE_CREATURE, "c_medbaypc", lBed);
	ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDisguise, oPCDummy);
	AssignCommand(oPCDummy, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_PRONE, 1.0, (-1.0)));

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 9/4/2019 at 9:35 PM, DarthParametric said:

Yeah:


	object oPCDummy = GetObjectByTag("MEDBAY_PC", 0);
	object oBedWP = GetObjectByTag("InvisibleLocationMarker", 0);
	location lBed = GetLocation(oBedWP);
	int nPCApp = GetAppearanceType(GetEnteringObject());
	effect eDisguise = EffectDisguise(nPCApp);
	
	oPCDummy = CreateObject(OBJECT_TYPE_CREATURE, "c_medbaypc", lBed);
	ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDisguise, oPCDummy);
	AssignCommand(oPCDummy, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_PRONE, 1.0, (-1.0)));

 

I've managed to get eveything set up in the script and the git file and everything has worked out perfectly.


Thank you for your assistance! 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this