I would like to find out whether anybody come up with a way for the examine option on an item to cause an arbitrary image to appear? My goal is to allow the player to acquire maps during the game, then be able to view an image. Thank you.
Examine causes an image to be displayed?
Débuté par
rjshae
, avril 24 2012 09:56
#1
Posté 24 avril 2012 - 09:56
#2
Posté 24 avril 2012 - 10:11
Why just the examine option? You could always do a unique item property/cast spell - self only to initiate a tag-based script.
#3
Posté 24 avril 2012 - 10:17
I use a item, and a custom gui, to show the server map for the player. The item on use script triggers the gui interface, which holds the image.
#4
Posté 25 avril 2012 - 12:03
Hooking into the examine is quite nice, but the whole GUI system is a bit unwieldy to work with. It would be nice to be able to modify descriptions on the fly (via the examine) and possibly do things like adding buttons to the examine screen, too. (Perfectly possible, since I recall seeing it done)
#5
Posté 25 avril 2012 - 05:15
A very easy solution is to use tag based scripting. When you activate the item, it starts a one-node conversation. Then on the TGA to display for the conversation, you put the name of the TGA image you want to display.
You have to account for resizing of the image, but it works well. I did it for the maps in TWA1. You can look there for a reference.
You have to account for resizing of the image, but it works well. I did it for the maps in TWA1. You can look there for a reference.
#6
Posté 25 avril 2012 - 07:51
Thanks. Yes the mechanics of bringing up the map weren't so much the concern as how to just display an image file. I'll take a look at M. Rieder's approach. Merci beaucoup.
#7
Posté 25 avril 2012 - 09:31
If you open up my mod in the toolset, you want to look in one of the first areas and look for a placeable that is marked as a map. Look at the on used script for the map placeable. I think that is where it is.
#8
Posté 26 avril 2012 - 05:00
xml file... named _scmap.XML ( you also need image _SCmap.tga )
Then firing it off in the onitemactivate.nss as follows...
<?xml version="1.0" encoding="utf-8"> <UIScene name="SCREEN_DEXMAP" x=0 y=0 width=570 height=420 draggable=true idleexpiretime="1.0" modal="false" fadeout=.3 fadein=.3 backoutkey=true priority="SCENE_SCRIPT" scriptloadable="true"/><UIText name="DEXMAP_TITLE" strref="17044220" x=20 y=2 width=530 height=30 align=left valign=middle fontfamily="Title_Font" style="2" /> <UIButton name="CloseButton" x=530 y=7 style="STYLE_CLOSE_BUTTON" OnLeftClick=UIButton_Input_ScreenClose() /> <UIIcon name="MAP" img="_SCmap.tga" x=10 y=30 width=550 height=380 /> <UIFrame width="570" height="420" topleft="frame1_tl.tga" topright="frame1_tr.tga" bottomleft="frame1_bl.tga" bottomright="frame1_BR.tga" top="frame1_t.tga" bottom="frame1_b.tga" left="frame1_l.tga" right="frame1_r.tga" border=32 /> <UIIcon name="DETAIL_TOP" img="title_large04.tga" x=8 y=8 width=554 height=30 ignoreevents="false" /><UIIcon img="frame_main_bg.tga" x=10 y=9 width="550" height="405" />
Then firing it off in the onitemactivate.nss as follows...
else if ( sTag == "dex_dexmap" )
{
SendMessageToPC(oPC, "You open the map" );
DisplayGuiScreen(oPC, "SCREEN_DEXMAP", FALSE, "_SCmap.xml");
}
Modifié par painofdungeoneternal, 26 avril 2012 - 05:01 .
#9
Posté 27 avril 2012 - 10:51
That's actually quite a neat solution. Has anyone tried hooking into the examine, though? It's another of those things I've been meaning to get around to but just haven't. I think it would be a little... gainlier?
#10
Posté 27 avril 2012 - 03:09
i replaced the examine.xml, there is no way to know what is being examined though except using the current target script function, so it can be a little messy. A call back with the item name perhaps.
#11
Posté 27 avril 2012 - 03:37
Yes, I seem to remember that being the issue I had when I looked at the XML. Will the current target always be the item when the window is opened? If you stored that info then, you'd be fine (besides, I only want to alter the text/toggle something on the XML, nothing which should need to be updated, unless I get carried away). Otherwise, would it be possible to get a callback from the context menu?
#12
Posté 27 avril 2012 - 07:49
oh fun
Edit, fuller meal deal
I put a UIButton up near the Close button on the AreaMap gui gave it a tooltip and
where 'gui_kl_campaignmap' is basically Pain's onActivate script/code above. ( note, setting idleexpiretime= on the AreaMap caused crash to desktop ) The CampaignMap itself is again basically Pain's gui above; although i went through the extra step of adding the UIScene to 'ingameguix2.ini', under [MandatoryGUI]
get cretiva,
Edit, fuller meal deal
I put a UIButton up near the Close button on the AreaMap gui gave it a tooltip and
OnLeftClick='UIObject_Misc_ExecuteServerScript("gui_kl_campaignmap")'where 'gui_kl_campaignmap' is basically Pain's onActivate script/code above. ( note, setting idleexpiretime= on the AreaMap caused crash to desktop ) The CampaignMap itself is again basically Pain's gui above; although i went through the extra step of adding the UIScene to 'ingameguix2.ini', under [MandatoryGUI]
get cretiva,
Modifié par kevL, 28 avril 2012 - 03:09 .
#13
Posté 28 avril 2012 - 03:09
Fred,
the Examine gui is an excellent place to put little tools in! have a look :
fighting the Erinyes
NOTE the Target is not necessarily the same as the Examined object, as pointed out ...
I give full credit to Lance for the Target/Range/etc idea, although he insisted I learn to gui it myself
Also, along the top are a red button for Insta-kill, and the two blue buttons do a rather complicated TurnFactionHostile effort (for targetting neutrals at a distance w/ spells). This has various safeties and auto-return to Neutral/Friendly factions built in ... those are all Lance's ideas
i used stock Alignment icons for the buttons, and the Bard's Gui Tutorial for 87.3% of the rest
the Examine gui is an excellent place to put little tools in! have a look :
fighting the Erinyes
NOTE the Target is not necessarily the same as the Examined object, as pointed out ...
I give full credit to Lance for the Target/Range/etc idea, although he insisted I learn to gui it myself
i used stock Alignment icons for the buttons, and the Bard's Gui Tutorial for 87.3% of the rest
#14
Posté 28 avril 2012 - 03:32
^^ nice trick
#15
Posté 02 mai 2012 - 02:15
Good stuff! I should be able to use this. Thanks.
#16
Posté 02 mai 2012 - 02:25
I did read Lance's posts on the matter a while back. It's cool stuff. My only question was how you would get the target for scripting purposes? (Have not looked at this in ages... barely even opened the toolset this year...)
#17
Posté 02 mai 2012 - 04:05
GetPlayerCurrentTarget( );
?
xx GetPlayerCreatureExamineTarget( ); xx <- does not work
I'm really not sure what you're asking tho, Fred -- if you want i can throw the scripts at ya, although its not in the state of a stand-alone package (and likely never will be)
SetDescription( ) is problematic ...
and, although you might be able to store the current target as a variable, to maintain the 'examined target' -- i didn't go that route
?
xx GetPlayerCreatureExamineTarget( ); xx <- does not work
I'm really not sure what you're asking tho, Fred -- if you want i can throw the scripts at ya, although its not in the state of a stand-alone package (and likely never will be)
SetDescription( ) is problematic ...
and, although you might be able to store the current target as a variable, to maintain the 'examined target' -- i didn't go that route
#18
Posté 22 mai 2012 - 10:15
hey, i just noticed the function seems to work when called in a gui-script, at least from the companion-examine screen.kevL wrote...
xx GetPlayerCreatureExamineTarget( ); xx <- does not work
e, the CREATURE_EXAMINE screen, doh!
Modifié par kevL, 22 mai 2012 - 07:46 .





Retour en haut







