tag:blogger.com,1999:blog-71411247202158484502024-03-13T11:45:57.233-07:00Obsidian ProgrammerTechnical Info for NWN2. All information in these posts is free to take and distribute.Unknownnoreply@blogger.comBlogger26125tag:blogger.com,1999:blog-7141124720215848450.post-84694167539861942032007-04-18T17:18:00.000-07:002007-04-18T17:50:31.295-07:00UIListBoxWhew, sorry for not finishing off the <span class="blsp-spelling-error" id="SPELLING_ERROR_0">UI</span> Objects. There's not too many left to document here before all the basic <span class="blsp-spelling-error" id="SPELLING_ERROR_1">UI</span> types should be covered, I think...<br /><br />Anyway, on to <span class="blsp-spelling-error" id="SPELLING_ERROR_2">UIListBox</span>. <span class="blsp-spelling-error" id="SPELLING_ERROR_3">UIListBox</span> is a container similar to <span class="blsp-spelling-error" id="SPELLING_ERROR_4">UIPane</span> and anything listed under <span class="blsp-spelling-error" id="SPELLING_ERROR_5">UIPane</span> that makes sense for <span class="blsp-spelling-error" id="SPELLING_ERROR_6">UIListBox</span> probably does the same thing under <span class="blsp-spelling-error" id="SPELLING_ERROR_7">UIListBox</span>. So I'm going to stick to discussing the attributes that are unique to <span class="blsp-spelling-error" id="SPELLING_ERROR_8">UIListBox</span>. Refer to <span class="blsp-spelling-error" id="SPELLING_ERROR_9">UIPane</span> for the basic attributes (Like X, Y, Height, Width, etc).<br /><br />There's a couple different ways list boxes are used.<br />A list box can be used for displaying multiple rows of objects. Things like the Feat List or the lines of text in the chat windows use it this way. This is accomplished by just adding multiple objects to the list box. Typically these objects are the same size, but that is not a requirement.<br /><br />A list box can also be used for containing a single large text field and being able to scroll over that text field. This can be seen in places like the class and race descriptions on character creation. This approach is accomplished by having a single text field within the list box, making the height of the text field dynamic, and changing the text of the text field. The <span class="blsp-spelling-error" id="SPELLING_ERROR_10">listbox</span> will allow for scrolling over the large text field.<br /><br />Another note, I may use the term 'control' a lot in this write up. 'Controls' in this context are the contents of the list box. These are different than 'children' of the list box, which would include every object contained by the <span class="blsp-spelling-error" id="SPELLING_ERROR_11">listbox</span>, like the <span class="blsp-spelling-error" id="SPELLING_ERROR_12">scrollbar</span>. I will try to call controls 'rows' to make it more clear, but if I slip up and call it a 'control,' I'm talking about a row. =)<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_13">xPadding</span></strong><br />The amount of padding that the <span class="blsp-spelling-error" id="SPELLING_ERROR_14">listbox</span> should put between the edges of the <span class="blsp-spelling-error" id="SPELLING_ERROR_15">listbox</span> and the contents of the <span class="blsp-spelling-error" id="SPELLING_ERROR_16">listbox</span>. This padding is applied equally to both sides. So if the padding is 5, and the <span class="blsp-spelling-error" id="SPELLING_ERROR_17">ListBox</span> is 100 pixels wide, then the <span class="blsp-spelling-error" id="SPELLING_ERROR_18">ListBox</span> will constrain the rows to a max width of 90.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_19">yPadding</span></strong><br />The <span class="blsp-spelling-error" id="SPELLING_ERROR_20">amoutn</span> of padding that the list box puts between each row. This includes padding between the top row and the top of the list box and the bottom row and the bottom of the list box as well.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_21">snaptobottom</span></strong><br />Setting this to 'true' will make it so that any time the text field in the <span class="blsp-spelling-error" id="SPELLING_ERROR_22">listbox</span> gets <span class="blsp-spelling-error" id="SPELLING_ERROR_23">resized</span>, the <span class="blsp-spelling-error" id="SPELLING_ERROR_24">listbox</span> will snap to the bottom to show the bottom of the text. This is used mostly for situations where text keeps getting added to a text field and you want the list box to keep scrolling to the bottom to display all the text. This is not how the chat window works, BTW.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_25">scrollsegmentsize</span></strong><br />This is how many pixels you want the <span class="blsp-spelling-error" id="SPELLING_ERROR_26">listbox</span> to scroll for each 'scroll click' on the part of the user. The parameter is a number, the default <span class="blsp-spelling-error" id="SPELLING_ERROR_27">vaule</span> is 1.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_28">unequalcontrols</span></strong><br />This is a somewhat complicated attribute. If you don't have any preference, it's usually best to just set it to true. The purpose of it is to speed up performance on list boxes where each row is the same height. So if your list box will definitely have each row with the same height, then set this to false to speed up scrolling with that list box. <br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_29">showpartialchild</span></strong><br />This tells the list box if it should just clip the bottom row if it can't show the entire row. Defaults to true, parameters are 'true' or 'false.'<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_30">scrollbaronright</span></strong><br />Setting this to true moves the <span class="blsp-spelling-error" id="SPELLING_ERROR_31">scrollbar</span> over to the right side of the list box. Setting it to false will move the scroll bar to the left side of the list box. The default behavior is 'true'. <br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_32">selectonleftclick</span></strong><br />This tells the game that you want the user to be able to click on the rows of the list box. This means that the list box is intended to contain a number of rows and you want the user to pick a row. It is false by default. If false, then clicking on a row will perform the '<span class="blsp-spelling-error" id="SPELLING_ERROR_33">LeftClick</span>' callback if you click on a button row, or will set the text field as the focus if there is just a single large text field in the list box. If by true, clicking on the row will still execute the <span class="blsp-spelling-error" id="SPELLING_ERROR_34">OnLeftClick</span> callback for the button if there is one. It will also set that row as selected.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_35">hidescrollbarwhennotneeded</span></strong><br />If this is set to true, the <span class="blsp-spelling-error" id="SPELLING_ERROR_36">scrollbar</span> will be hidden unless there are enough contents within the list box to require scrolling to see them all. Defaults to false.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_37">hidescrollbar</span></strong><br />If this is set to true, then the <span class="blsp-spelling-error" id="SPELLING_ERROR_38">scrollbar</span> will be hidden no matter what. This is for the rare case you may want text to scroll by but don't care to have the user being able to scroll back up. Defaults to false.<br /><br />If the engine finds a <span class="blsp-spelling-error" id="SPELLING_ERROR_39">UIFrame</span> nested within a <span class="blsp-spelling-error" id="SPELLING_ERROR_40">ListBox</span> while loading the XML, it treats that Frame as a border for the full size of the list box. I'm not sure if this ever saw any actual testing though, as I believe we usually just added a <span class="blsp-spelling-corrected" id="SPELLING_ERROR_41">separate</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_42">UIFrame</span> to the Scene to act as the border. <br /><br />If the engine finds a <span class="blsp-spelling-error" id="SPELLING_ERROR_43">UIScrollBar</span> nested within a <span class="blsp-spelling-error" id="SPELLING_ERROR_44">ListBox</span> while loading the XML, that <span class="blsp-spelling-error" id="SPELLING_ERROR_45">scrollbar</span> will become the <span class="blsp-spelling-error" id="SPELLING_ERROR_46">scrollbar</span> for the <span class="blsp-spelling-error" id="SPELLING_ERROR_47">ListBox</span> and be attached to the left or right depending on the attributes.<br /><br />A <span class="blsp-spelling-error" id="SPELLING_ERROR_48">listbox</span> can contain the following types of <span class="blsp-spelling-error" id="SPELLING_ERROR_49">UIObjects</span> as its rows:<br />Button, Label, <span class="blsp-spelling-error" id="SPELLING_ERROR_50">Hotbarbutton</span>, Text, <span class="blsp-spelling-error" id="SPELLING_ERROR_51">Collapsable</span>, Pane, Grid, Icon, <span class="blsp-spelling-error" id="SPELLING_ERROR_52">TextTree</span><br /><br />If the object found has an attribute called 'prototype=true', then that object becomes the <span class="blsp-spelling-error" id="SPELLING_ERROR_53">ProtoType</span> for the list box. The prototype defines all the attributes, styles, etc., that each row that is added dynamically to the <span class="blsp-spelling-error" id="SPELLING_ERROR_54">listbox</span> should have. Unfortunately, this is something better experimented with to understand rather than me trying to explain. :) But in brief, find a <span class="blsp-spelling-error" id="SPELLING_ERROR_55">listbox</span> that has a prototype object in the game, and see what effect changing the prototype's attributes have on the way the <span class="blsp-spelling-error" id="SPELLING_ERROR_56">listbox</span> rows look in the game.<br /><br />Anyway, that's all I have to write about <span class="blsp-spelling-error" id="SPELLING_ERROR_57">ListBox</span> at the moment. I thought there would be more than this to write about it, so I imagine I'm missing some stuff. As always, just ask if I've neglected to cover some topic about <span class="blsp-spelling-error" id="SPELLING_ERROR_58">UIListBox</span>.Unknownnoreply@blogger.com82tag:blogger.com,1999:blog-7141124720215848450.post-67944312736171357582007-04-06T14:41:00.000-07:002007-04-06T14:47:00.574-07:00Small 1.06 fixesJust a note about a few more 1.06 things. But first, regarding 1.05 Final, it seriously, really, probably, maybe, should be coming out early next week... That's about all I know about it. =)<br /><br />EnableAreaWater() - Turn water rendering on/off in an area.<br />SpeakOneLinerConversation() - Now takes a volume parameter (Only supports talk, whisper, and shout)<br />SetScale() - changed to accept x, y, z axis as parameters<br />Dedicated Server now correctly lists modules in directory format that are located in the MyDocs directories.<br />Dedicated Server now takes a -moduledir parameter to allow launching modules stored in directory format to be loaded via command line parameters.Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-7141124720215848450.post-56817281607015244622007-03-30T10:22:00.000-07:002007-03-30T10:38:08.288-07:00Scripting UpdateHere's a list many of the scripting changes made in 1.06 so far. Most of them come from the 1.67 and 1.68 updates of NWN1.<br /><br />ActionRest() - The bIgnoreNoRestFlag wasn't actually doing anything. It will now force rest even if the area is flagged NoRest or there are monsters nearby. If the character is still in combat, it will not force rest.<br /><br />CreateItemOnObject() - Added new string parameter to provide the newly created object a new tag.<br /><br />EffectHeal() now works on doors and placeables.<br /><br />GetAbilityScore() now takes a 'nBaseAttribute' parameter to allow querying just the base attribute.<br /><br />OnClick event for placeables that fires whether or not the player can actually path to them.<br /><br />SpeakConversationOneLiner() now takes a parameter to determine if the spoken line should have whisper, talk, or shout volume.<br /><br />Added:<br />CreateTrapAtLocation()<br />CreateTrapOnObject()<br />GetAreaSize()<br />GetInfiniteFlag()<br />GetKeyRequiredFeedback()<br />GetPickpocketableFlag()<br />GetPlaceableLastClickedBy()<br />GetTrapActive() - (Now works on doors and placeables too)<br />GetTrapRecoverable()<br />SetFortitudeSavingThrow()<br />SetReflexSavingThrow()<br />SetWillSavingThrow()<br />SetHardness<br />SetInfiniteFlag()<br />SetKeyRequiredFeedback()<br />SetLockKeyRequired()<br />SetLockKeyTag()<br />SetLockLockable()<br />SetLockLockDC()<br />SetLockUnlockDC()<br />SetModuleXPScale()<br />SetPickpocketableFlag()<br />SetTrapDetectable()<br />SetTrapDetectDC()<br />SetTrapDisarmable()<br />SetTrapDisarmDC()<br />SetTrapKeyTag()<br />SetTrapOneShot()<br />SetTrapRecoverable()<br />SetUseableFlag()<br /><br /><br />I also added a couple console commands to help with GUI debugging<br />openuiscreen <screen_name> [<file_name>]<br />closeuiscreen <screen_name><br />unloaduiscreen <screen_name><br /><br />Also added a console command:<br />guidebug <on/off> [MOUSEINPUT] [MOUSEOVER] [CALLBACKS]<br /><br />This brings up an extra 'chat' window and will provide engine-level debugging info about mouse-overs, mouseinput, or callback execution. This feature isn't really finished as of this post, but I hope to spend some more time polishing it up for 1.06.<br /><br />There are some new toolset features and bug fixes. The bug with seams showing up between tiles has been fixed as well as issues with Specular lighting not looking right. There is also now 5-level terrain undo for grass, water, and terrain adjustment and some improvements to some of the brushes.<br /><br />There's some other things as well, but this is a pretty good sampling of the new things that will be in 1.06.Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-7141124720215848450.post-63279887377287939892007-03-14T17:40:00.000-07:002007-03-14T17:43:25.871-07:001.06 ProgressThe 1.05 beta was posted today. One tweak that I intend to have made before 1.05 final is to remove the 'tabs = 5 spaces' change in the script editor. While some people do want some option like that, I think it needs to be implemented as something that can be turned on/off/adjusted, so for now, it's best to leave it out and re-implement it correctly in 1.06.<br /><br />As far as 1.06 goes, I've spent a lot of time this week integrating a lot of the NWN1 1.67 changes, especially the script functions. I won't go into details now, but I will once I'm done. But in summary, most of the script functions that have been missing from NWN1's later patches should be in 1.06.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-7141124720215848450.post-58152492785777055732007-03-05T18:31:00.000-08:002007-03-05T18:32:03.618-08:00GDCWarning, incoming period of silence. :)<br />I'll be at GDC this week, so probably won't have any updates until next week.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7141124720215848450.post-72189204759215497242007-03-05T18:00:00.000-08:002007-03-05T18:31:00.515-08:00UIObject_Input_ActionTargetScriptThis callback will one of the most powerful new tools when it comes to creating custom actions in the game.<br /><br />UIObject_Input_ActionTargetScript(), new in 1.06, will let you make 'GUI actions' similar to the 'actions' that are created when you click on a spell or feat button to cast it, or on a button in the DM Choser that then has you select a target to do the action to.<br /><br />Once the user clicks on a valid target, a bunch of data will be sent to the server along with a request to execute a script associated with the click.<br /><br />Anyway, enough summary, here's the details:<br /><br />UIObject_Input_ActionTargetScript("sValidTargetTypes",nValidCursor,nInvalidCursor,nSpellTargetIndex,bUseHostile,"sScriptName", script parameter list...)<br /><br /><strong>sValidTargetTypes</strong><br />This parameter is a string that will list the types of objects that will be valid to click on. If you enter a "", that means all targets are valid for this action. Otherwise, you can enter a list, seperated by commas or any other deliminator you want to use. The valid target names are:<br />self<br />creature<br />ground<br />item<br />door<br />placeable<br />trigger<br /><br />For example: "creature,placeable" would mean that valid targets would include clicking on placeables and clicking on creatures.<br /><br /><strong>nValidCursor</strong><br />This is an integer constant to point to one of the cursors that the engine understands. You can only really use the cursors compiled into the game's executable. I will make a list of those constants at the end of this post. This is the cursor that you want to use when the cursor is over a valid target. <br /><br /><strong>nInvalidCursor</strong><br />Just like the nValidCursor parameter, except this is the cursor you want displayed when the mouse is over an invalid target. For example, if my valid targets were creatures and placeables, but the mouse was over open ground, this is the cursor that would be shown.<br /><br /><strong>nSpellTargetIndex</strong><br />This is a reference into the spelltarget.2da to indicate that you want to use one of the spell targeting projected textures like the ones used when targeting Area of Effect spells. If you do not want an AoE texture around the cursor, just enter -1 for this parameter.<br /><br /><strong>bIsHostile</strong><br />This tells the engine if you want to use the Hostile Texture column from spelltarget.2da or not. If you entered -1 for nSpellTargetIndex, then this parameter doesn't mean anything. You must enter either "true" or "false", even if you entered -1 for nSpellTargetIndex.<br /><br /><strong>sScriptName</strong><br />The name of the script you want to follow. This follows the same restrictions that UIObject_Misc_ExecuteServerScript() usese, in that the script name must start with 'gui_', or else the server will reject the request.<br /><br /><strong>Parameter List</strong><br />This is an unlimited list of parameters just like ExecuteServerScript() supports. However, there are a few extra parameters that this function can support:<br />target.object - This will replace the parameter with the OBJECT_ID of the object that the user clicked on.<br />target.x - This will replace the parameter with the X value of the position that the user clicked on as a float. If the user clicked on a specific object, instead of open ground, then this X will be the position of that object as far as the client knows. Since the client could be a few milliseconds out of synch with the server, the server may consider this object at a slightly different position than the client does.<br />target.y - Same as X, except for the Y value of the position vector.<br />target.z - Same as X, except for the Z value of the position vector.<br /><br />For example, if I wanted to create a DM Action button that deleted whatever placeable the DM targetted as well as all placeables within 15 yards of the target, I would create a UIButton with the following callback:<br />OnLeftClick=UIObject_Input_ActionTargetScript("placeable",51,53,17,"true","gui_eraseplaceables","target:object")<br /><br />The number 51 would be for the CURSOR_KILL cursor, the number 53 would be for the CURSOR_NOKILL cursor, the number 17 would be for row 17 in spelltarget.2da whcih is a large circle with a 30 yard width (so 15 yard radius), and the "true" is because I want it to use the hostile texture out of that 2DA. I want to use the clicked on placeable as my starting point, so I go ahead and pass that along as a parameter as well. It will be passed into gui_eraseplaceables as either a string or an int, depending on what parameter I have that script expecting.<br /><br />Anyway, the list of cursor constants is:<br /><br />#define MOUSECURSOR_DEFAULT 1<br />#define MOUSECURSOR_DEFAULT_DOWN 2<br />#define MOUSECURSOR_WALK 3<br />#define MOUSECURSOR_WALK_DOWN 4<br />#define MOUSECURSOR_NOWALK 5<br />#define MOUSECURSOR_NOWALK_DOWN 6<br />#define MOUSECURSOR_ATTACK 7<br />#define MOUSECURSOR_ATTACK_DOWN 8<br />#define MOUSECURSOR_NOATTACK 9<br />#define MOUSECURSOR_NOATTACK_DOWN 10<br />#define MOUSECURSOR_TALK 11<br />#define MOUSECURSOR_TALK_DOWN 12<br />#define MOUSECURSOR_NOTALK 13<br />#define MOUSECURSOR_NOTALK_DOWN 14<br />#define MOUSECURSOR_FOLLOW 15<br />#define MOUSECURSOR_FOLLOW_DOWN 16<br />#define MOUSECURSOR_EXAMINE 17<br />#define MOUSECURSOR_EXAMINE_DOWN 18<br />#define MOUSECURSOR_NOEXAMINE 19<br />#define MOUSECURSOR_NOEXAMINE_DOWN 20<br />#define MOUSECURSOR_TRANSITION 21<br />#define MOUSECURSOR_TRANSITION_DOWN 22<br />#define MOUSECURSOR_DOOR 23<br />#define MOUSECURSOR_DOOR_DOWN 24<br />#define MOUSECURSOR_USE 25<br />#define MOUSECURSOR_USE_DOWN 26<br />#define MOUSECURSOR_NOUSE 27<br />#define MOUSECURSOR_NOUSE_DOWN 28<br />#define MOUSECURSOR_MAGIC 29<br />#define MOUSECURSOR_MAGIC_DOWN 30<br />#define MOUSECURSOR_NOMAGIC 31<br />#define MOUSECURSOR_NOMAGIC_DOWN 32<br />#define MOUSECURSOR_DISARM 33<br />#define MOUSECURSOR_DISARM_DOWN 34<br />#define MOUSECURSOR_NODISARM 35<br />#define MOUSECURSOR_NODISARM_DOWN 36<br />#define MOUSECURSOR_ACTION 37<br />#define MOUSECURSOR_ACTION_DOWN 38<br />#define MOUSECURSOR_NOACTION 39<br />#define MOUSECURSOR_NOACTION_DOWN 40<br />#define MOUSECURSOR_LOCK 41<br />#define MOUSECURSOR_LOCK_DOWN 42<br />#define MOUSECURSOR_NOLOCK 43<br />#define MOUSECURSOR_NOLOCK_DOWN 44<br />#define MOUSECURSOR_PUSHPIN 45<br />#define MOUSECURSOR_PUSHPIN_DOWN 46<br />#define MOUSECURSOR_CREATE 47<br />#define MOUSECURSOR_CREATE_DOWN 48<br />#define MOUSECURSOR_NOCREATE 49<br />#define MOUSECURSOR_NOCREATE_DOWN 50<br />#define MOUSECURSOR_KILL 51<br />#define MOUSECURSOR_KILL_DOWN 52<br />#define MOUSECURSOR_NOKILL 53<br />#define MOUSECURSOR_NOKILL_DOWN 54<br />#define MOUSECURSOR_HEAL 55<br />#define MOUSECURSOR_HEAL_DOWN 56<br />#define MOUSECURSOR_NOHEAL 57<br />#define MOUSECURSOR_NOHEAL_DOWN 58<br />#define MOUSECURSOR_RUNARROW 59<br />#define MOUSECURSOR_WALKARROW 75<br />#define MOUSECURSOR_PICKUP 91<br />#define MOUSECURSOR_PICKUP_DOWN 92<br />#define MOUSECURSOR_CHATBOX_SIZING 99<br />#define MOUSECURSOR_NODEFAULT 125<br />#define MOUSECURSOR_NODEFAULT_DOWN 126<br />#define MOUSECURSOR_MAP 128<br />#define MOUSECURSOR_MAP_DOWN 127<br />#define MOUSECURSOR_NOMAP 130<br />#define MOUSECURSOR_NOMAP_DOWN 129<br />#define MOUSECURSOR_WAIT_DOWN 131<br />#define MOUSECURSOR_WAIT 132Unknownnoreply@blogger.com18tag:blogger.com,1999:blog-7141124720215848450.post-72286012691428901072007-03-02T10:38:00.000-08:002007-03-02T10:39:54.742-08:00IntToObjectThis is just a quick note to mention that I've added:<br />object IntToObject( int nInt );<br /><br />and<br /><br />int ObjectToInt( object oObj );<br /><br />scripting functions for 1.06.Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-7141124720215848450.post-50634742380374400692007-03-01T16:59:00.000-08:002007-03-01T19:15:14.085-08:00UIObject_Misc_ExtractDataSorry for the delay in posting, but if you're into custom UI work, this information will have been worth the wait. :)<br /><br />A new callback in 1.06 is:<br />UIObject_Misc_ExtractData( sourceobject, datatype, index, destinationvar )<br /><br />This callback can be used to extract the data imbedded by the engine within UI Objects. First I'll go over the parameters, then I'll give some examples.<br /><br /><strong>sourceobject</strong><br />This parameter is used to define which UI Object we are extracting data from. It accepts the following options:<br /><br />selected:listboxname - By replacing 'listboxname' with the name of the listbox you're interested in, you can tell this callback to use the selected row within the list box as the source of the data.<br /><br />self: - By using 'self:', you are telling the callback to use the object that invoked the callback as the source from which to extract the data.<br /><br />context:uiobject - By using context:uiobject:', you are telling the callback to use the UI Object that invoked the context menu. This obviously only means anything if the callback is being called from a context menu node. If called from anywhere else, the callback will do nothing.<br /><br />objectname - If you enter any string besides the above 3 options, the callback will search for a UIObject within the same scene as the object executing this callback that has that name.<br /><br /><strong>datatype</strong><br />The datatype tells the callback which data type it should be extracting from the UIObject. Note that regardless of what the original data type is, the data type that gets stored in the GUI Variable at the end will always be a string.<br /><br />The data type values are:<br />bool -'true' or 'false' are the strings that will get stored in the GUI variable<br />int<br />float<br />string<br />strref<br />objectid<br /><br />Again, it's important to remember that no matter what the originating data type is, the result will be stored as a string variable within the GUI variable specified.<br /><br /><strong>index</strong><br />This is the index of the data to extract. If the index is invalid for the UIObject, a default value will get stored in the GUI variable (Either "" or "0" or "false" depending on what the originating data type was).<br /><br /><strong>destinationvar</strong><br />This can be a local:# or global:#. The type of the stored data will always be a string.<br /><br /><strong>Example 1</strong><br />Now for some real examples that will work.<br /><br />The grid icons in the inventory grid have the following data imbedded in them:<br />OBJECT_ID(0) = The object currently displayed in that icon<br />OBJECT_ID(1) = The object that was dispalyed in that icon on the previous frame<br />int(0) = The stacksize for that object on the previous update frame<br />int(1) = Indicates if the item is identified or not<br />int(2) = Indicates if the item is usable or not<br />int(3) = Indicates if the item is ghosted or not<br /><br />It would be possible for me to change the inventory screen to drop items if I double right click on them.<br /><br />I would edit the 'InvPrototypeButton' inside of inventory.xml and add:<br /><br />OnRightDoubleClick0=UIObject_Misc_ExtractData("self:","objectid",0,local:3)<br />OnRightDoubleClick1=UIObject_Misc_ExecuteServerScript("gui_dropitem",local:3)<br /><br />When I right double click that item, the first callback will extract the Object ID of the item and place it in local:3 as a string that looks like: "32144" or whatever the object ID is.<br /><br />Then the 2nd callback would execute, asking the server to fire off the "gui_dropitem" script, and it would pass the 32144 value in as a parameter to the script (Either as a string "32144" or an integer 32144, depending on what the parameter type the script is expecting).<br /><br />Now I will be adding an IntToObject() script funciton that will make it possible to take that int parameter and turn it into an object parameter. At that point, you could use the DropItem action and have the player drop that object.<br /><br />Note that in this example, I would've had to remove the OnRightClick call to the context menu for the item button or it would end up blocking the double right click (Due to the context menu popping up and blocking the second click). <br /><br /><strong>Example 2</strong><br />This example is a lot more complicated, I'll try to explain it clearly. :)<br /><strong></strong><br />The spell buttons in the game usually have the following pieces of data:<br />int(0) = The spell ID that the button represents<br />int(1) = The multi-class index that can cast that spell<br />int(2) = Not used anymore, so nothing.<br />int(3) = The meta magic feat, if any<br />int(4) = Whether or not this is a spontanously cast spell<br />int(5) = Whether or not this is a domain spell<br />int(6) = Whether or not this is a cheat-command spell cast<br /><br />The values for int(3), the meta magic feat, are:<br />1 = Empower<br />2 = Extend<br />4 = Maximize<br />8 = Quicken<br />16 = Silent<br />32 = Still<br />64 = Persistent<br />128 = Permanent<br /><br />The warlock invocations are also meta-magic feats, as follows (Note, I'm not sure how many of these are actually in the game, I'm just going down the list of constants in the code):<br />256 = Draining Blast<br />512 = Eldritch Spear<br />1024 = Frightful Blast<br />2048 = Hideous Blow<br />4096 = Beshadowed Blast<br />8192 = Brimstone Blast<br />16384 = Eldritch Chain<br />32768 = Hellrime Blast<br />65536 = Bewitching Blast<br />13102 = Eldritch Cone<br />262144 = Noxious Blast<br />524288 = Vitrioloic Blast<br />1048576 = Eldritch Doom<br />2097152 = Utterdark Blast<br /><br />Let's say I want to make my own custom Examine Spell command for the spells_known.xml listing of spells.<br /><br />First off, let's add our own custom radial menu (Another new feature in 1.06).<br /><br />In spells_known.xml, I would go to the SPELLPANE_PROTO pane and add a<br />OnRightClick=UIObject_OnRadial_DisplayCustomRadial("root-customspell")<br /><br />root-customspell will be the name of a new root node that I would then add to the contextmenu.xml<br /><br />For now, that root node will only have 1 sub node called: node-spellexamine<br /><br />node-spellexamine will be the name of a new radial node that I would make with the following callbacks:<br />OnLeftClickExpanded0=UIObject_Misc_ExtractData("context:uiobject","int",0,local:5)<br />OnLeftClickExpanded1=UIObject_Misc_ExecuteServerScript("gui_spellexamine",local:5)<br />OnLeftClickCollapsed0=UIObject_Misc_ExtractData("context:uiobject","int",0,local:5)<br />OnLeftClickCollapsed1=UIObject_Misc_ExecuteServerScript("gui_spellexamine",local:5)<br /><br />Now when I go into the game and bring up the Spells Known screen and right click on the spell icon for a spell in the list, I will get a context menu with 1 item called 'Examine'. Clicking on that will first call:<br />UIObject_Misc_ExtractData()<br />which will extract the spell ID from int(0) on the button I brought the context menu up on and place that ID in local:5<br /><br />Then it will fire<br />UIObject_Misc_ExecuteServerScript()<br />and pass along the spell ID (As stored in local:5) as the parameter to the script: gui_spellexamine<br /><br />From there I can do whatever I want with that data. :)<br /><br />To recap, the new features mentioned in this article are:<br />UIObject_Misc_ExtractData()<br /><br />and<br /><br />UIObject_OnRadial_DisplayCustomRadial()<br /><br />Feel free to ask any time you would like me to provide a detailed list of what data is imbedded in a given UI Object. Some you'll probably be able to figure out on your own via trial and error, but I'll be happy to look into any specific UI Object if you need.Unknownnoreply@blogger.com64tag:blogger.com,1999:blog-7141124720215848450.post-57655936138318653182007-02-23T17:27:00.000-08:002007-02-23T17:33:31.363-08:00Couple new GUI script functions for 1.061.06 will have a number of new script functions that will give improved control over custom GUIs.<br /><br />Two of the new script functions are:<br /><br /><strong>SetGUIProgressBarPosition</strong>();<br /><br />This script function will let you set the position of a progress bar (Between 0.0 for empty and 1.0 for full).<br /><br />The other new function is:<br /><br /><strong>SetGUITexture</strong>();<br /><br />This script function will let you set the texture for a UIIcon, a UIFrame's fill texture, or a Button's Base Frame's fill texture.<br /><br />Both script functions require the UIScene to be scriptloadable like all the other GUI related scripting functions.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-7141124720215848450.post-58427270822551327832007-02-22T18:06:00.000-08:002007-02-22T18:23:38.698-08:00New UI Callback ParametersIn 1.06, callbacks can take 2 new 'variable' parameters in addition to global:# and local:#.<br /><br />The first new parameter type is<br />listboxrow:listboxname<br /><br />This will insert the row # that is currently selected in the listbox indicated by listboxname<br /><br />For example, if I had a callback that looked like:<br /><br />OnLeftClick=UIObject_Misc_ExecuteServerScript("myguiscript",listboxrow:mylb)<br /><br />On the same UIScene I have a listbox called 'mylb' where I have selected the 3rd row.<br /><br />When the OnLeftClick callback above gets executed, the 1 parameter that gets sent to that script will be an integer with the value of 2. (The first row in the LB would send a value of 0).<br /><br /><br />The second new parameter type also deals with ListBoxes:<br />listboxtext:listboxname[.textfieldname]<br /><br />This will insert the text contained by that row. If the listbox rows are buttons or text fields, then the textfieldname parameter above is not necessary. If instead they are complex UI Panes, then the textfieldname will be used to specify which object within the pane contains the text we want.<br /><br />For example, if I had a callback that looked like:<br />OnLeftClick=UIObject_Misc_ExecuteServerScript("myguiscript",listboxtext:mylb.mytext)<br /><br />In the same UIScene, I have a Listbox named 'mylb'. The rows of that lb are complex UIPanes that contain a text field in them called 'mytext'.<br /><br />When that callback executes, the engine will look at 'mylb', find the currently selected row, then look for the object named 'mytext' within that row and insert the text within that object as a parameter to the script on the server.<br /><br />Now obviously the real power of these new variable parameters will be when coupled with the ability for scripts to populate a gui listbox. That functionality isn't in yet, but is something else I intend to have in for 1.06.<br /><br /><br />There are other new 'variable' parameter syntaxes that will be coming along with 1.06 that I'll post about once I have actually implemented them. :)Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-7141124720215848450.post-71417007025077365022007-02-19T10:45:00.000-08:002007-02-19T10:48:24.000-08:00UIButton_OnUpdate_ControlSelectedThis callback takes a single parameter. It's only purpose is to enable or disable a button based on whether or not the user has selected a row in a List Box.<br /><br />The single parameter is:<br /><span class="blsp-spelling-error" id="SPELLING_ERROR_0">sListBoxName</span> = The name of the list box we want to check for selection.<br /><br />If the user has a row selected in the <span class="blsp-spelling-error" id="SPELLING_ERROR_1">listbox</span> named in the parameter, then the <span class="blsp-spelling-error" id="SPELLING_ERROR_2">UIButton</span> will be set to Enabled.<br /><br />If the user does not have a row selected in the <span class="blsp-spelling-error" id="SPELLING_ERROR_3">listbox</span> named in the parameter, then the <span class="blsp-spelling-error" id="SPELLING_ERROR_4">UIButton</span> will be disabled.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7141124720215848450.post-42344050822292922952007-02-19T10:21:00.000-08:002007-02-19T10:31:43.551-08:00UIObject_Misc_StoreObjectDataThe only valid parameter to this callback is a local or global GUI variable index.<br /><span class="blsp-spelling-error" id="SPELLING_ERROR_0">localguivars</span> are expressed as local:#, where # is the index for the variable.<br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_1">globalguivars</span> are expressed as global:#, where # is the index for the variable.<br /><br />This callback takes the engine-level data in a <span class="blsp-spelling-error" id="SPELLING_ERROR_2">UIObject</span> and stores it in a global or local <span class="blsp-spelling-error" id="SPELLING_ERROR_3">gui</span> variable. The engine-level data will vary from <span class="blsp-spelling-error" id="SPELLING_ERROR_4">UIObject</span> to <span class="blsp-spelling-error" id="SPELLING_ERROR_5">UIObject</span>. It is also impossible to specify which data item you want to set the GUI variable to, if the <span class="blsp-spelling-error" id="SPELLING_ERROR_6">UIObject</span> has multiple items of data. <br /><br />This is a really old callback and is of limited use to custom <span class="blsp-spelling-error" id="SPELLING_ERROR_7">GUIs</span> at this time. My intent is to write a new callback that accomplishes what this callback does, but that takes more parameters in order to more accurately specify what data you are interested in from the <span class="blsp-spelling-error" id="SPELLING_ERROR_8">UIObject</span>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7141124720215848450.post-29495389153928795492007-02-19T09:53:00.000-08:002007-02-19T10:21:32.417-08:00UIObject_Tooltip_DisplayTooltipStringUIObject_Tooltip_DisplayTooltipString takes up to 9 parameters, but only the first four parameters are required.<br /><br />Parameter list:<br />Message = The literal string to display in the tooltip<br /><br />XLoc = The X origin for where the tooltip should appear. This can be a pixel location, or you can use the following two strings to make it relative: MOUSE_X will place the X origin of the tooltip near where the mouse is. OBJECT_X will place the tooltip next to the UIObject that is being moused over, if any. At first, it will try to place the tooltip to the right side of the UIObject. But if there is not enough screen space to fit the tooltip there, it will place it on the left side of the UIObject.<br /><br />YLoc = The Y origin for where the tooltip should appear. This can be a pixel location, or you can use the following two strings to make it relative: MOUSE_Y will place the Y origin of the tooltip near where the mouse is. OBJECT_Y will place the tooltip next to the UIObject that is being moused over, if any. At first, it will try to place the tooltip on top of the UIObject. But if there is not enough screen space to fit the tooltip there, it will place it on the bottom of the UIObject.<br /><br />Screen Tag = The Screen Tag for the XML file to be used for the tooltip<br /><br />XAlignment = This parameter can be used to quickly position a tooltip relative to the full-screen space. The valid arguments are: ALIGN_NONE(default), ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT<br /><br />YAlignment = This parameter can be used to quickly position a tooltip relative to the full-screen space. The valid arguments are: ALIGN_NONE(default), ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM<br /><br />XPadding = This is used along with XAlign to quickly position the tooltip. It controls how far in the tooltip should be pushed from the left or right border of the screen space. For example, setting XAlignment to ALIGN_RIGHT and XPadding to 10 will result in the tooltip appearing on the right side of the screen, with a space of 10 pixels between the right edge of the tooltip scene and the edge of the screen.<br /><br />YPadding = This is used along with YAlign to quickly position the tooltip. It controls how far in the tootip should be pushed from the top or bottom border of the screen space. For example, setting YAlignment to ALIGN_BOTTOM and YPadding to 10 will result in the tooltip appearing on the bottom of the screen with a space of 10 pixels between the bottom edge of the tooltip scene and the edge of the screen.<br /><br />TextAlignment = How the text should be aligned in the tooltip. The options are: ALIGN_NONE(default), ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TOP, ALIGN_BOTTOMUnknownnoreply@blogger.com4tag:blogger.com,1999:blog-7141124720215848450.post-5836142057424391932007-02-19T09:30:00.000-08:002007-02-19T09:45:15.655-08:00Multiple Callbacks Per EventIn 1.06, it will be possible to set up multiple GUI callbacks on a single UI event in XML. The syntax will be to use the event name and append a number to it. The engine will read in the callbacks until it fails to find the next sequential number.<br /><br />For example, I could set up a UI Button to with the following callbacks:<br /><br />OnUpdate=UIObject_OnUpdate_DisableIfLocalVarEquals(local:3,"true")<br />OnLeftClick=UIObject_Input_ScreenOpen("SCREEN_OPTIONS","false")<br />OnLeftClick0=UIObject_Input_SetLocalVarString(local:3,"true")<br /><br />When I click that button, it would open the Options screen, then set the local var to "true". On its next update, it would become disabled because of the OnUpdate check.<br /><br />Note that the callback without a number will be handled before the 0'th callback. <br />So OnLeftClick will be handled before OnLeftClick0.<br /><br />Also note that the callback without the number is not required but is mostly just supported for backwards compatibility.<br /><br />For example, it would be valid to have the following callbacks:<br /><br />OnLeftClick0=<br />OnLeftClick1=<br />OnLeftClick2=<br /><br />That will work fine, executing 0, then 1, then 2.<br /><br />It is also valid to have:<br />OnLeftClick=<br />OnLeftClick0=<br />OnLeftClick1=<br />OnLeftClick2=<br /><br />This will execute them in order.<br /><br />It is not valid to start with any other number besides 0 however.<br /><br />OnLeftClick1=<br />OnLeftClick2=<br />OnLeftClick3=<br /><br />will result in no callbacks being loaded for that event for that UIObject.<br /><br />Sometimes the engine assigns callbacks to UIObjects internally. The engine will only ever override the first callback, so if you are having a problem with the engine overriding your callback for some UI Object, you might need to insert a dummy callback first, before the callbacks you actually want to execute. This doesn't happen too often though, so I doubt this will be an issue for very many.<br /><br />Note at this time, the only event that doesn't support multiple callbacks is OnTooltip, due to how the engine has to handle this event internally. I may or may not be able to fix OnTooltip by the time 1.06 comes out.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7141124720215848450.post-79230052575539704002007-02-12T13:47:00.000-08:002007-02-09T17:00:27.598-08:00Special ScreensTaking a break from writing about the UI Elements for a moment, though there are still some of those that I will cover in future posts.<br /><br />Most XML files are loaded as default UI Scene, which implies no special behaviors. There are, however, several XML files that will get special handling in code and most conform to specific rules in order to even be loaded. All of these scenes are distinguished by their identifying name in the INI file (Or the screen tag given to them when being loaded via script). The actual XML file name doesn't matter.<br /><br />Note that when I list them below, if a name ends with a * mark, that means that only the text up to the * mark is required and that the name may be unique after that mark.<br /><br />The following are special GUI screens that are loaded differently than most XML files:<br /><br />SCREEN_FADE = The full screen 'fade' effect. It gets loaded like a normal XML file at first. After loaded, the first UIIcon object found (The one highest up in the file) becomes the engine's 'Fading' icon. The rest of the contents of the file will behave normally. In our default SCREEN_FADE, we include just the full screen icon. But there may be other things one would want to include on the fade, such as custom images, etc.<br /><br />SCREEN_QUICKCHAT = The NWN1 style dialog box. First it is loaded like a normal XML file, then the following ui objects are searched for in order for the engine to use them:<br /> npclistbox - Listbox of NPC spoken text<br /> npctext - Text field for NPC spoken text (Contained by npclistbox generally)<br /> replieslistbox - Listbox of Player Reply options<br /> skipdialogbutton - Button for skipping through the NPC spoken nodes<br /> speakername - Text field for containing the speaker's name<br /> portrait - UIPortrait object<br /> All but the speakername and portrait fields are necessary or the window will not be loaded.<br /><br />SCREEN_CUTSCENE = The fill screen cutscene view with the black bars on the top and bottom. This window is loaded like any other, then the following objects are searched for by the engine:<br /> topbar - UIFrame for the top black bar<br /> bottombar - UIFrame for the bottom black bar<br /> FULLSCREEN_IMAGE - UIIcon used for full screen images.<br /> toplistbox - Listbox to contain the text shown on top<br /> toplistboxtext - Textfield contained by toplistbox<br /> bottomlistbox - Listbox to contain the text shown on the bottom. Spoken by NPCs<br /> bottomlistboxtext - Text field contained by bottomlistbox<br /> replieslistbox - Listbox to contain the replies available to a player.<br /> skipdialogbutton - Fullscreen button for clicking through the dialog<br /> Failure to locate any of the above objects will result in the screen not loading.<br /><br />SCREEN_CONTEXTMENU = The rightclick menu system. Technically, this gets loaded like any other XML file. I'll make another post later about the syntax and format of the contextmenu.xml file.<br /><br />SCREEN_MINIMAP = The in-game minimap GUI. I don't know a lot about how the Minimap works. If further documentation is requested for it, I can research it further later.<br /><br />SCREEN_AREAMAP = The in-game area map that can be brought up. I don't know a lot about how the Area Map works. If further documentation is requested for it, I can research it further later.<br /><br />SCREEN_MESSAGEBOX_SPLITSTACK* = Scene used for splitting stacks of items in inventory. The only gui element required is 'inputbox'. <br /><br />SCREEN_MESSAGEBOX_SPLITSTACKSTORE* = Scene used for splitting stacks of items for stores. It's actually loaded identically to the SCREEN_MESSAGEBOX_SPLITSTACK and only requires the 'inputbox' object to exist. I'm not sure why it got made into a seperate entry.<br /><br />SCREEN_MESSAGEBOX* = This is used for the generic message box popups. I'll probably have to write up more on them another time as they can be used effectively by scripts as well. The required elements for these are:<br /> messagetext = Text field that contains the message.<br /> okbutton = Button that will execute the OK callback<br /> cancelbutton = Button that will execute the Cancel callback<br /> messageboxlb = Listbox for containing the message text in case the text gets long.<br /> MSGBOX_BACKGROUND = Frame used for the background, this one is optional.<br /><br />SCREEN_STRINGINPUT_MESSAGEBOX* = Message boxes that prompt for user string input. They are identical to normal Message boxes, except that they also require a 'inputbox' text field.<br /><br />SCREEN_MESSAGE* = Chat boxes, pretty much. Note that currently the engine only supports loading the hard coded ones in ingamegui.ini. I hope to change this to be a lot more flexible down the line. The required elements are:<br /> messagelistbox - Listbox containing the scrollback text. If it is not found, the engine searches for messagelistbox2 instead. If neither is found, the screen is not loaded.<br /> inputbox - Text field used for user input.<br /> IMEREadingWindow - Used for IME support.<br /> IMEReadingWindowBG - Used for IME support.<br /> IMEComposeWindow - Used for IME support.<br /> IMEComposeWindow - Used for IME support.<br /> IMECandidateWindow - Used for IME support.<br /> IMECandidateWindowBG - Used for IME support.<br /> INPUT_CONTAINER - Used by the engine for easily hiding/unhiding the input related objects.<br /><br />SCREEN_HOTBAR, SCREEN_HOTBAR_2, SCREEN_HOTBAR_V1, SCREEN_HOTBAR_V2 = All the hotbars built into the game. There are no required or special UI elements needed to load these.<br /><br />If a Screen Tag doesn't match to any of the above screens, then a normal UI Scene gets created with all the default behaviors associated with it.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7141124720215848450.post-1664605640278747202007-02-09T16:51:00.000-08:002007-02-12T14:23:08.414-08:00UIObject - hideoverrideIn 1.05 there is a new attribute that all UI Objects handle called hideoverride. If true, this attribute sets a UI Object hidden and keeps it that way until a script says otherwise via the SetGuiObjectHidden() script function.<br /><br />This can be used to keep an item hidden that the GUI may try to make visible regardless what a script tries to do, such as a row in a list box.<br /><br />As a result, objects that are set hidden via SetGuiObjectHidden() will STAY hidden no matter what, unless SetGuiObjectHidden() is later used to make it visible.<br /><br />For example, if I add a new icon to a screen and set it hideoverride=true in the XML, it will remain hidden on that screen no matter what the GUI might try to do with it until I call SetGuiObjectHidden() with a false parameter to make it visible again, at which point the GUI once again has control over making that object hidden or unhidden.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-7141124720215848450.post-85926662652543105382007-02-07T18:10:00.000-08:002007-02-07T18:58:56.476-08:00UIText<span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)">UIText</span> is the GUI object used for containing and rendering text. It is one of the more complicated <span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)">UI</span> Objects to work with.<br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)">UIText</span> takes the following attributes:<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)">fontfamily</span></strong><br />This defines which font should be used via a string argument. The fonts are defined in <span class="blsp-spelling-error" id="SPELLING_ERROR_4" onclick="BLOG_clickHandler(this)">fontfamily</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_5" onclick="BLOG_clickHandler(this)">xml</span>. The 'name' attribute for the different <span class="blsp-spelling-error" id="SPELLING_ERROR_6" onclick="BLOG_clickHandler(this)">UIFontFamily</span> elements in <span class="blsp-spelling-error" id="SPELLING_ERROR_7" onclick="BLOG_clickHandler(this)">fontfamily</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_8" onclick="BLOG_clickHandler(this)">xml</span> is how they are identified here. If this attribute is not set, then the text field will use the 'Default' font family defined in <span class="blsp-spelling-error" id="SPELLING_ERROR_9" onclick="BLOG_clickHandler(this)">fontfamily</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_10" onclick="BLOG_clickHandler(this)">xml</span>.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_11" onclick="BLOG_clickHandler(this)">nextcontrol</span></strong><br />Which control should have focus if the user hits tab while editing this <span class="blsp-spelling-error" id="SPELLING_ERROR_12" onclick="BLOG_clickHandler(this)">UIText</span> field. It only really makes sense to put <span class="blsp-spelling-error" id="SPELLING_ERROR_13" onclick="BLOG_clickHandler(this)">UIText</span> field names as the arguments to this attribute, as focus doesn't have any significant meaning for any other type of <span class="blsp-spelling-error" id="SPELLING_ERROR_14" onclick="BLOG_clickHandler(this)">UIObject</span>. Note that the <span class="blsp-spelling-error" id="SPELLING_ERROR_15" onclick="BLOG_clickHandler(this)">nextcontrol</span> must be in the same <span class="blsp-spelling-error" id="SPELLING_ERROR_16" onclick="BLOG_clickHandler(this)">UIScene</span> as this text field.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_17" onclick="BLOG_clickHandler(this)">prevcontrol</span></strong><br />Which control should have focus if the user hits shift+tab while editing this <span class="blsp-spelling-error" id="SPELLING_ERROR_18" onclick="BLOG_clickHandler(this)">UIText</span> field. It only really makes sense to put <span class="blsp-spelling-error" id="SPELLING_ERROR_19" onclick="BLOG_clickHandler(this)">UIText</span> field names as the arguments to this attribute, as focus doesn't have any significant meaning for any other type of <span class="blsp-spelling-error" id="SPELLING_ERROR_20" onclick="BLOG_clickHandler(this)">UIObject</span>. Note that the <span class="blsp-spelling-error" id="SPELLING_ERROR_21" onclick="BLOG_clickHandler(this)">prevcontrol</span> must be in the same <span class="blsp-spelling-error" id="SPELLING_ERROR_22" onclick="BLOG_clickHandler(this)">UIScene</span> as this text field.<br /><br /><strong>filter</strong><br />This attribute can be used to limit what text the user can enter into this text field when editing it. By default, any input character is valid. It takes strings as its arguments. The following strings are handled:<br />alpha - Only letters can be entered in this field.<br />numeric - Only numbers can be entered in this field.<br />alphanumeric - Only letters and numbers can be entered in this field.<br />signed_numeric - Only numbers in this field, except the '-' character, which may only be entered at the front of the string.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_23" onclick="BLOG_clickHandler(this)">maxnumber</span></strong><br />This number limits the max number that a user can enter when editing this text field. It only means anything if the text field's filter is set to numeric or signed_numeric.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_24" onclick="BLOG_clickHandler(this)">allowspace</span></strong><br />If this attribute is false, then any space characters will not be allowed in this field, including tabs or newlines. It defaults to false.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_25" onclick="BLOG_clickHandler(this)">allowpunc</span></strong><br />This attribute only means anything if the filter type is set to alpha or alphanumeric. It allows graphical punctuation characters to be entered in the text field. If no filter type is specified, then this attribute doesn't do anything. It defaults to false, so must be set to true if the intent is to allow users to enter punctuation style characters into this text field.<br /><br /><strong>password</strong><br />Defaults to false. If set to true, then the characters in this string will be replaced with * marks when this text field gets rendered.<br /><br /><strong>sanitized</strong><br />Defaults to false. If this attribute is set to true, then any string entered in this text field will be run through the built in swear-filter.<br /><br /><strong>style</strong><br />This is a modifier to the font that is being used. It takes a string or number as its argument. The following arguments are supported:<br />normal - Or style 1. This is defined by the <span class="blsp-spelling-error" id="SPELLING_ERROR_26" onclick="BLOG_clickHandler(this)">UIFontNormal</span> element in <span class="blsp-spelling-error" id="SPELLING_ERROR_27" onclick="BLOG_clickHandler(this)">fontfamily</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_28" onclick="BLOG_clickHandler(this)">xml</span><br />bold - Or style 2. This is defined by the <span class="blsp-spelling-error" id="SPELLING_ERROR_29" onclick="BLOG_clickHandler(this)">UIFontBold</span> element in <span class="blsp-spelling-error" id="SPELLING_ERROR_30" onclick="BLOG_clickHandler(this)">fontfamily</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_31" onclick="BLOG_clickHandler(this)">xml</span><br />italic - Or style 3. This is defined by the <span class="blsp-spelling-error" id="SPELLING_ERROR_32" onclick="BLOG_clickHandler(this)">UIFontItalic</span> element in <span class="blsp-spelling-error" id="SPELLING_ERROR_33" onclick="BLOG_clickHandler(this)">fontfamily</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_34" onclick="BLOG_clickHandler(this)">xml</span><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_35" onclick="BLOG_clickHandler(this)">bolditalic</span> - Or style 4. This is defined by the <span class="blsp-spelling-error" id="SPELLING_ERROR_36" onclick="BLOG_clickHandler(this)">UIFontBoldItalic</span> element in <span class="blsp-spelling-error" id="SPELLING_ERROR_37" onclick="BLOG_clickHandler(this)">fontfamily</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_38" onclick="BLOG_clickHandler(this)">xml</span><br /><br /><strong>indent</strong><br />This is the number of pixels to indent the first line of any text. It defaults to 0.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_39" onclick="BLOG_clickHandler(this)">hangingindent</span></strong><br />This is the number of pixels to indent all lines besides the first line in a <span class="blsp-spelling-error" id="SPELLING_ERROR_40" onclick="BLOG_clickHandler(this)">multi</span>-line text field. It defaults to 0.<br /><br /><strong>align</strong><br />This is how the text should be aligned in the text field. The following string arguments are handled: left, right, center. Defaults to left.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_41" onclick="BLOG_clickHandler(this)">hilite</span></strong><br />Defaults to false. If set true, then the text in this text field will <span class="blsp-spelling-error" id="SPELLING_ERROR_42" onclick="BLOG_clickHandler(this)">hilight</span> when moused over.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_43" onclick="BLOG_clickHandler(this)">valign</span></strong><br />This is how the text should be aligned vertically within the text field. The following string arguments are handled: top, bottom, middle. Defaults to top.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_44" onclick="BLOG_clickHandler(this)">poscenter</span></strong><br />This attribute is defunct and no longer does anything.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_45" onclick="BLOG_clickHandler(this)">sizetofit</span></strong><br />Defaults to false. If set to true, then the text field will extend its height downward as far as possible in order to contain the length of text within it. This is an old attribute and should be replaced by just setting the height of the text field to DYNAMIC.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_46" onclick="BLOG_clickHandler(this)">buttonoverlay</span></strong><br />This only means anything if the text field is a child element of a <span class="blsp-spelling-error" id="SPELLING_ERROR_47" onclick="BLOG_clickHandler(this)">UIButton</span> element. If left to the default of false, then this text field will become the normal text field that shows up in buttons. If set to true, it becomes Overlay Text. At this time, Overlay Text can only be manipulated by the engine.<br /><br /><strong>editable</strong><br />Defaults to false. If set to true, then the user can edit the text within this text field by clicking it to place their cursor and typing like normal.<br /><br /><strong>selectable</strong><br />This attribute does nothing at this time.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_48" onclick="BLOG_clickHandler(this)">maxlines</span></strong><br />The max number of lines this text field can contain. Setting this attribute to '1' will keep the engine from trying to break the text into multiple lines. Text that will not fit into the text field after the maximum number of lines has been reached will not get rendered. If not defined, the engine will try to wrap a string and fit it into the space available no matter what, which can sometimes result in no text at all appearing due to spacing errors.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_49" onclick="BLOG_clickHandler(this)">multiline</span></strong><br />This attribute toggles whether or not a user can hit enter to start a new line of text within a editable text field. It requires that <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_50" onclick="BLOG_clickHandler(this)">allowspaces</span></strong> be also set to true or else it will seem to do nothing. It defaults to false. When false, the <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_51" onclick="BLOG_clickHandler(this)">OnReturn</span></strong> callback will get called when the user hits enter, instead of a new line being inserted.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_52" onclick="BLOG_clickHandler(this)">returnrestricted</span></strong><br />This attribute can be a bit confusing. It defaults to false and only means anything when used with <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_53" onclick="BLOG_clickHandler(this)">multiline</span></strong>=true. What happens is that if this <span class="blsp-spelling-corrected" id="SPELLING_ERROR_54">attribute</span> is set to 'true', the text field will accept multiple lines of input and wrap them automatically, but if the user hits their return key, the <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_55" onclick="BLOG_clickHandler(this)">OnReturn</span></strong> callback gets called instead of inserting a newline. An example of this behavior can be found in the chat input box.<br /><br /><strong>uppercase</strong><br />Defaults to false. If true, all text rendered in this text field will be rendered in uppercase.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_56" onclick="BLOG_clickHandler(this)">maxlength</span></strong><br />This limits the number of characters that can be typed into a text field by the user. Once the user has entered the max limit of characters, no additional characters can be input. If no <span class="blsp-spelling-error" id="SPELLING_ERROR_57" onclick="BLOG_clickHandler(this)">maxlength</span> is set, the user can keep typing indefinitely.<br /><br /><strong>color</strong><br />A color to blend with all of the characters within the text field. This can sometimes conflict with the use of the color tags in text fields.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_58" onclick="BLOG_clickHandler(this)">highlightcolor</span></strong><br />This attribute defines the color that should be blended with the text when doing a mouse-over style highlight.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_59" onclick="BLOG_clickHandler(this)">selectioncolor</span></strong><br />This attribute does nothing at this time.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_60" onclick="BLOG_clickHandler(this)">highlightonmouseover</span></strong><br />This is just a clone of the <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_61" onclick="BLOG_clickHandler(this)">hilite</span></strong> attribute mentioned above.<br /><br /><strong>text</strong><br />This is for hard coding the text that should show up in this text field. Overrides <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_62" onclick="BLOG_clickHandler(this)">strref</span></strong>.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_63" onclick="BLOG_clickHandler(this)">strref</span></strong><br />This is for coding which string ref should show up in the text field. It is overridden by <strong>text</strong>.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_64" onclick="BLOG_clickHandler(this)">OnReturn</span></strong><br />This callback gets executed when the user hits Enter while the cursor is in this text field. Note that if the text field is set with <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_65" onclick="BLOG_clickHandler(this)">multiline</span></strong>=true and <strong><span class="blsp-spelling-error" id="SPELLING_ERROR_66" onclick="BLOG_clickHandler(this)">restrictedreturn</span></strong>=false, then this callback will not get executed.<br /><br /><strong><span class="blsp-spelling-error" id="SPELLING_ERROR_67" onclick="BLOG_clickHandler(this)">OnLostFocus</span></strong><br />This callback is executed when the cursor is taken out of the text field due to the user clicking elsewhere.Unknownnoreply@blogger.com41tag:blogger.com,1999:blog-7141124720215848450.post-33111870333216146812007-02-07T17:47:00.000-08:002007-02-07T18:09:55.343-08:00UIFrameUI Frame is used for borders and backgrounds for other UI Objects. UIFrames are imbedded in buttons and a few of the container style UI Objects that will be discussed later.<br /><br />The following attributes are handled by UIFrame:<br /><br />The following is a list of the texture pieces that make up a frame. They take a texture name as an argument. The texture pieces are:<br />topleft, topright, top, left, right, bottom, bottomleft, bottomright, fill.<br /><br />The next set of attributes are methods of mirroring one piece to other pieces. This mirroring happens at render time.<br /><br /><strong>mhtop</strong><br />Stands for MirrorHorizontalTop. Defaults to false. If true, the Top Left Corner will be mirrored to the Top Right Corner. If combined with mvright, then the Top Left Corner will be mirrored to the Right Bottom Corner.<br /><br /><strong>mhbottom</strong><br />Stands for MirrorHorizontalBottom. Defaults to false. If true AND mvright is true, then the Top Left Corner will get mirrored to the Bottom Right Corner. If true AND mvright is false, then the Bottom Left Corner will get mirrored to the Bottom Right Corner.<br /><br /><strong>mvleft</strong><br />Stands for MirrorVerticalLeft. Defaults to false. If true, the Top Left Corner will get mirrored to the Bottom Left Corner. If true AND mhbottom is true, the Top Left Corner will get mirrored to the Bottom Right Corner.<br /><br /><br /><strong>mvright</strong><br />Stands for MirrorVerticalRight. Defaults to false. If true AND mhtop is true, the Top Left Corner will get mirrored to the Bottom Right Corner. If true AND mhbottom is false, the Top Right Corner will get mirrored to the Bottom Right Corner.<br /><br /><strong>mhside</strong><br />Stands for MirrorHorizontalSide. Defaults to false. If true, the Left Side will get mirrored to the Right Side.<br /><br /><strong>mvside</strong><br />Stands for MirrorVeritcalSide. Defaults to false. If true, the Top Side will very mirrored to the Bottom Side.<br /><br /><strong>maside</strong><br />Stands for MirrorAllSides. Defaults to false. If true, the Left Side will get mirrored to the Top Side, Right Side, and Bottom Side.<br /><br />The remaining attributes supported by UIFrame follow:<br /><strong>fillstyle</strong><br />This tells the engine to fill in the center space of the frame with the fill texture using different algorithms. This attribute takes the following string arguments:<br />center - Center the 'fill' texture.<br />stretch - Stretch the 'fill' texture to take up the full center.<br />tile - Repeat the 'fill' texture to fill up the center.<br /><br /><strong>border</strong><br />This is the thickness of the border pieces in pixels. Note that it defaults to 0. If no border thickness is set, then all the textures besides 'fill' won't show up when the UIFrame gets rendered.<br /><br /><strong>color</strong><br />This takes color strings to define the color that should be blended with the frame textures.<br /><br />Note that if a UIFrame doesn't have a height or width defined by its attributes, it automatically inherits the height and width of whatever object contains it.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7141124720215848450.post-35962801869729380712007-01-31T16:21:00.000-08:002007-01-31T17:06:56.864-08:00UIButtonUIButton is the generic, clickable object one expects to find on any PC game interface. It also acts as a 'restricted' container of sorts, as it can contain specific UI objects within it.<br /><br />A button is made up of several child objects contained in a single pane. These pieces can be defined explicitly or left up to the engine to define.<br /><br />The child objects that a UIButton can contain are:<br />Up to 1 UIText field. If a UIText object is not defined as a child object in the XML, the engine will create one automatically when creating the UIButton.<br /><br />Up to 11 UIFrames. A UIFrame contained within a button must have a state attribute that only applies when specifically contained within a button. The following arguments are valid for the state attribute:<br />up<br />down<br />disabled<br />focused<br />hilited<br />hifocus<br />header<br />hiheader<br />downheader<br />base<br />These states can mean different things depending on the context of the button, so I'll just make some notes about a few of them. 'header', 'hiheader', and 'downheader' are the states for a button that is to be the header of a UICollapsable object, which will be explained further in a later article. 'base' is useful for when using state frames that leave some of the 'base' button visible, such as hotbar button icons.<br /><br />An unlimited number of UIIcons that will be added to the 'overlay' list for that button. Overlays are extra icons that can be made visible by the engine that stay with the button. At this time, there is no way to manipulate these overlays via script.<br /><br />UIButton supports the following attributes:<br /><strong></strong><br /><strong>style</strong><br />This is a 'style' name from the stylesheet.xml file that this button should adopt for its default parameters. At this time there is not support for custom styles.<br /><br /><strong>repeatcallback</strong><br />If this attribute is set to true, the OnLeftClick callback will get executed every frame as long as the left mouse button is held down on it. On the first update the OnLeftClick will execute on the mousedown. There will then be a 0.5 second pause, then after that the OnLeftClick callback will be executed every frame until the left mouse button is released.<br /><br /><strong>OnSelected</strong><br />This callback is applicable to radio buttons and toggle boxes. If the button is a toggle box, this callback is executed when the toggle box is activated. If the button is a radio button, this callback is executed when the button becomes the selected radio button.<br /><br /><strong>OnUnselected</strong><br />This callback is applicable to radio buttons and toggle boxes. If the button is a toggle box, this callback is executed when the toggle box is de-activated. If the button is a radio button, this callback is executed if thi sbutton was the selected radio button, but now another radio button has been selected.<br /><br /><strong>groupid</strong><br />This is a group number for radio buttons. Group IDs are global for the entire XML file that contains the button. That is to say, there can only be one group of radio buttons with the group id of '1', or '2', etc. All buttons that share the same group id form a 'set' of radio buttons. Only one button in that set can be selected at a time, all the rest are non-selected. Selecting any one button in the set will unselect the previously selected radio button.<br /><br /><strong>groupmemberid</strong><br />This gives the UI Button a unique within a set of radio buttons. There should only be one button with a specific groupmemberid in a set of buttons. Ideally these IDs should start with 1 and increment from there, but that is not completely necessary.<br /><br /><strong>buttontype</strong><br />This attribute accepts only 'radio' or 'check' as arguments, defining the button as a radio button or checkbox style button.<br /><br /><strong>color</strong><br />This attribute accepts color strings. These colors will blend with any other colors found in the textures of the button. So setting this to grey, for example, will make a grey-scale style icon for the button.<br /><br /><strong>disabledcolor</strong><br />This attribute accepts color strings. This will be the blending color for when the button is put into a disabled state.<br /><br /><strong>disabledtextcolor</strong><br />This attribute accepts color strings. This color will change the color of any text contained in the button's text field if the button is put into a disabled state.<br /><br /><strong>strref</strong><br />This is a STRREF that represents the string that should appear in the button.<br /><br /><strong>text</strong><br />This is hard coded text that should appear in the button. It overrides the <strong>strref</strong> attribute if it is present.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7141124720215848450.post-38817329576901049722007-01-31T16:03:00.000-08:002007-01-31T16:18:32.851-08:00UIPaneUIPane is the generic 'container' for other UI Objects. Panes can't be rendered, but they can contain 'child' objects which can be renderable objects.<br /><br />Every scene has a 'rootpane', which is automatically defined by the engine when a new UIScene is loaded from a XML file.<br /><br />Child objects within a pane will be positioned with their x,y origin relative to the origin of the UI Pane that contains the child. UIPanes can also simulate buttons with the tupple attribute, so many of the attributes for UIPane are similar to those found under UIButton.<br /><br />The following attributes are supported by UI Pane:<br /><br /><strong>MouseDownSFX</strong><br />Sound effect to be played when the Pane is clicked on. This only means anything if the Pane is a tupple style pane.<br /><br /><strong>MouseUpSFX</strong><br />Similar to a button up sound effect, this only means anything if the Pane is a tupple style pane.<br /><br /><strong>MouseDragSFX</strong><br />Sound effect for dragging a tupple style UI Pane object.<br /><br /><strong>MouseDropSFX</strong><br />Sound effect when releasing a dragged tupple style UI Pane object.<br /><br /><strong>tupple</strong><br />Setting this attribute to true makes the entire UI Pane behave like a button rather than just a container. This makes it possible to design more complicated buttons than normal, default UIButton tag allows for such as having a defined layout or multiple icons within the same button, etc. Once a Pane becomes a tupple, it can be clicked on, gain focus, lose focus, become enabled, become disabled, etc., just like a normal button. Note that it is still possible to place buttons within a tupple style pane that should work fine. So you could have a listbox row that is a tupple style pane that also has a toggle button on every row, for example. <br /><br /><strong>OnLeftClick</strong><br />The callback to be executed when a tupple style UI Pane is left clicked on.<br /><br /><strong>OnLeftDoubleClick</strong><br />The callback to be executed when a tupple style UI Pane is double left clicked on.<br /><br /><strong>OnRightClick</strong><br />The callback to be executed when a tupple style UI Pane is right clicked on.<br /><br /><strong>OnRightDoubleClick</strong><br />The callback to be executed when a tupple style UI pane is double right clicked on.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7141124720215848450.post-49341980718514955952007-01-30T16:40:00.000-08:002007-01-30T17:42:45.822-08:00UISceneThe UIScene tag at the top of the XML files defines certain global parameters about the entire GUI window being defined in the file.<br /><br />A scene doesn't have anything to render by default, but rather contains items that will get rendered. So a file that defines a UIScene and nothing else will not appear as anything in the game.<br /><br />Some of the attributes for UIScene overlap with those of UIObject, even though UIScene does not inherit from UIObject, so this attributes will be repeated here.<br /><br />The following attriibutes are supported by the UIScene tag:<br /><br /><strong>OnCreate</strong><br />This callback gets executed when the scene is loaded from the XML file. This is not necessarily a one time thing, as it is possible for scenes to get unloaded from memory and then reloaded from the file the next time they are needed. Additional detail about this will be included later in this article.<br /><br /><strong>priority</strong><br />This determines where scenes fall in the render order, in terms of which scenes should cover up other scenes.<br />The valid arguments to this attribute in order of highest priority to lowest are:<br />SCENE_TOOLTIP - Appears on top of any other GUI<br />SCENE_GLOBAL - Used for messageboxes generally.<br />SCENE_FE_FULLSCREEN - Pre-game full screen GUIs<br />SCENE_INGAME_FULLSCREEN - Full screen GUIs within the game.<br />SCENE_INGAME_SYSTEM - Escape menu and options screens.<br />SCENE_SCRIPT - GUIs brought up by script<br />SCENE_NWN1_DIALOG - The NWN1 style dialog box<br />SCENE_INGAME_MENU - The popup player menu<br />SCENE_INGAME - Most of the windows in-game<br />SCENE_INGAME_TARGET - The target box<br /><br /><strong>OnDestroy</strong><br />This callback gets executed when the scene is unloaded from memory.<br /><br /><strong>OnAdd</strong><br />This callback gets executed any time the scene is made visible.<br /><br /><strong>OnRemove</strong><br />This callback gets executed any time the scene is closed. Note that scenes can be closed and yet remain in memory. This in fact the default behavior. See <strong>idleexpiretime</strong> below for more information.<br /><br /><strong>OnBackout</strong><br />This callback gets executed when the user hits their Esc key and this scene is going to be closed as a result. If the <strong>backoutkey</strong> attribute is not true, then this callback will do nothing.<br /><br /><strong>OnUpdate</strong><br />This is the callback to execute every frame.<br /><br /><strong>OnUnhandledMouseClick</strong><br />This callback gets executed if a user clicks on the scene, but none of the contents of the scene did anything with the user's click.<br /><br /><strong>updaterate</strong><br />The time between updates, in seconds. If no value is specified, the scene will get an update every frame.<br /><br /><strong>draggable</strong><br />This determines if the entire scene is draggable. This is different from dragging a single UI Object within a scene as it moves the entire window. The default setting is false.<br /><br /><strong>dragregion_x</strong><br /><strong>dragregion_y</strong><br /><strong>dragregion_width</strong><br /><strong>dragregion_height</strong><br />These 4 attributes are used to define the space on the scene that can be used to drag the scene. The numbers are in pixels. If a drag region is defined using these 4 attributes, the user can only drag the scene by clicking and dragging in the defined location. If no drag region is defined, the user can drag the scene by clicking anywhere on the scene where the click will not be used by a child object of the scene.<br /><br /><strong>dragresizable</strong><br />Determines if this scene can be resized by dragging the edges of it. This is used in the chat window for resizing, for example. The default setting is false.<br /><br /><strong>dragresizeborder</strong><br />This attribute defines the size, in pixels, of the border of the scene that can be clicked on in order to resize the window.<br /><br /><strong>capturemouseclicks</strong><br />If set to false, then mouse clicks should pass right through the background of this scene. Useful for semi-transparent overlays and other situations where it is expected that the user be able to click through the UI Object. The default setting is true.<br /><br /><strong>capturemousevents</strong><br />This is pretty much a redundant attribute. It does the exact same thing as <strong>capturemouseclicks</strong>.<br /><br /><strong>fullscreen</strong><br />This attribute can be true or false. By default it is false. It controls what happens to this scene when the resolution of the game changes. Scenes that have this attribute set to 'true' will not have their origins moved but their dimenions will be adjusted to the new resolution. Scenes that have this attribute set to 'false' will not be resized when the resolution changes but their origin will change to stay roughly in the same part of the screen that the window appeared in before.<br /><br /><strong>width</strong><br />Width of the scene in pixels. The argument 'SCREEN_WIDTH' can also be used to make this scene always match the width of the full screen.<br /><br /><strong>height</strong><br />Height of the scene in pixels. The argument 'SCREEN_HEIGHT' can also be used to make this scene always match the height of the full screen.<br /><br /><strong>x</strong><br />The x origin for the window. The following string arguments are also valid: ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT. Defaults to 0.<br /><br /><strong>y</strong><br />The y origin for the window. The following string arguments are also valid: ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM. Defaults to 0.<br /><br /><strong>expiretime</strong><br />This is the amount of time in seconds a scene should be up before it is automatically removed from view and unloaded from memory. If 0 or not set, then the scene will never be automatically removed from view.<br /><br /><strong>idleexpiretime</strong><br />This is the amount of time in seconds a scene should not be visible before it should be unloaded from memory. This can be used to unload scenes that were shown once that will not be needed again anytime soon. The next time the scene is requested, it will be loaded from disk. This makes it possible to sometimes do quick testing of GUI changes by setting a short idleexpiretime, closing the window, then reopening it to see what it looks like with the new changes on disk.<br /><br /><strong>autolayout</strong><br />This attribute is only of interest in message-box style GUI screens. If enabled, the engine will attempt to automatically position the text, the 'okay', and the 'cancel' button in a classic message box layout. If left false, then the engine will not attempt to arrange any of the contents of the messagebox when the message box is requested. It is false by default.<br /><br /><strong>modal</strong><br />If set to true, then this UI scene will block access to the game or any underlying GUI screens until the window is closed. It is false by default. Note that scripts that bring up GUIs can override this parameter based on the parameters passed in to the script function.<br /><br /><strong>fadein</strong><br />The time in seconds this scene should take to fade in completely when opened.<br /><br /><strong>fadeout</strong><br />The time in seconds this scene should take to fade out completely when closed.<br /><br /><strong>minwidth</strong><br />This attribute is defunct and no longer does anything.<br /><br /><strong>minheight</strong><br />This attribute is defunct and no longer does anything.<br /><br /><strong>scriptloadable</strong><br />In order for a server script to have any control over this GUI at all, this attribute must exist in the UIScene tag and must be set to true. It is false by default. If false, than all script functions that attempt to manipulate a user's GUI will fail.<br /><br /><strong>backoutkey</strong><br />If this attribute is set true, then use of the backout key ('Esc' key by default) will cause this window to close. The backout key follows a defined set of logic for determining what to do when it is used. First it closes any open 'windows' in the reverse order that they were opened (Most recent window opened is closed first). If there are no windows to close, it clears the player's target. If the player has nothing targetted, it brings up the in-game options screen.Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-7141124720215848450.post-77429189254930043602007-01-30T11:19:00.000-08:002007-01-30T11:27:02.775-08:00Long Posts and post summariesOn other blogs, I've seen that authors will write a summary or intro to the post and then there will be a link the reader can click to go to the full length article. Given that some of my technical posts are going to be very long, I'd like to do the same thing here. But I've read some of the guides on blogger as well as other various websites about how to do that and the instructions are real head scratchers, telling me to look for tags that don't exist to insert code.<br /><br />Considering the guides tend to be really old, all I can imagine is that they are out of date and that some new approach is required to accomplish what I'm looking to do. If anyone has any advice or information about implementing that feature for this blog, I'd love to hear about it.<br /><br />An example of what I'm talking can be seen on this blog here:<br /><a href="http://afkgamer.com">http://afkgamer.com</a><br /><br />If you flip through a few pages of posts, you'll find longer posts where he sets up the post, and then there's a 'Read the rest' link or whatever to follow in order to read the rest of the lengthy post.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7141124720215848450.post-87675949598034214552007-01-29T17:40:00.000-08:002007-01-29T18:43:51.692-08:00UIObjectThis is the first of many posts to come to document the various attributes for GUI Objects. UIObject is the 'base' GUI object. You can't actually define it in XML, but it contains attributes that are common to many different UI Objects, so I'm starting here.<br /><br />The following are the attributes that will be loaded for every UI Object in the XML file except for the <uiscene>attributes.<br /><br />Some attributes will be ignored or overridden depending on the situation. Note that attributes are case sensitive.<br /><br /><strong>name</strong><br />String value for the name of the UI Object. This is used internally and will be necessary for scripting to interact with this object in the future.<br /><br /><strong>scalewithscene</strong><br />If this is set to true, then this UI Object will have its dimensions scaled to match its parent's dimensions if the parent object gets resized. Handy for things like background images.<br /><br /><strong>usescaler</strong><br />This tells the code to try and use some logic when this object gets resized in determining where its new X,Y origin should be. For example, if there is a lot of space to the right of the object, it will assume this object was left-anchored and keep the object to the left side with its new position. It's kind of a confusing attribute, all I can say is try it out and see if it does what you want, and don't use it if it doesn't. :)<br /><br /><strong>width</strong><br />The width of the UI Object. Many things override this, for example if the object will be a box in a grid, the grid will control the width, or if the box is in a list box, the list box may override it, depending on the list box attributes, etc. This attribute can take pixel count arguments, or the following strings:<br />SCREEN_WIDTH - This object's width will be full screen no matter what the resolution is.<br />PARENT_WIDTH - This object's width will be the full width of its parent object, no matter what the size of the parent object is.<br /><br /><strong>height</strong><br />Same as the width attribute, except substitute height for width in all cases. Note that if no height or width attributes are set, the object will take on the height and width of its parent object.<br /><br /><strong>x</strong><br />The x origin of the object with respect to its parent UI object. This can take a pixel count, or the following strings as arguments:<br />ALIGN_CENTER - Center this Object to the screen<br />ALIGN_PARENT - Center this object within its parent UI Object.<br />ALIGN_LEFT - Keep this object oriented to the left of its parent (x = 0).<br />ALIGN_RIGHT - Push this object against the right side of the parent object.<br /><br /><strong>y</strong><br />The y origin of the object with respect to its parent UI object. This can take a pixel count, or the following strings as arguments:<br />ALIGN_CENTER - Center this object to the screen<br />ALIGN_PARENT - Center this object within its parent UI Object.<br />ALIGN_TOP - Keep this object at the top of its parent object (y=0)<br />ALIGN_BOTTOM - Push this object against the bottom of the parent object.<br /><br /><strong>focusable</strong><br />In general, this means that the object can't be clicked on. For example, if it is an object in a UIGrid, it means that object in the grid can't be clicked on. This will keep the object of being the target of an actiontarget as well (When the mouse cursor changes to indicate the user can click somewhere to perform an action). Default value is true.<br /><br /><strong>ignoreevents</strong><br />This is somewhat identical to setting focusable=false, but it also means that the UI Object will ignore objects being dragged on it, among some other UI events besides just mouse clicking. It defaults to false.<br /><br /><strong>handleactiontarget</strong><br />Setting this to true means that action targets can be used on this GUI object. Action targets actions that need to be targeted on something, indicated by the mouse cursor changing appearance. For example, clicking on a spell button, then having the cursor change to indicate you need to click on what target you want the spell cast. If this attribute is true, then the GUI object will be treated as a valid target for actions to be performed on. It defaults to false.<br /><br /><strong>draggable</strong><br />This indicates that the UI Object can be dragged and dropped, such as hotbar buttons. Defaults to false.<br /><br /><strong>OnMouseDropReceived</strong><br />This is the UI Callback to execute when a draggable UI object gets dropped on this UI object. This is not executed by the object being dropped, but rather the object that got something dropped ON it.<br /><br /><strong>OnMouseDrop</strong><br />This callback is executed on a UI Object when it gets dragged and then dropped. Upon being dropped, this callback will be executed.<br /><br /><strong>OnMouseDropFailed</strong><br />This callback is executed if a UI Object is dragged and then dropped but not dropped over another UI Object.<br /><br /><strong>OnMouseEnter</strong><br />This callback is executed when the mouse cursor is moved over this object.<br /><br /><strong>OnMouseLeave</strong><br />This callback is executed when the mouse cursor is moved off of the object after having been moved onto it.<br /><br /><strong>OnResize</strong><br />This callback is executed any time the UI Object gets resized for any reason.<br /><br /><strong>OnTooltip</strong><br />This callback gets executed if the mouse hovers over this object long enough based on the user's preference for the tooltip delay.<br /><br /><strong>OnRadialRequest</strong><br />This is the callback that gets executed if the user brings up the context sensitive menu on this UI object.<br /><br /><strong>DefaultTooltip</strong><br />This is a default tooltip STRREF that is used in case a custom tooltip callback is not really necessary.<br /><br /><strong>hidden</strong><br />Whether or not this object is visible. Defaults to true..<br /><br /><strong>disabled</strong><br />Whether or not this object is enabled. Applies mostly to buttons, but for the most part, no UI Object that is disabled will accept user input. Defaults to false.<br /><br /><strong>capturemouseclicks</strong><br />If set to false, then mouse clicks should pass right through this object. Useful for semi-transparent overlays and other situations where it is expected that the user be able to click through the UI Object. This also applies to MouseEnter and MouseLeave. If an object is set to not capture mouse clicks, then objects underneath of it cannot be moused over.<br /><br /><strong>OnGainedFocus</strong><br />This callback is executed when an object gains focus. This applies mostly to buttons that got clicked on or editable text fields that got clicked in.<br /><br /><strong>OnLostFocus</strong><br />This callback is executed when an object loses focus. This applies mostly to buttons that had been previously clicked on or editable text fields that had been previously clicked in.<br /><br /><strong>update</strong><br />This determines if this UI object receives calls to an OnUpdate callback. Defaults to false. If set to true, then this UIObject will have its OnUpdate callback called on every frame, or slower if an updaterate is defined.<br /><br /><strong>OnUpdate</strong><br />The callback to be executed when this object receives its update.<br /><br /><strong>UpdateRate</strong><br />This attribute can be used to tune the update rate of a UI Object. If a particular object doesn't need to be updated every frame, then set an update rate here to slow it down. The number value is in seconds and floating points are okay (0.5 for half second, for example).<br /><br /><strong>hotbartype</strong><br />This is an advanced attribute that is used for determining how the hotbar should treat another UI Object being dragged onto it. The currently valid values for this attribute are:<br /> HOTBAR_NONE - The hotbar should ignore this.<br /> HOTBAR_ITEM - This is an item icon being dragged, such as from inventory.<br /> HOTBAR_KNOWNSPELL - This item being dragged is something from the spellbook.<br /> HOTBAR_SPELL - This item is a spell from somewhere else, such as another hotbar slot.<br /> HOTBAR_FEAT - This item is a feat from somewhere, such as the feat listing or another hotbar slot.<br /> HOTBAR_BUTTON - This is an empty hotbar button.<br /> HOTBAR_SKILL - This is an activateable skill, such as from the skills pane or another hotbar slot.<br /> HOTBAR_TOGGLEMODE_BUTTON - This is a button used to toggle some kind of mode.<br /> HOTBAR_BARTER - This is used to flag barter grid items as not being able to be dragged to the hotbar.<br /> HOTBAR_DM_COMMAND - The item being dragged is a DM Client command.<br /> HOTBAR_VM_COMMAND - The item being dragged is an emote command.<br /> HOTBAR_DM_CREATOR - The item being dragged is an entry from the DM Client Creator.<br /><br /><strong>Scale*ToParent</strong><br />This was a set of attributes that was going to allow more control over how an object behaved when its parent got scaled. But in looking at the code, it looks like they've been gutted and no longer do anything.<br /><br /><strong>MouseOverSFX</strong><br />The sound effect to play when this UI Object gets moused over.<br /><br /><strong>alpha</strong><br />How transparent this object should be by default.<br /><br /><strong>dontrendermousegrab</strong><br />'Mouse Grab' means item being currently dragged. Normally the mouse grab is rendered last of all in order to keep it on top. There are situations where this behavior wasn't desired, though I can't remember what. When set to true, it means that this object needs to not get rendered last like normal dragged objects, but rather is rendered when it would normally be.<br /><br /><strong>SetDataInt</strong><br />This stores an 'int' value in the UI Object's data element at int index 0. More on data elements another time.<br /><br /><strong>SetDataFloat</strong><br />This stores a 'float' value in the UI Object's data element at float index 0. More on data elements another time.<br /><br /><strong>SetDataString</strong><br />This stores a 'string' value in the UI Object's data element at string index 0. More on data elements another time.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7141124720215848450.post-11930474085995929602007-01-29T15:58:00.000-08:002007-02-12T14:23:35.675-08:002DA Caching for Script LookupsOur lead scripter, Charles Mead, informed me that we did not cache 2DAs that were being queried by script. This resulted in ridiculous seek time for looping over large 2DAs.<br /><br />He indicated that Bioware had fixed that in the 1.64 code, so I referenced the 1.67 code drop that we had and saw that they had implemented a system whereby the most recent 2 2DAs that were queried were cached.<br /><br />I took that a bit further and made it so that the # of 2DAs that are cached is a changeable value. The default is 10, but in nwnplayer.ini, an entry of:<br /><br />2DA Cache Size=<br /><br />under<br /><br />[Server Options]<br /><br />will allow users to modify that cache size to suit their needs. There should never be a need to go lower than 10, but someone may want to increase the cache if they are querying a ton of different 2DAs quite frequently.<br /><br />In addition, the function:<br />Clear2DACache() can be used to purge the in-memory 2DA cache. This will force the 2DA to be loaded from disk the next time a script tries to look anything up from it.<br /><br />This change is scheduled for 1.05.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-7141124720215848450.post-74552057042426274832007-01-23T21:28:00.000-08:002007-01-29T17:40:16.096-08:00So far for 1.05While the 1.04 patch is about to come out for NWN2, the 1.05 patch isn't too far off either. Rather than make 1.05 a big patch like 1.04 is, we want to release a small, quick patch to try and quickly resolve some issues the custom content community for NWN2 is running into.<br /><br />I recently revamped the auto-updater to allow for incremental patches. This means that if someone had 1.02, the patcher would patch them up to 1.03, then to 1.04 (once 1.04 is released). While this may seem like it doesn't offer anything to the end-user, it makes it several times faster to make patches on our end, which means the end-user will see more frequent, smaller patches, instead of the periodic large patch.<br /><br />The following is a list of the items that have gone in so far for 1.05:<br /><br />armorrulestats.2da will no longer be capped at 255 rows<br /><br />DisplayGuiScreen() script function now has a new parameter that allows the script to define the *.xml file if the 'screen name' can't be found in the gui INI files.<br /><br />Appearances.2da had the NWN2_Scale column changed to NWN2_Scale_X, NWN2_Scale_Y, NWN2_Scale_Z, allowing all 3 dimensions to be scaled seperately.<br /><br />The chat boxes will no longer clear their text on area or module transitions.<br /><br />NWN2_Deities.2da can now be overridden correctly, without having to stick it into the override directory.<br /><br />NWN2_Deities.2da's description column can now work with hard coded strings in place of STRREFs. Simply enclose the string in " marks.<br /><br />GetIsPartyTransition() script function will now correctly return TRUE or FALSE. Before it would always return TRUE, which would cause the default transition scripts to jump the party even if the trigger was flagged as not being a party transition.<br /><br />A bug has been fixed that was preventing mouse clicks from going through the screen space occupied by the quickspell menus even if the quickspell menu wasn't visibly blocking that part of the screen.<br /><br />There's a number of 2DAs that should be fixed in the toolset with regards to respecting the Label Column if the STRREF column is blank. I'm out of the office this week, so I'm not 100% sure that this had made it in at this time, but it is my goal for the 1.05 patch for it to be there.<br /><br />Also going in is Multiselect for the DM Client and in the normal game mode. This will allow you to drag-select any party members not being actively controlled by another player and issue simple commands like move, attack, talk, and even unlock/disarm. The game will pick the character with the highest score for picking and disarming and have them do the action. This is our first pass at multi-select support, there will be more features going in with regards to this over time.<br /><br />Anyway, that's all I can think of off hand and after looking over my notes from last week. I expect 1.05 to be released early Feb.Unknownnoreply@blogger.com6