Aller au contenu

Photo

Display description on placeable use


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
rjshae

rjshae
  • Members
  • 4 509 messages
Hello. The 'On left click' script for a placeable doesn't seem to fire if it is set to 'Examine' as the action. On a left click by the player, I want the script to perform some tracking in the background then display the Examine dialog with the description. Is there a way to do this with the 'Use' option? I don't see a suitable call. (Yes I could use the DisplayMessageBox and paste in the description, but I'd rather employ the default mechanism.)

Thank you! :happy:

Modifié par rjshae, 16 février 2012 - 11:26 .


#2
Dann-J

Dann-J
  • Members
  • 3 161 messages
There is an NWN1 function called ActionExamine()
http://www.nwnlexico...ionexamine.html

I've never tried using it, so I don't know if it works in NWN2.

Modifié par DannJ, 16 février 2012 - 11:45 .


#3
kamal_

kamal_
  • Members
  • 5 260 messages
Default action should be examine, no scripts need to be assigned to the placeable other than what you're doing to track.

#4
Shaughn78

Shaughn78
  • Members
  • 637 messages
Before he left I believe EE had a way of showing the description above an item that wouldn't require the player to walk to the item. You could try getting in touch with him at his blog.
http://eguintir.blogspot.com/

#5
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
A ClearAllActions call to the PC user will stop them from running up to the object. I don't know anything about how the GUI works, but there's gotta be a way to call a standard box like the examine box up from script.

#6
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
You could make a custom GUI of the examine window and then call your tracking script from that. Of couse, that isn't default and will probably be a hassle.

Modifié par M. Rieder, 17 février 2012 - 03:13 .


#7
Claudius33

Claudius33
  • Members
  • 258 messages
Hello rjshae

Here is a script fromp 16 Cygni that may look like what you want :

// player examines the sign near the fortress, advances journal

const string sQuest = "q_buzundush";
void main()
{
    object oPC = GetFirstPC();
    object oSign = OBJECT_SELF;
    int n;
    if (!GetLocalInt(oSign, "Clue")) // not seen yet
    {
        SetLocalInt(oSign, "Clue", 1);
        n = GetJournalEntry(sQuest, oPC);
        if (n<30) n = 30;        // if first clue
        if ((!GetGlobalInt("FR"))&&(n == 80)) n = 90;    // test language when last clue found
        AddJournalQuestEntry(sQuest, n+10, oPC);
    }
    DelayCommand(0.1f, AssignCommand(oPC, ActionExamine(oSign)));
}

Properties of the placable :
- Default action : Auto
- the script is attached to the OnUse and to the OnLeftClick events
- A local int variable "Clue" is attached to the placable.

The first time the player uses or left clicks the placable :
- the journal is updated (you can put any other treatment, of course)
- the local variable "Clue" is set to 1
- the description is displayed (ActrionExamine)

The next times the player uses or left clicks the placable only the description is displayed.

#8
rjshae

rjshae
  • Members
  • 4 509 messages

DannJ wrote...

There is an NWN1 function called ActionExamine()
http://www.nwnlexico...ionexamine.html

I've never tried using it, so I don't know if it works in NWN2.


Hey that worked... sort of. I had to pass a GetNearestObjectByTag call as part of the action (to lookup the object), as OBJECT_SELF got reinterpreted as the creature doing the action. But good enough. Thank you!

Thanks everybody for your helpful suggestions! :happy: