Aller au contenu

Photo

display Localized Description


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

#1
DynV

DynV
  • Members
  • 18 messages
What script would display Localized Description ?  I intend to insert it in On Used Script of a scroll I'd put on a bed pillow indicating that certain items in the inventory of a nearby Armoire can be taken and others not (flagged as stolen).

Thank you :)

#2
rjshae

rjshae
  • Members
  • 4 491 messages
Would DisplayMessageBox serve?

#3
DynV

DynV
  • Members
  • 18 messages

rjshae wrote...

Would DisplayMessageBox serve?


There's hundreds of lines when I drop-down On Used Script.  I don't remember ever scripting with NWN2 before and I didn't think I'd have to go through such a number of possibilities.  :blush:

Any tip would help.  :)

#4
rjshae

rjshae
  • Members
  • 4 491 messages
Ah, well that is just the menu of pre-built scripts. I think what you need to do is write your own. In the upper-left panel, under the Scripts tab, if you right click you should get a menu of script templates. There's probably one for an On-Used script. Just create a new script, change the name to something suitable, save it, and the name should appear in the pull-down menu for the On-used script property. You can then code in the instructions in your own script.

Will that work for you?

Modifié par rjshae, 17 septembre 2010 - 08:35 .


#5
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 592 messages
You don't need a script for this. I use the same technique in King's Festival. Just use a scroll placeable, set it to usable and its default action preference to Examine. Then when you click on it its description is displayed.



If you want them to take the scroll then you could use a tag based acquire script to display a message box using the DisplayMessageBox command that displays the description text retrieved with the GetDescription function.



Regards

#6
DynV

DynV
  • Members
  • 18 messages

Kaldor Silverwand wrote...

You don't need a script for this. I use the same technique in King's Festival. Just use a scroll placeable, set it to usable and its default action preference to Examine. Then when you click on it its description is displayed.


Ah yeah great!  It even has the eye icon which is even better than if I managed the script.  I tried it in a new module.  :D

Kaldor Silverwand wrote...

If
you want them to take the scroll then you could use a tag based acquire
script to display a message box using the DisplayMessageBox command
that displays the description text retrieved with the GetDescription
function.


I was trying to use the ActionExamine, I thought it was even better than DisplayMessageBox.  I made the following script naming it i_scrollinnnote_us that I placed in On Used Script of the scroll tagged ScrollInnNote. and I followed what's in Required and Suggested.

// Placeable OnUsed Template    
/*
    Required: Static=FALSE, Usable=TRUE, CurrentHP>0, attach script to the OnUsed event
    Suggested: Plot=TRUE, DefaultActionPreference="Use"
*/
//

#include "ginc_debug"

void main()
{
    object oUser = GetLastUsedBy();
    string sSelfName = GetName( OBJECT_SELF );

    PrettyDebug( sSelfName + "'s was used by " + GetName( oUser ) );

    // Do something
    
    // I realised the script would only be activated by ScrollInnNote so no need for verification.
    //if ( sSelfName == "ScrollInnNote" ) {
        ActionExamine( OBJECT_SELF );
    //}
}

Now that clicking a scroll does examine it, I'm wondering if there's a way to have it highlighted until it's examined.  I could have it in the journal to check the pillow note but that seem inane, the player could very well figure out on his/her own that those items (see OP) belong to the Inn.  Addressed in Highlight object until examined.

Modifié par DynV, 19 septembre 2010 - 08:18 .


#7
rjshae

rjshae
  • Members
  • 4 491 messages
The fx_lootbag visual effects can be used to highlight a location. You might also be able to adopt the "Secret Object" placeable to have a party member say they found something when they get nearby.

Modifié par rjshae, 22 septembre 2010 - 06:51 .


#8
DynV

DynV
  • Members
  • 18 messages

rjshae wrote...

You might also be able to adopt the "Secret Object" placeable to have a party member say they found something when they get nearby.


That sound like a good idea!  :)  I'll finish up with the highlighting for tutorial purposes then get to it.  Although...  In cases where "Secret Object" was used (I don't recall it in the campaign), doesn't it have a visual effect showing which object was just discovered?  :blink:

Modifié par DynV, 22 septembre 2010 - 07:08 .


#9
rjshae

rjshae
  • Members
  • 4 491 messages

DynV wrote...

rjshae wrote...

You might also be able to adopt the "Secret Object" placeable to have a party member say they found something when they get nearby.


That sound like a good idea!  :)  I'll finish up with the highlighting for tutorial purposes then get to it.  Although...  In cases where "Secret Object" was used (I don't recall it in the campaign), doesn't it have a visual effect showing which object was just discovered?  :blink:


The only effect I recall is that of replacing one object with another.

#10
DynV

DynV
  • Members
  • 18 messages
So I finally figured how to remove highlighting effects off the object in Highlight object until examined.  Now I want to examine but I have no idea how to attach that script to On Examine so I've attacehd it to On Used but the examine command ActionExamine() won't function, I've tried different objects, so I'm stuck choosing between removing the effect or examining the scroll.  Does anyone has a tip on how to call the examine window from a script, ideally having used ActionExamine() ?

Thanks ../../../images/forum/emoticons/smile.png

Modifié par DynV, 26 septembre 2010 - 12:24 .


#11
Guest_ElfinMad_*

Guest_ElfinMad_*
  • Guests
I'm not sure why you need to use ActionExamine() if you are doing what Kaldor suggested and using the objects default action preference as examine in the properties box. As that window would come up automatically.

You can put your script in the On Left Click event for the object and have the examine window come up (if thats the default action) and run your script to remove the effect.

Looking at your script in your other thread the ActionExamine() won't work as intended because you have not assigned it to the player. You would need to do something like this:

object oPC = GetLastUsedBy(); //if using the onused event
AssignCommand(oPC, ActionExamine(OBJECT_SELF));

But I think this is all unecessary if you use Kaldor's approach.

Modifié par ElfinMad, 26 septembre 2010 - 09:19 .