This callback will be one of the most powerful new tools when it comes to creating custom actions in the game.
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.
Once the user clicks on a valid target, a bunch of data will be sent to the server along with a request to execute
Question: Is it possible to use NWN custom creatures (meshes&texture) in NWN 2?
Answer: For creatures the changes between NWN1 and NWN2 are really too radical to use the old creatures. It's probably possible to import non-animating models though. Hopefully, we will have some tools out to help with Custom Content soon.
Question: Could flying ever be a possibility?
Answer: The NWN1 and NWN2 engines really don't have a concept of up or down when it comes to how the engine sees the world of the game. Adding that understanding would probably require a lot of work and the re-writing of large sections of the engine.
Question: Is there any reasonably simple way to change the eye alignment on head models? The eyes on most of the gnome and elf heads are very oddly placed, giving the impression that they are always squinting or looking up. Very distracting in cutscenes- the impression I get from most of the Elves is that of whiny teenagers looking sullenly up at parents while getting yelled at. I get the impression that many of the head models were built in one race and modified to fit one or more others. I am
By Rich Taylor
A new callback in 1.06 is:
UIObject_Misc_ExtractData( sourceobject, datatype, index, destinationvar )
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.
sourceobject
This parameter is used to define which UI Object we are extracting data from. It accepts the following options:
selected:listboxname - By replacing 'listboxname' with the name of the listbox yo
In 1.06, callbacks can take 2 new 'variable' parameters in addition to global:# and local:#.
The first new parameter type is
listboxrow:listboxname
This will insert the row # that is currently selected in the listbox indicated by listboxname
For example, if I had a callback that looked like:
OnLeftClick=UIObject_Misc_ExecuteServerScript("myguiscript",listboxrow:mylb)
On the same UIScene I have a listbox called 'mylb' where I have selected the 3rd row.
When the OnL
1.06 will have a number of new script functions that will give improved control over custom GUIs.
Two of the new script functions are:
SetGUIProgressBarPosition();
This script function will let you set the position of a progress bar (Between 0.0 for empty and 1.0 for full).
The other new function is:
SetGUITexture();
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.
Both script fun
Even video games with good writing are usually banal and puerile in their content. The exploration of themes in games is typically shallow and any didactic purpose the writers attempt to achieve is usually aimed very low. When an eleven year-old already inherently comprehends and accepts the lesson you are trying to impart, you know you're not dropping the bucket too deep into the well. A converse problem is that the themes being explored are so far outside of a player's daily concerns that they
By Rich Taylor
In 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.
For example, I could set up a UI Button to with the following callbacks:
OnUpdate=UIObject_OnUpdate_DisableIfLocalVarEquals(local:3,"true")
OnLeftClick=UIObject_Input_ScreenOpen("SCREEN_OPTIONS","false")
OnLeftClick0=U
UIObject_Tooltip_DisplayTooltipString takes up to 9 parameters, but only the first four parameters are required.
Parameter list:
Message = The literal string to display in the tooltip
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,
The only valid parameter to this callback is a local or global GUI variable index.
localguivars are expressed as local:#, where # is the index for the variable.
globalguivars are expressed as global:#, where # is the index for the variable.
This callback takes the engine-level data in a UIObject and stores it in a global or local gui variable. The engine-level data will vary from UIObject to UIObject. It is also impossible to specify which data item you want to set the GUI variable t
This 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.
The single parameter is:
sListBoxName = The name of the list box we want to check for selection.
If the user has a row selected in the listbox named in the parameter, then the UIButton will be set to Enabled.
If the user does not have a row selected in the listbox named in the parameter, then the UIButton will be disabled.
Someone wrote me a letter this weekend, asking if I had any suggestions for breaking into computer game writing, and it occured to me I didn't. I had suggestions for breaking into computer game design, but...
Anyway, here's the gist of the response in case anyone else has a similar question about how it all works.
Writing for video games is something of a different beast compared to game design. My experience is that someone will contract a writer (and usually late in the process) onc
UIButton 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.
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.
The child objects that a UIButton can contain are:
Up to 1 UIText field. If a UIText object is not defined as a child object in the XML, the engine will
(Rich Taylor gives us a peek into 2da caching)
Our 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.
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.
I took that a bit further and made it so that the # o
UIText is the GUI object used for containing and rendering text. It is one of the more complicated UI Objects to work with.
UIText takes the following attributes:
fontfamily
This defines which font should be used via a string argument. The fonts are defined in fontfamily.xml. The 'name' attribute for the different UIFontFamily elements in fontfamily.xml is how they are identified here. If this attribute is not set, then the text field will use the 'Default' font family defined in fon
By: Rich Taylor
UI 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.
The following attributes are handled by UIFrame:
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:
topleft, topright, top, left, right, bottom, bottomleft, bottomright, fill.
The next set of attributes are
By: Rich Taylor
In 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.
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.
As a result, objects that are set hidden via SetGuiObjectHidden() will STAY hidden no matter what,
Q: Trying to modify the knockdown feat in the feats.2da and here's what I've found.
There is both a Cooldown time and also a Uses per day.
Cooldown
If I set a cooldown time it "works", in a sense you can only use the kd feat every X seconds (whatever you set it as) - but the problem with this, is that it doesn't give any graphical feed back to the users (for example, Rage shows a "greyed out" icon and how long you have to wait till you can reuse it again - if I modify the kd feat it d
Q: With 8-bit alpha, is it possible with the current NWN2 engine to use the alpha to make a surface translucent (as in 50% opacity with an alpha pixel value of 50%)?
A: There are two ways to make a surface translucent.
One way would be to make a special effect that edits the alpha. In the VFX editor this would be called a "game model effect". Then you'd have to assign the effect to the object via the toolset, or script.
The second way would be to export the model that you want the
By: Rich Taylor
Taking 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.
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 wh
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.
The following are the attributes that will be loaded for every UI Object in the XML file except for the attributes.
Some attributes will be ignored or overridden depending on the situation. Note that attributes are case sensitive.
name
String value for the name of the UI Object. This is used internally and will be