Aller au contenu

Photo

Get the current examined object?


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

#1
Ashw3

Ashw3
  • Members
  • 16 messages
I cant for the life of my find out how to get the current examined object via custom UI.

UIObject_Misc_ExtractData doesnt seem to do much... does anyone know the proper usage?

The script command relating to this (GetPlayerCreatureExamineTarget) doesnt actually work, so...

Thanks

#2
MasterChanger

MasterChanger
  • Members
  • 686 messages
I haven't looked directly at the Examine GUI, but my limited experience with GUIs makes me suspect that where you should start would be with the previous GUI: the context menu where the player clicks "Examine" in the first place. If you call an OnLeftClick script from that event you could probably get the examined target.

#3
kevL

kevL
  • Members
  • 4 074 messages
i can't remember if i tried to get the examined object per se,
but

GetPlayerCurrentTarget()

works in a gui_ script. Here's some of the GUI functions i found useful :

( "OnLeftClick" )
UIObject_Misc_ExecuteServerScript() - runs a custom script
UIObject_Input_ActionTargetScript() - runs a custom script against a target, Nb. target is passed to script as an INT !

( "OnUpdate" )
UIText_OnUpdate_DisplayTargetObjectName() - displays target name back to the gui


Trying to get a hold on the examined object rather than a targetted object, *might* not be doable.


ps. This is the context-menu node MC refers to:
<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>

an' it looks like one of those dastardly limited gui things,


Ashw3 wrote...

The script command relating to this (GetPlayerCreatureExamineTarget) doesnt actually work

2nd'd

Modifié par kevL, 22 avril 2012 - 08:41 .


#4
kevL

kevL
  • Members
  • 4 074 messages
hmm, good point MC

could you put an OnLeftClick action in there, that uses either

UIObject_Input_ActionTargetScript(), or even
UIObject_Misc_ExecuteServerScript()

that stores the current target (ie, examined object) as an object-variable for further uses? It should renew every time a new Examine is performed ..

#5
Ashw3

Ashw3
  • Members
  • 16 messages
I am doing this script so it works in the world-map camera view, which means that the previous gui doesnt show, it just goes straight to examine (or so I believe).
The reason I am using the world map gui is because I can control and lock the camera zoom distance. If I could do this with the normal camera modes, then I could hook into the target object ui, which would be easier...

#6
kevL

kevL
  • Members
  • 4 074 messages
oh ... might be SoL

Can you find what script/file causes the OL Examine to auto-pop? I looked, briefly, & Right now i figure that's just the nature of the beast ..


sry,

#7
Ashw3

Ashw3
  • Members
  • 16 messages
Yeah, the overland map function is extremely shoddily done. Did you know that certain hotkeys dont fire in the OL simply because they werent coded in? The GUI buttons for them work fine, but the hotkeys dont work.

Anyway, I got the camera to act like the overland map in normal mode, which was the only reason I was using it.

My new problem though is DE-SELECTING a selected target. If I can work out how to do that, I can have right/left mouse click fired instant abilities AKA diablo 2/3.
Thats all I am looking for atm.

#8
-Semper-

-Semper-
  • Members
  • 2 259 messages

Ashw3 wrote...

Anyway, I got the camera to act like the overland map in normal mode, which was the only reason I was using it.


could i ask what you did to restrict the camera in normal game mode?

#9
Ashw3

Ashw3
  • Members
  • 16 messages
This is what I did:

1: Set the Keymap.2da file to not have a camera move button and automatically apply the reset key defaults via gui OnAdd
2: Set the nwn2player.ini file to have 0.0 as the movement rates for a specific camera (looking into also doing this automatically by the GUI OnAdd)
3: Did an assigncommand(setcamerafacing)
4: Set the spawn in points to all face the actual direction, as setcamerafacing doesnt work right.

Doing this allowed me to replicate the overland map viewpoint.

#10
Dann-J

Dann-J
  • Members
  • 3 161 messages

Ashw3 wrote...

Yeah, the overland map function is extremely shoddily done. Did you know that certain hotkeys dont fire in the OL simply because they werent coded in? The GUI buttons for them work fine, but the hotkeys dont work.


That was deliberate. The OC OLM scripts removed the standard GUIs, which would have been pointless if the hotkeys still worked.

#11
Ashw3

Ashw3
  • Members
  • 16 messages

The GUI buttons for them work fine, but the hotkeys dont work.


They didnt disable the GUI's at all. They still come up if you open them with the player menu. They are still fully functional and work fine. Doing my remapping I discovered this, very frustratingly.