Skip to content

Portrait Question

ZephiriusZephirius Member Posts: 419
edited January 2022 in Builders - Scripting
My question is: how do I make it so that when the conversation starts the portrait doesn't show as "unknown speaker", but a proper portrait of my choosing? I'm sure it's something glaringly obvious, but I'm just not that skilled at coding - any help is welcomed. :)

In the grand scheme of things, it's inconsequential. But it's nagging me, mocking me. It's driving me nuts... grrrr!
#include "in_g_cameramove"
void ForceDelay()
{
   object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF);
   BeginConversation("azash_zuul", oPC);
}

void main()
{

  object oPC = GetEnteringObject();
  if (!GetIsPC(oPC)) return;

  AssignCommand(oPC, ClearAllActions());
  SetCutsceneMode(oPC, TRUE, FALSE);

  SetCameraFacing(90.0, 5.0, 25.0, CAMERA_MODE_CHASE_CAMERA);
  GestaltCameraMove(0.3, 90.0, 3.0, 25.0, 270.0, 10.0, 90.0, 5.5, 100.0, oPC, 1, 0, 0);

  DelayCommand(6.0, SetCutsceneMode(oPC, FALSE, TRUE));
  DelayCommand(6.3, ForceDelay());
  DelayCommand(6.3, SetPortraitResRef(OBJECT_SELF, "po_lichking_"));
  string sString = "c_lich_bat1";
  DelayCommand(6.3, AssignCommand(oPC, PlaySound(sString)));
}
Post edited by Zephirius on

Comments

  • ProlericProleric Member Posts: 1,316
    edited January 2022
    SetPortraitResRef(OBJECT_SELF, "po_lichking_")
    
    is trying to set a portrait on the object you are entering (area? trigger?). Try setting it on the speaker before conversation (not at the same time or afterwards).

    The speaker needs to be within conversation range for the portrait to work.

    When entering an area, even that won't work unless the conversation is delayed by about 2 seconds.

  • ZephiriusZephirius Member Posts: 419
    edited January 2022
    Yeah, it's a generic trigger - I tried using GetPCSpeaker() without delay and made sure the lich is right in front of the PC. I still get the "unknown speaker" portrait.
    I changed it to the Lichs' OnConversation handler and it's working now...
    #include "in_g_cameramove"
    void ForceDelay()
    {
       object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF);
       BeginConversation("azash_zuul", oPC);
       object oLich = GetObjectByTag("AZASH_ZUUL");
    
    }
    void main()
    {
        ExecuteScript("nw_c2_default4", OBJECT_SELF);
    
        object oPC = GetPCSpeaker();
        if (!GetIsPC(oPC)) return;
    
        object oLich = GetObjectByTag("AZASH_ZUUL");
        SetPortraitResRef(oLich, "po_lichking_");
    
        AssignCommand(oPC, ClearAllActions());
        SetCutsceneMode(oPC, TRUE, FALSE);
    
        SetCameraFacing(90.0, 5.0, 25.0, CAMERA_TRANSITION_TYPE_SNAP);
        GestaltCameraMove(0.3, 90.0, 3.0, 25.0, 270.0, 10.0, 90.0, 5.5, 100.0, oPC, 1, 0, 0);
        DelayCommand(5.5, SetCameraFacing(270.0, 5.0, 30.0, CAMERA_TRANSITION_TYPE_SNAP));
    
        DelayCommand(6.0, SetCutsceneMode(oPC, FALSE, TRUE));
        DelayCommand(6.3, ForceDelay());
        //DelayCommand(2.3, SetPortraitResRef(GetPCSpeaker(), "po_lichking_"));
        string sString = "c_lich_bat1";
        DelayCommand(6.3, AssignCommand(oPC, PlaySound(sString)));
    }
    

    Thanks for pointing me in the right direction Proleric.
    Post edited by Zephirius on
Sign In or Register to comment.