Jump to content
  • entries
    74
  • comments
    426
  • views
    1,414,437

About this blog

Questions, Answers and a Little Bit More

Entries in this blog

 

Welcome!

Welcome to the Neverwinter Nights 2 Blog!   Here you will find answers to questions asked on the official Neverwinter Nights 2 Forums and some additional information put out by some of the developers at Obsidian.   With these Blogs we hope to give you some insight into the workings of the game and answer some of the more difficult questions

Rob McGinnis

Rob McGinnis

 

Walkmesh and Textures and Music. Oh my!

Q: In walkmeshes, each face has a 32-bit flag. We have seen the values 0x0, 0x9, 0x11, 0x21, 0x41 and 0x101. The bottom bit seems to indicate whether the face is walkable or not, but what do the other bits mean?   A: The bit assignments for the walkmesh face flags are: bit 0: walk bit ( 1 = walk, 0 = no walk ) bit 1 - 2: reserved bit 3 - 13: material ( used for footstep sounds, etc... I dont know what will happen if more than one of these are set at the same time. I dont recommend it. )... bi

Rob McGinnis

Rob McGinnis

 

Variable Length, GetEffectInteger and SpellEffectID

Q: How long can a variable name be? How long can a string be?   A: While the runtime virtual machine doesn't have any limits that we could find, the compiler will reject tokens that are longer than 512 characters. So that would probably be the de facto limits of variable or hard coded string length.       Q: What effect information do different values for the Idx parameter give back for GetEffectInteger()? There doesn't appear to be many comments on this function that I can find.   A:

Rob McGinnis

Rob McGinnis

 

Upcoming 1.05 Patch

Rich Taylor gives us a peek into what will be in the 1.05 patch:   While 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.   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, t

Rob McGinnis

Rob McGinnis

 

UIText

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

Rob McGinnis

Rob McGinnis

 

UIScene

The UIScene tag at the top of the XML files defines certain global parameters about the entire GUI window being defined in the file.   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.   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.  

Rob McGinnis

Rob McGinnis

 

UIPane

UIPane is the generic 'container' for other UI Objects. Panes can't be rendered, but they can contain 'child' objects which can be renderable objects.   Every scene has a 'rootpane', which is automatically defined by the engine when a new UIScene is loaded from a XML file.   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

Rob McGinnis

Rob McGinnis

 

UIObject_Tooltip_DisplayTooltipString

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,

Rob McGinnis

Rob McGinnis

 

UIObject_Misc_StoreObjectData

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

Rob McGinnis

Rob McGinnis

 

UIObject_Misc_ExtractData

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

Rob McGinnis

Rob McGinnis

 

UIObject_Input_ActionTargetScript

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

Rob McGinnis

Rob McGinnis

 

UIObject - hideoverride

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,

Rob McGinnis

Rob McGinnis

 

UIObject

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

Rob McGinnis

Rob McGinnis

 

UIFrame

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

Rob McGinnis

Rob McGinnis

 

UIButton_OnUpdate_ControlSelected

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.

Rob McGinnis

Rob McGinnis

 

UIButton

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

Rob McGinnis

Rob McGinnis

 

UI Listbox

Written by Rich Taylor, Lead Programmer.   Whew, sorry for not finishing off the UI Objects. There's not too many left to document here before all the basic UI types should be covered, I think...   Anyway, on to UIListBox. UIListBox is a container similar to UIPane and anything listed under UIPane that makes sense for UIListBox probably does the same thing under UIListBox. So I'm going to stick to discussing the attributes that are unique to UIListBox. Refer to UIPane for the basic attribu

Rob McGinnis

Rob McGinnis

 

Three-part Question on adding feats

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

Rob McGinnis

Rob McGinnis

 

Special Screens

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

Rob McGinnis

Rob McGinnis

 

Small 1.06 Fixes

- By Rich Taylor   Just 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 (which means this week - Rob)... That's about all I know about it. =)   EnableAreaWater() - Turn water rendering on/off in an area. SpeakOneLinerConversation() - Now takes a volume parameter (Only supports talk, whisper, and shout) SetScale() - changed to accept x, y, z axis as parameters Dedicated Server now correct

Rob McGinnis

Rob McGinnis

 

Scripting Update

Rich Taylor brings us another look at what's happening on his end:   Here'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.   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.   CreateItemOnObject() - Added new string parameter to provide the newly create

Rob McGinnis

Rob McGinnis

 

Restricting Diety Selection and Addign Skills

Q: Is there a way that you can filter the domains available when taking the first level of cleric, based on the deity the player chooses? Torm, for example, might only offer the Good, Sun, War and Healing domains. Is this possible?   A: It is not currently possible to restrict domains based on deity selection.   The Domain GUI code has no knowledge of your deity selection, nor is there any data loaded up on a deity-by-deity basis on what domains are in that deity's portfolio. Also, default

Rob McGinnis

Rob McGinnis

 

Ranges.2da and Seeing Stars

Q: Ranges.2da has 2 columns labeled 'PrimaryRange' and 'SecondaryRange' which are apparently only used for perception ranges... Which of these columns affects the seeing range and which hearing (I assume 'Primary' is hearing based on my tests, but I'm not sure)? What values does the PercepRngDefault use? It uses the usual **** entries for default values, but where is that value defined?   A: Primary Range is the Spot range (Visual range) Secondary Range is the Listen range (Hearing range)

Rob McGinnis

Rob McGinnis

 

Porting Creatures/Objects from NWN1

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.

Rob McGinnis

Rob McGinnis

×
×
  • Create New...