Aller au contenu

Photo

Creature "Name" Bubble - Is Its XML Available?


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

#1
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi All,

Just a quick one:-

Does anybody know if a creatures "name" bubble that shows when the creature is highlighted is available to work with via an XML script. If so, does anybody know which XML script that is?

I was hoping to simply make the "name" disappear so that a creature does not appear accessible in any way ... another approach to having "ghostly" images using creatures.

Thanks in advance,
Lance.

#2
kevL

kevL
  • Members
  • 4 056 messages

try tooltip3.xml

 

when i changed the background, the background changed IG.



#3
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

try tooltip3.xml
 
when i changed the background, the background changed IG.


Hi KevL,

I will have a look at that later. Thanks for a possible solution.

EDIT: YES! That did it ... Thanks KevL, I will try to use that XML access to remove names when I don't need them now, which means it should be possible to use creatures without them appearing "accessible".

EDIT 2: For those interested, accessing the TOOLTIP XML (SCREEN_TOOLTIP) requires a further part to the name as described in the ingamegui.ini script. Using the name without the extension as defined in that script means nothing happens. In this case, that script actually redirects to SCREEN_TOOLTIP_3 for the XML I was working on. A little different from the normal approach to working with XML files.

The bottom line result now, is that I can turn the names on or off at the change of a global variable! Yeh!

Actually, I am thinking about using the same technique to add extra "buttons" (options) to my menu to allow a player to turn all GUIs off (like pressing the "H" Key), but individually, so they can keep just the GUI options open that they want to. E.g. I quite like the idea of all GUIs off, but just the leaving the MAP showing.

Lance.
  • rjshae et Loki_999 aiment ceci

#4
andysks

andysks
  • Members
  • 1 645 messages

This might be the longest shot now, mainly because it comes from me, a person that knows nothing about all these stuff you just said :). But when I read this post it came to my mind and needed to ask. In Dragon Age when I press Tab it shows all creature name bubbles. In NWN2 the z key will highlight them but not show names.

Is there an option on the game options menu to show them at all time actually that I am not aware of because I play less than I build, or if not, can it be done, to show names together with highlight on z key with all the things you just said :)?



#5
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

This might be the longest shot now, mainly because it comes from me, a person that knows nothing about all these stuff you just said :). But when I read this post it came to my mind and needed to ask. In Dragon Age when I press Tab it shows all creature name bubbles. In NWN2 the z key will highlight them but not show names.
Is there an option on the game options menu to show them at all time actually that I am not aware of because I play less than I build, or if not, can it be done, to show names together with highlight on z key with all the things you just said :)?


Hi andysks,

It's funny you should mention this, as I was wondering the same thing after watching my wife playing NWN1 last night. She would press the equivalent "Z" key (tab for NWN1) and all NPCs would highlight with their names showing. The answer lies in whether we can gain access to the "Z" (and while I am at it, why not the "H" key) XML call backs.

EDIT: I have a nasty feeling that access to these two keys may be hard-coded. That said, there is no reason why another button could not be designed or coded to do what you ask.

I will try looking at more of the XML files, but KevL may have already determined if these call backs are accessible to us or not, so maybe he can leave a comment and let me know which XML files I need to edit?

KevL, have you found any XML scripts we can access call backs for pressing the "Z" or "H" keys?

As I say, I will try looking myself, but if anybody does know if they are accessible, then please let me know.

Many Thanks,
Lance.



#6
kevL

kevL
  • Members
  • 4 056 messages

sry guys, can't think of any way to do that :\

 

disclaimer : my Z / TAB is nonfunctional (on purpose) -- but still can't think of a way to tell the engine "when the x-key is pressed, do THIS" ...



#7
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

sry guys, can't think of any way to do that :\
 
disclaimer : my Z / TAB is nonfunctional (on purpose) -- but still can't think of a way to tell the engine "when the x-key is pressed, do THIS" ...


Yes, that was what I suspected.

However, I may consider programming another key to do this at some future date ... just as another "feature".

Cheers,
Lance.
  • andysks aime ceci

#8
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi,

I am giving this some more thought, and may design a couple of "Highlight" buttons:-

1) Where a player can move there mouse into an "invisible box" on the screen and all names will highlight at once.

 

DONE! See next post.

 

2) Have an option on the examine window to make a name "persist" above a creature without the need to hover.

 

I have also achieved this. A player can now toggle "name persistency" on or off for a creature. It uses a similar approach as the first option, but the XML applies or removes a variable on the creature target, which then TALKS its name (I thought better than SHOUT for this option) every heartbeat after checking the variable to see if to do so or not. I have also made these persistent names appear in ORANGE text. (NB: If others want this option as well, let me know.)

That would give the player a couple of tools to make it easier to find certain named creatures and locate previous ones.

EDIT: I like these additional player tools and so have incorporated them into my own campaign already. :) 

Lance.



#9
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

This might be the longest shot now, mainly because it comes from me, a person that knows nothing about all these stuff you just said :). But when I read this post it came to my mind and needed to ask. In Dragon Age when I press Tab it shows all creature name bubbles. In NWN2 the z key will highlight them but not show names.
Is there an option on the game options menu to show them at all time actually that I am not aware of because I play less than I build, or if not, can it be done, to show names together with highlight on z key with all the things you just said :)?


Hi andysks,

Just for you (and anybody else interested), I have knocked together a quick and simple solution that I hope will suffice for you for the time being. It wasn't clear whether this was to have as an official campaign "fix" or for your own work. So, I have supplied this package as "for your own work" only, but if you know a little about scripting, it can easily be adjusted to work with the OC as well.

FURTHER DEVELOPMENT IDEAS
=========================

Other possible ideas include:

1) Having different colour name texts for different context. (E.g. Shops show names in blue.)
2) Click the box for something different. 


THE SMALL SQUARE GUI IN PLACE:-

TheGUI.jpg


THE NAMES BEING SHOWN AFTER MOUSE ENTERING BOX:-

ShowNames.jpg


DOWNLOAD THE PACKAGE FROM HERE:-

https://dl.dropboxus...35/ShowInfo.rar

Do please give feedback.

Many Thanks,
Lance.

#10
andysks

andysks
  • Members
  • 1 645 messages

This is actually really good. Exactly what I had in mind. Only two things I need to ask. If one area of mine has another script assigned on the client enter, AND a call to ExecuteScript for sls lets say, can it have two ExecuteScript calls there on the end?

The other things is completely related to your work. Can I somehow remove the shouts? It seems every name shown will shout its name on the chat...

But even with that, the tool is awesome. I always hated hovering over each NPC individually.



#11
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

This is actually really good. Exactly what I had in mind. Only two things I need to ask. If one area of mine has another script assigned on the client enter, AND a call to ExecuteScript for sls lets say, can it have two ExecuteScript calls there on the end?
The other things is completely related to your work. Can I somehow remove the shouts? It seems every name shown will shout its name on the chat...
But even with that, the tool is awesome. I always hated hovering over each NPC individually.


Hi andysks,

This system does not use any ExecuteScript function (although it does not matter if it did), but a direct function call to display the GUI for the player. Therefore, it's fine just to add the calling line at least once for the player and it will work OK.

The default function I have used is SpeakString, so that's its behaviour.

 

Tried ActionStartConversation and starting a generic conversation. Nope!

Possibly FloatingTextStringOnCreature.Nope!
DebugPostString may have been a solution but it requires editing the nwn.ini, which I want to avoid if possible.

 

After doing a little searching, I have not been able to find a way of displaying text without it going to the chat window as well. There may still be a way, but it currently eludes me. Another possibility may be if there is any way one can force the tooltip XML to execute for each NPC via a script, but I am unaware of that means also at the moment.

 

I may try reversing my logic and seeing if there is any way to have the creatures always have their names display and then work a way to prevent it.

 

Still can't think of anything ... Anybody else have any ideas how to approach this to avoid sending text to the chat window? (Not essential, but just seeing if it is possible.)

Lance.



#12
kevL

kevL
  • Members
  • 4 056 messages

another method:
 

NWN2_SS_032914_131228_ed140329.jpg

 

 

I was expanding my hotbar horizontally and didn't know what to add (the commands i use are already covered by either mouse-buttons or word-processing keys), so this was an aha!

thanks Lance, another worthwhile invention :)



#13
kevL

kevL
  • Members
  • 4 056 messages

I also use this:
 

object oCreature = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oPC, i, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);

because i was getting an odd 'reflection' of names from creatures that were out of sight behind me, reflected as it were into the low foreground ... ofc this also parses things down to a more tactical level, which i enjoy.


btw, ScriptHidden don't seem to react to either call, which is good.



#14
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

another method:
 
NWN2_SS_032914_131228_ed140329.jpg
 
 
I was expanding my hotbar horizontally and didn't know what to add (the commands i use are already covered by either mouse-buttons or word-processing keys), so this was an aha!

thanks Lance, another worthwhile invention :)


Aha, are those my HP bars I see in operation as well. :) Did you change the bar colour to "green" ... If so, can you allow me to have the images so that it saves me doing another lot. The more potential colour options the better really, as it would allow for "effect" views too. E.g. Poisoned. Did you allow for that as well, or was it just wanting a brighter colour?

And yes, I also considered adding the effect to the bar via a button as well. :)

And double yes .. I too was altering my code to nearest seen for exactly the same reason of the weird distance shout effect!

EDIT: This may still need to be tweaked a little more, as I can still get the effect when the PC can "see" but is facing away from the creature in question. For "seen" implies the PC looking around themselves, including at creatures behind them that are perceivable by sight. A solution may be to work with vectors somehow and write an algorithm that checks those spaces in front of the PC (or just to the side) .... I don't fancy doing that or even know if it is possible yet.
 
KevL ... Fancy the challenge to see if it is possible using the LineOfSightVector(vector, vector) function?

What do they say about thinking alike .... ;)

Cheers,
Lance.

#15
kevL

kevL
  • Members
  • 4 056 messages

yeah yeah.. we're all geniuses Lance, in one way or another


I'll just zip up my 'LB_hpBars' override subdir

and let ya figure it out. The calls are made from onPerception & onDamaged, the poor man's version. You should see how it's assigning red/green/blue colors right away.


re. the ShowInfo shout. Am still getting a bit of text-reflection and am in the process of cutting down the distance, currently trying 60m but will likely go shorter (perhaps 45m) but won't go much lower than 40m even if it still 'reflects'

/cheers



oh, about the hpBars: the only other thing I think i changed in the .BBX files is dimensions, if you want to use/adapt them go ahead.



#16
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

yeah yeah.. we're all geniuses Lance, in one way or another


I'll just zip up my 'LB_hpBars' override subdir

and let ya figure it out. The calls are made from onPerception & onDamaged, the poor man's version. You should see how it's assigning red/green/blue colors right away.


re. the ShowInfo shout. Am still getting a bit of text-reflection and am in the process of cutting down the distance, currently trying 60m but will likely go shorter (perhaps 45m) but won't go much lower than 40m even if it still 'reflects'

/cheers



oh, about the hpBars: the only other thing I think i changed in the .BBX files is dimensions, if you want to use/adapt them go ahead.


Thanks for the link ... will grab that in a bit. That will save me quite a bit of work. :)

Yes, I was still having reflection issues too. Did you see my edit above about possibly trying the LineOfSightVector(vector, vector) function?

Cheers,
Lance.

#17
kevL

kevL
  • Members
  • 4 056 messages

yes.


EDIT: This may still need to be tweaked a little more, as I can still get the effect when the PC can "see" but is facing away from the creature in question. For "seen" implies the PC looking around themselves, including at creatures behind them that are perceivable by sight. A solution may be to work with vectors somehow and write an algorithm that checks those spaces in front of the PC (or just to the side) .... I don't fancy doing that or even know if it is possible yet.
 
KevL ... Fancy the challenge to see if it is possible using the LineOfSightVector(vector, vector) function?


maybe, but for now will just point out there's also GetObjectSeen() -- though i suspect it's fundamentally the same as CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN

#18
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

yes. maybe, but for now will just point out there's also GetObjectSeen() -- though i suspect it's fundamentally the same as CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN


Hi KevL,

I suspect all the "seen" or "perceived" work in a similar manner (i.e. all around the PC) as opposed to the actual sight ahead of them. I am not sure if the "problem" (as such) warrants the time trying to work out a solution though.

By the way, I have all the different coloured bars now ... so thanks for that! May well use the slightly altered dimensions too. EDIT: Now I want my bars slightly chunkier (like yours), but my length. Doh! Maybe, I'll edit them later. ;)

EDIT: Heads up for you: You have an error in your code that repeats the same value:-

else if (iPERCENT > 80 && iPERCENT < 91) sHPBAR = "alb_hp_80" + sRep; // 81-90
else if (iPERCENT > 70 && iPERCENT < 81) sHPBAR = "alb_hp_80" + sRep; // 71-80

Lance.



#19
Tchos

Tchos
  • Members
  • 5 042 messages

Lance -- I'll probably use those HP bars at some point, and I think green is best for friendly NPCs, and red for hostiles.  I have indeed seen green used for a poisoned status, but I believe more often green is used as a "good" colour.

 

As for perception, in my experiments with NPCs reporting on "seeing" or "hearing" a hidden PC, the "spot" skill was oddly able to detect creatures sneaking behind them outside of line of sight, and I had assume that the "listen" skill would be more appropriate for that situation.  I think you're right that it assumes that a character with the spot skill is assumed to be looking around now and then, even if the animation doesn't show it.  (Note, this video doesn't show the times when the NPC said that he "saw" me when I was behind him.)

 



#20
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Lance -- I'll probably use those HP bars at some point, and I think green is best for friendly NPCs, and red for hostiles.  I have indeed seen green used for a poisoned status, but I believe more often green is used as a "good" colour.
 
As for perception, in my experiments with NPCs reporting on "seeing" or "hearing" a hidden PC, the "spot" skill was oddly able to detect creatures sneaking behind them outside of line of sight, and I had assume that the "listen" skill would be more appropriate for that situation.  I think you're right that it assumes that a character with the spot skill is assumed to be looking around now and then, even if the animation doesn't show it.  (Note, this video doesn't show the times when the NPC said that he "saw" me when I was behind him.)<SNIP>


Hi Tchos,

Great .. I like HPBars in games like this. :)

Yes, I know what you mean about the colour usage. I am still undecided at this stage how I was going to use the different colours and have simply added the images and left some template code in my own code showing where I need to decide what will alter the colour of the bars.

Re, the video. Yes, I do think the "perceptions" test all around the PC (line of sight all around too). It's a shame there isn't any easy way to test just the 180 degrees ahead of them, as that would alleviate the shout string issue encountered. It's not a major issue, but just messes with my (and probably KevLs) sense of "attention to details". ;)



#21
kevL

kevL
  • Members
  • 4 056 messages

@guys
red for hostile
blue for neutral
green for friendly. Works for me.


EDIT: Heads up for you: You have an error in your code that repeats the same value:-

else if (iPERCENT > 80 && iPERCENT < 91) sHPBAR = "alb_hp_80" + sRep; // 81-90
else if (iPERCENT > 70 && iPERCENT < 81) sHPBAR = "alb_hp_80" + sRep; // 71-80

Lance.

ah, Thank you.

one good turn deserves another:

int GetIsInFoV(object oCreature, object oPC = OBJECT_SELF)
{
    vector vPC = GetPosition(oPC);
    vector vCreature = GetPosition(oCreature);

    vector vDiff = vCreature - vPC;
    float fDiff = VectorToAngle(vDiff);

    float fPC = GetFacing(oPC);
    fDiff -= fPC;

    // these are the bounds, in degrees, to left and right of
    // PC's current facing that return either Seen or NotSeen:
    if (fDiff > 50.f || fDiff < -50.f)
    {
        return FALSE;
    }

    return TRUE;
}


#22
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

@guys
red for hostile
blue for neutral
green for friendly. Works for me.
 
 

ah, Thank you.

one good turn deserves another:



int GetIsInFoV(object oCreature, object oPC = OBJECT_SELF)
{
    vector vPC = GetPosition(oPC);
    vector vCreature = GetPosition(oCreature);

    vector vDiff = vCreature - vPC;
    float fDiff = VectorToAngle(vDiff);

    float fPC = GetFacing(oPC);
    fDiff -= fPC;

    // these are the bounds, in degrees, to left and right of
    // PC's current facing that return either Seen or NotSeen:
    if (fDiff > 50.f || fDiff < -50.f)
    {
        return FALSE;
    }

    return TRUE;
}


Ah, Well done KevL,

I'll check that out Monday. Catch you all later!

Lance.

#23
kevL

kevL
  • Members
  • 4 056 messages

/ ok

 

-> back to the Marshes!



#24
kevL

kevL
  • Members
  • 4 056 messages

gotta love it ( no more Examine Examine Examine wher'd that witchdoctor go Examine Examine )
 

NWN2_SS_032914_200854.jpg

 

 

most effective Blade Barrier evar.
 

NWN2_SS_032914_202408.jpg



#25
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

gotta love it ( no more Examine Examine Examine wher'd that witchdoctor go Examine Examine )
 
NWN2_SS_032914_200854.jpg
 
 
most effective Blade Barrier evar.
 
NWN2_SS_032914_202408.jpg



No images ... ????