Jump to content

Rob McGinnis

Members
  • Posts

    346
  • Joined

  • Last visited

Everything posted by Rob McGinnis

  1. 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, unless SetGuiObjectHidden() is later used to make it visible. 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.
  2. 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 doesn't show up this graphical feedback [just a message in the combat log]). Is there a way to get a "count down timer" on the feat/hotbar so the player has a visual indication of how much time is left (like the rage feat)? do I have to change another column? uses per day With the uses per day, that is settable. But if they use up all the uses, it removes the feat from their character I can store it as a local int and re-grant them the feat on rest, but the feat seems buggy after that (it shows up in the character screen, but the feat doesn't "activate" when you try and use it - also players have to re-equip to their hotbar which isn't a show stopper, but could be very annoying). feat calling a script Also would there be any way for the KD feat to call a script instead of the hard coded function? That way we could change the formula and how it works via scripting instead of using the default rules for it. Ie, when the user hit's the knockdown button to execute script "MyKnockDownScript". thanks! A: 1. There was a bug with cooldown timers showing up, which has been fixed in an upcoming patch. If you want a feat that only has a cooldown (without uses/day), you'll need to put "-1" in the "USESPERDAY" column (not "****"). Otherwise, I had no trouble having uses/day and cooldown on the same feat. 2. I haven't had any problems with uses per day removing feats from the hotbar. If you send me your character .bic and your feat.2da, I might be able to figure out what is happening (contact me for e-mail info). 3. EffectKnockdown() is available to script. We use a 4.5 second duration for the engine-side knockdown. You could easily create a new feat (call it Trip, perhaps) that is an active feat (set "IsActive" to 1) that calls a spell script (put the script spell ID in "SPELLID").
  3. 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 translucent surface on as a "glow object". However this would cause the object to be additive as well.
  4. 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 when being loaded via script). The actual XML file name doesn't matter. 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. The following are special GUI screens that are loaded differently than most XML files: 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. 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: npclistbox - Listbox of NPC spoken text npctext - Text field for NPC spoken text (Contained by npclistbox generally) replieslistbox - Listbox of Player Reply options skipdialogbutton - Button for skipping through the NPC spoken nodes speakername - Text field for containing the speaker's name portrait - UIPortrait object All but the speakername and portrait fields are necessary or the window will not be loaded. 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: topbar - UIFrame for the top black bar bottombar - UIFrame for the bottom black bar FULLSCREEN_IMAGE - UIIcon used for full screen images. toplistbox - Listbox to contain the text shown on top toplistboxtext - Textfield contained by toplistbox bottomlistbox - Listbox to contain the text shown on the bottom. Spoken by NPCs bottomlistboxtext - Text field contained by bottomlistbox replieslistbox - Listbox to contain the replies available to a player. skipdialogbutton - Fullscreen button for clicking through the dialog Failure to locate any of the above objects will result in the screen not loading. 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. 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. 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. SCREEN_MESSAGEBOX_SPLITSTACK* = Scene used for splitting stacks of items in inventory. The only gui element required is 'inputbox'. 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. 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: messagetext = Text field that contains the message. okbutton = Button that will execute the OK callback cancelbutton = Button that will execute the Cancel callback messageboxlb = Listbox for containing the message text in case the text gets long. MSGBOX_BACKGROUND = Frame used for the background, this one is optional. 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. 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: 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. inputbox - Text field used for user input. IMEREadingWindow - Used for IME support. IMEReadingWindowBG - Used for IME support. IMEComposeWindow - Used for IME support. IMEComposeWindow - Used for IME support. IMECandidateWindow - Used for IME support. IMECandidateWindowBG - Used for IME support. INPUT_CONTAINER - Used by the engine for easily hiding/unhiding the input related objects. 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. 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.
  5. 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 necessary for scripting to interact with this object in the future. scalewithscene 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. usescaler 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. width 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: SCREEN_WIDTH - This object's width will be full screen no matter what the resolution is. 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. height 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. x 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: ALIGN_CENTER - Center this Object to the screen ALIGN_PARENT - Center this object within its parent UI Object. ALIGN_LEFT - Keep this object oriented to the left of its parent (x = 0). ALIGN_RIGHT - Push this object against the right side of the parent object. y 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: ALIGN_CENTER - Center this object to the screen ALIGN_PARENT - Center this object within its parent UI Object. ALIGN_TOP - Keep this object at the top of its parent object (y=0) ALIGN_BOTTOM - Push this object against the bottom of the parent object. focusable 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. ignoreevents 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. handleactiontarget 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. draggable This indicates that the UI Object can be dragged and dropped, such as hotbar buttons. Defaults to false. OnMouseDropReceived 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. OnMouseDrop This callback is executed on a UI Object when it gets dragged and then dropped. Upon being dropped, this callback will be executed. OnMouseDropFailed This callback is executed if a UI Object is dragged and then dropped but not dropped over another UI Object. OnMouseEnter This callback is executed when the mouse cursor is moved over this object. OnMouseLeave This callback is executed when the mouse cursor is moved off of the object after having been moved onto it. OnResize This callback is executed any time the UI Object gets resized for any reason. OnTooltip This callback gets executed if the mouse hovers over this object long enough based on the user's preference for the tooltip delay. OnRadialRequest This is the callback that gets executed if the user brings up the context sensitive menu on this UI object. DefaultTooltip This is a default tooltip STRREF that is used in case a custom tooltip callback is not really necessary. hidden Whether or not this object is visible. Defaults to true.. disabled 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. capturemouseclicks 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. OnGainedFocus 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. OnLostFocus 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. update 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. OnUpdate The callback to be executed when this object receives its update. UpdateRate 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). hotbartype 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: HOTBAR_NONE - The hotbar should ignore this. HOTBAR_ITEM - This is an item icon being dragged, such as from inventory. HOTBAR_KNOWNSPELL - This item being dragged is something from the spellbook. HOTBAR_SPELL - This item is a spell from somewhere else, such as another hotbar slot. HOTBAR_FEAT - This item is a feat from somewhere, such as the feat listing or another hotbar slot. HOTBAR_BUTTON - This is an empty hotbar button. HOTBAR_SKILL - This is an activateable skill, such as from the skills pane or another hotbar slot. HOTBAR_TOGGLEMODE_BUTTON - This is a button used to toggle some kind of mode. HOTBAR_BARTER - This is used to flag barter grid items as not being able to be dragged to the hotbar. HOTBAR_DM_COMMAND - The item being dragged is a DM Client command. HOTBAR_VM_COMMAND - The item being dragged is an emote command. HOTBAR_DM_CREATOR - The item being dragged is an entry from the DM Client Creator. Scale*ToParent 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. MouseOverSFX The sound effect to play when this UI Object gets moused over. alpha How transparent this object should be by default. dontrendermousegrab '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. SetDataInt This stores an 'int' value in the UI Object's data element at int index 0. More on data elements another time. SetDataFloat This stores a 'float' value in the UI Object's data element at float index 0. More on data elements another time. SetDataString This stores a 'string' value in the UI Object's data element at string index 0. More on data elements another time.
  6. If there's something really important that you would like to see fixed in NWN2, or you think it is not being addressed, you are free to send me a PM on the Bioware forums to let me know about it. Alternatively, we have the Community Representatives that do a great job of letting me know what issues people have. Also, I am in the Community Representative IRC channel throughout most of the day (IRC: irc.neverwinterconnections.com, Public Channel: NWN2CR) and we get programmers and such stopping by as well.
  7. 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 for UIPane are similar to those found under UIButton. The following attributes are supported by UI Pane: MouseDownSFX Sound effect to be played when the Pane is clicked on. This only means anything if the Pane is a tupple style pane. MouseUpSFX Similar to a button up sound effect, this only means anything if the Pane is a tupple style pane. MouseDragSFX Sound effect for dragging a tupple style UI Pane object. MouseDropSFX Sound effect when releasing a dragged tupple style UI Pane object. tupple 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. OnLeftClick The callback to be executed when a tupple style UI Pane is left clicked on. OnLeftDoubleClick The callback to be executed when a tupple style UI Pane is double left clicked on. OnRightClick The callback to be executed when a tupple style UI Pane is right clicked on. OnRightDoubleClick The callback to be executed when a tupple style UI pane is double right clicked on.
  8. 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, 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. The following is a list of the items that have gone in so far for 1.05: armorrulestats.2da will no longer be capped at 255 rows 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. 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. The chat boxes will no longer clear their text on area or module transitions. NWN2_Deities.2da can now be overridden correctly, without having to stick it into the override directory. NWN2_Deities.2da's description column can now work with hard coded strings in place of STRREFs. Simply enclose the string in " marks. 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. 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. 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. 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. 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.
  9. 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. The following attriibutes are supported by the UIScene tag: OnCreate 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. priority This determines where scenes fall in the render order, in terms of which scenes should cover up other scenes. The valid arguments to this attribute in order of highest priority to lowest are: SCENE_TOOLTIP - Appears on top of any other GUI SCENE_GLOBAL - Used for messageboxes generally. SCENE_FE_FULLSCREEN - Pre-game full screen GUIs SCENE_INGAME_FULLSCREEN - Full screen GUIs within the game. SCENE_INGAME_SYSTEM - Escape menu and options screens. SCENE_SCRIPT - GUIs brought up by script SCENE_NWN1_DIALOG - The NWN1 style dialog box SCENE_INGAME_MENU - The popup player menu SCENE_INGAME - Most of the windows in-game SCENE_INGAME_TARGET - The target box OnDestroy This callback gets executed when the scene is unloaded from memory. OnAdd This callback gets executed any time the scene is made visible. OnRemove 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 idleexpiretime below for more information. OnBackout This callback gets executed when the user hits their Esc key and this scene is going to be closed as a result. If the backoutkey attribute is not true, then this callback will do nothing. OnUpdate This is the callback to execute every frame. OnUnhandledMouseClick 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. updaterate The time between updates, in seconds. If no value is specified, the scene will get an update every frame. draggable 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. dragregion_x dragregion_y dragregion_width dragregion_height 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. dragresizable 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. dragresizeborder This attribute defines the size, in pixels, of the border of the scene that can be clicked on in order to resize the window. capturemouseclicks 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. capturemousevents This is pretty much a redundant attribute. It does the exact same thing as capturemouseclicks. fullscreen 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. width 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. height 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. x The x origin for the window. The following string arguments are also valid: ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT. Defaults to 0. y The y origin for the window. The following string arguments are also valid: ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM. Defaults to 0. expiretime 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. idleexpiretime 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. autolayout 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. modal 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. fadein The time in seconds this scene should take to fade in completely when opened. fadeout The time in seconds this scene should take to fade out completely when closed. minwidth This attribute is defunct and no longer does anything. minheight This attribute is defunct and no longer does anything. scriptloadable 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. backoutkey 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.
  10. Q: Some of the blocks in a MDB file have a 32-bit field in front of the vertex count field, which we assume is a flag bit vector. In most cases it has a value of 0, but occasionally some bits are set. What do they indicate? A: The bitflags are as follows for skin and rigid packets: const DWORD NWN2_ALPHA_TEST = 1 << 0; const DWORD NWN2_ALPHA_BLEND = 1 << 1; // #### SHOULD NOT BE USED const DWORD NWN2_ADDITIVE_BLEND = 1 << 2; // #### SHOULD NOT BE USED const DWORD NWN2_ENVIRONMENT_MAPPED = 1 << 3; const DWORD NWN2_CUTSCENE_MESH = 1 << 4; const DWORD NWN2_GLOW = 1 << 5; const DWORD NWN2_NO_CAST_SHADOWS = 1 << 6; const DWORD NWN2_PROJECTED_TEXTURES = 1 << 7; Most of them are pretty straightforward. The projected texture flag means that the model will accept UI projected textures such as the spell targeting cursor.
  11. 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) If something is flaged as PercepRngDefault, instead of reading the values from the columns on that row, it looks up the creature's Appearance in Appearance.2da and uses the PERCEPTIONDIST column to find out what row creatures with that appearance are supposed to use. PERCEPTIONDIST in appearances.2da should reference back to a row in ranges.2da from which to read the values in from. If all else fails, a creature will be assigned the values stored in the PercepRngMin row.
  12. Q: Currently I am working on a community download pack containg a large variety of foilage placeables (ferns, shrubs, weeds, flowers, small trees etc.). I am using alpha layers in my textures, and currently have tried dxt5 interpolated alpha (this is what format I use for my foilage in other engines such as UT2003/4) and also dxt1 with alpha, but I get no transparency in the toolset. My models and textures are showing up in the toolset just fine, but the engine seems to ignore the alpha on my diffuse, and uses the alpha on my normal for glossyness/shinyness to an extent. I verified this when I omitted the normal map. I have tried assigning the materials to the models in every way I can think of, even left off the normal map so I am at my wits end. What dds format is used on textures with alpha for transparencies? (Exp: SpeedTree tex are using alpha transparency) Is there some setting in the MDB file itself that tells the engine it has transparency, and if so it would be the next gap filled in the work of those who are making the MDB utilites that allow us to get our new models in the toolset if this information was made available? If the setting for transparency in a texture of a model isn't in the MDB file, where is and what values need to be applied to get it working properly? DXT5 is the recommended dds format for alpha-masked transparency textures, though DXT3 and DXT1,1-bit alpha also work. We use DXT5 because it yields cleaner masking and edge quality for things like plant fronds and grass. The mask goes in the alpha channel of the diffuse texture. Any model utilizing transparency needs to be flagged as such before it is exported. Information regarding the public release of our model exporter is not currently available, but we intend to make it available in the near future. You can see a good example here: Click Here
  13. 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. )... bit 3: dirt bit 4: grass bit 5: stone bit 6: wood bit 7: carpet bit 8: metal bit 9: swamp bit 10: mud bit 11: leaves bit 12: water bit 13: puddles bits 14 - 31: reserved Q: I would like to know how I can import mp3's and such into the game to use as background sound for my module. I have NO idea how to do this, and I haven't been able to find a tutorial that dumbs things down for those of us who don't know what we're doing; most of the sound tutorials seem fairly advanced. All I know is that I need a hak-pak, and that I need to edit a 2da file and convernt my mp3's to bmu's. I don't know how to do this or even how to begin doing this, so if anyone has a good link to a tutorial for us beginners, or can explain it here, I would TREMENDOUSLY appreciate it. Thanks! A: The way it should work in NWN2 is identical to NWN1. There is also a brief tutorial on NWN1 at http://nwn.bioware.com/builders/sounds_bmu.html with links on how to do additional sounds. NWN2 can take and play uncompressed WAV file in the Override, but that would be pretty huge in size. Basically, we use an APP called "Lame" that takes a .Wav file, converts it to MP3 (changing some header information) and rename it back to a .Wav extension. Click Here So automate it some you can make a .bat file (assuming they are using LAME) that will basically convert a WAV file, make it an MP3, rename it a Wav file, then delete the old MP3's with the following commands. lame -S --quiet -t %1.wav %1.mp3 echo BMU V1.0 > "\WavFolder\%1.wav" type %1.mp3 >> \DifferentWaveFolder\%1.wav" del /f /q %1.mp3 Q: How do I use custom terrain-texures from a hak pak? I've tried placing a modified "terrainmaterials.2da"-file with the extra entries plus the corresponding dds-files in a hak pak which I then added to the module. There is no obvious way, however, to select the custom terrain-textures within the toolset. I used "Bioware Hak Pak Editor v 1.0.2.0" Any help will be appreciated. A: If you are trying to load a hak pack up in the toolset, this does not currently work. They are only loaded in when the module is run inside the game. So a Hak Pak will do you no good in the editor. To make it work in the editor you have to place the textures and edited 2DA file in your override folder.
  14. 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 package domain selection has no knowledge of deity selection either. Q: Creating new skills require not only modifying skills.2da (which is straight-forward enough), but also a set of GUIs in chargen_skills.xml and characterscreen.xml. In both of these, each individual skill carries its own UIPane: does this mean that all skills are hard-coded, and that it is not possible for us to add new ones? A: Not without some extra work. The mentioned GUI screens will have to be changed to reflect the new Skills you have added. The good news is that you can simply override the old GUI screens by turning your module into a campaign and placing your new GUI screens in the campaign directory. There also seems to be some internal coding that needs to be changed. Updates soon.
  15. 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: The problem is that the Idx values will return different information for every single different kind of effect. While it would be nice if we could document all of that, doing so is outside the scope of answering just this question. If there is a specific spell we need to look into, let us know. Q: Are the values for SetEffectSpellID limited to valid SpellID values only? I tried setting a high order value (maxinteger value - 500 or so) and failed to read back what I set. I was hoping to use this a a unique Efffect Identifier for effects applied outside spell scripts, so that I could unquely ID and remove that effect at a later point. A: I couldn't find any limits to the SetEffectSpellID parameter. I also looked for areas where maybe the value would be stored as something that wouldn't accommodate a large number (such as a WORD), but couldn't find anything like that in the code either. I would recommend trying this with a smaller number than something near MAXINT to see if you get the results you expect.
  16. 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
×
×
  • Create New...