When examining an NPC that is not part of your group, a box with descriptive writing usually comes out.
Is there a script command to show the player the actual card of a selected NPC?
Even with activated object I like it.
I am only interested in knowing if there is a command to make a character’s card appear at will.
not really.
There are 3 UI-cards:
- for the controlled character (characterscreen.xml)
- for an uncontrolled partymember (creatureexamine.xml)
- for NPCs, etc. (examine.xml)
I don’t want to say it’s impossible; but it might be,
The obstacle as I see it is to intercept a click on (contextmenu.xml) and differentiate between object-types: Is the thing being examined a creature or something else? Then show player an appropriate GUI.
even if that goes through, one might be looking at developing another UI-screen just to handle non-party NPCs and/or monsters.
ie, it’s a project for a rainy day… or fortnight
What is the command to show up one of these UI-cards via script?
//RWT-OEI 12/08/05
//This function allows the script to display a GUI on the player's client.
//The first parameter is the object ID owned by the player you wish to
//display the GUI on.
//The second parameter is the name of the GUI screen to display. Note
//that only screens located in the [GuiScreen] section of ingamegui.ini
//will be accessible.
//The 3rd parameter indicates if the displayed GUI should be modal when
//it pops up.
//RWT-OEI 01/16/07 - Added 4th parameter. This defines the resource
//that should be used for this screen if the screenName is not already
//found in the ingamegui.ini or pregamegui.ini. If left blank, then no
//gui will be loaded if the ScreenName doesn't already exist. If the
//sScreenName is *already* in use, then the 4th parameter will be ignored.
void DisplayGuiScreen( object oPlayer, string sScreenName, int bModal, string sFileName = "", int bOverrideOptions = FALSE);
object oPlayer = ;
DisplayGuiScreen(oPlayer, "SCREEN_CREATUREEXAMINE", FALSE);
alternately,
DisplayGuiScreen(oPlayer, "", FALSE, "creatureexamine.xml");
(roughly)
note that in ContextMenu.xml the creature-examine screen is invoked with a gui-function:
<UIRadialNode name="node-examine" style="BASE_RADIAL_NODE" strref="549"
OnLeftClickExpanded='UIRadialNode_Mouse_ActionExamineObject("SCREEN_EXAMINE","SCREEN_EXAMINE")'
OnLeftClickCollapsed='UIRadialNode_Mouse_ActionExamineObject("SCREEN_EXAMINE","SCREEN_EXAMINE")' >
<UIFrame state="base" fill="ia_examine.tga" />
</UIRadialNode>
I just noticed that ContextMenu.xml already does differentiate between objects types (incl/ hostile vs non-hostile NPCs), but unfortunately those calls all appear to go back to the xml above – and that function UIRadialNode_Mouse_ActionExamineObject()
is hardcoded.
but i guess the point is, it could be replaced …
Many thanks for the reply. I’ll make a try now!
The problem with DisplayGuiScreen(); is that there is no target. How can I say to the command what is the target of my examination?
well, uh, that’s an issue …
this gets player’s current target:
// Brock H. - OEI 10/30/06
// If oCreature is controlled by a player, this will be the
// Object that the player has selected as their current target object.
// If the player has no target, or if oCreature is not player controlled,
// then the return value will be OBJECT_INVALID
object GetPlayerCurrentTarget( object oCreature );
but to pass that to a UI-scene likely means writing your own UI-scene (or re-working one of the current examine screens)
/my intuitions are telling me this is more complicated/involved than you think at present,
Yes… I think so… Too much involving for now.
maybe on a rainy fortnight … it’s an interesting project tho …