Aller au contenu

Photo

Creature "Name" Bubble - Is Its XML Available?


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

#26
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

ah, Thank you.

one good turn deserves another:<SNIPPED>


Hi KevL,

I decided to expand the fov to allow a return of more what the player can "see" on the screen rather than the PC. The figure of "100" was reached by trial and error, but felt like it gave the best results of "maximum catch" of creatures on screen and prevent those "behind" that caused the problem. Let me know if you have any different results that may be good to know.

Thanks for knocking out the function. Saved me having to play around with vectors ... they take me a while to work out where they start from.

EDIT: I may even try increasing the figures further to find the "sweet spot" to get best all around results without the "floating above" of those behind. I think "110" may be the max.

EDIT 2: Alternatively, is there a way to calculate fov from the perspective of the "player" as they view the screen? I ask this because a PC can be looking one way, while the player is looking another. i.e. Can the same functions be used to compensate/correct the current fov values to that of the player? I think access to the player's perspective is rather limited, although I know it can be done with respect to VFXs. I started looking at the "camera" functions, but not sure if they still work in NWN2.

Lance.
 
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 > 110.f || fDiff < -110.f)
    {
        return FALSE;
    }

    return TRUE;
}


#27
kevL

kevL
  • Members
  • 4 056 messages

Try this:

http://s26.postimg.o...2914_200854.jpg
http://s26.postimg.o...2914_202408.jpg



I decided to expand the fov to allow a return of more what the player can "see" on the screen rather than the PC. The figure of "100" was reached by trial and error, but felt like it gave the best results of "maximum catch" of creatures on screen and prevent those "behind" that caused the problem. Let me know if you have any different results that may be good to know.

For now, at least, I'm running without the FoV function. I use a cutoff at 60m from PC. I still get the occasional 'reflection'

But the way I play, with much pausing, means i want to be able to pause and look around 360.

Thanks for knocking out the function. Saved me having to play around with vectors ... they take me a while to work out where they start from.

I thought of (0,0,0) as the upper left corner of the map. It might not be, but since the function is 'general'/relative it shouldn't/doesn't matter exactly where the start actually is ... have been picking this stuff up mainly by osmosis over the past year.

EDIT: I may even try increasing the figures further to find the "sweet spot" to get best all around results without the "floating above" of those behind. I think "110" may be the max.

Sounds about right. The reflections i've seen have always been near the center, in a 60-ish FoV

EDIT 2: Alternatively, is there a way to calculate fov from the perspective of the "player" as they view the screen? I ask this because a PC can be looking one way, while the player is looking another. i.e. Can the same functions be used to compensate/correct the current fov values to that of the player? I think access to the player's perspective is rather limited, although I know it can be done with respect to VFXs. I started looking at the "camera" functions, but not sure if they still work in NWN2.

There don't seem to be enough camera functions to do this. ie: GetCameraFacing() doesn't exist afaik.

Further, They never did sort everything out as they added more camera-options with the expansions. Previous tests indicate only Exploration mode, and maybe Character mode, are compatible with available NwScript functions. IIRC

Otherwise it would be as simple as replacing GetFacing(oPC) w/ GetCameraFacing() ! But i can't even find a function that says what mode the camera is currently in,


/coffee


although I know it can be done with respect to VFXs.

? am trying to think of a way.. because, even with limited FoV, if the PC is facing the player, wouldn't there *still* be a potential for reflection???

#28
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Try this:

http://s26.postimg.o...2914_200854.jpg
http://s26.postimg.o...2914_202408.jpg

 <SNIP>


Hi KevL,

I ran into the same camera restrictions, and decided that the method we currently have is probably as good as it is going to get unless someone has an epiphany.

Pictures: The first one eventually came through, but I still cannot see the second image. :( Not to worry though.

Cheers,
Lance.

#29
kevL

kevL
  • Members
  • 4 056 messages

if even there were a way to place an object on the map, that is centered in the Player's FoV ... wrt the PC i guess ( ie. not the PC itself )



#30
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,

I have not yet found a way to automate this, but you can right-click on the chat window and deselect "SHOUT MESSAGES", which will turn off all the shouts the NPCs make when the GUI is used. The only downside is if you wanted "some" shouts, as it will stop ALL shouts reaching the chat window. As it happens, I will probably do this for my own use, as I don't really need the shouts to the chat window for anything as far as I can see. :)

In the meanwhile, if anybody does help me to be able to automate the "shouts" to the CHAT window, I will let you know.

Lance.