logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
xp_objectattributes - Game object attributes editor plugin

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Fri Apr 15, 2011 9:15    Post subject: xp_objectattributes - Game object attributes editor plugin Reply with quote

xp_objectattributes is a plugin that adds new script APIs to change attributes about objects. Most of the attributes currently editable are appearance data, but this may change in the future.

The plugin distribution includes the plugin binary (place in your NWNX4 directory), debug symbols (useful for developers), an ERF package containing a new script include that defines the additional script functions you can use with the plugin for your module scripts, and an example callable GUI script (gui_test_objectattributes.nss) that demonstrates how to perform basic attribute editing. Note that the GUI script is not required and is just an example.

Current posted version is: 0.0.1 for 1.0.23.1765. Old versions for older server releases are archived below. xp_objectattributes is compatible with any set of installed expansion packs for a given supported NWN2 version, as the server binaries are the same across all expansion releases at a given patch level. You do need to match the xp_objectattributes version to the game patch level that you are using, however.

Source is available in the skywing-dev branch of virusman's NWNX4 SVN repository (src/plugins/xp_objectattributes).

Important note: You must install the Visual C++ 2005 SP1 CRT. (Pick the 32-bit, vcredist_x86.exe download.) If you do not install the VC2005 CRT, xp_objectattributes will silently fail to load.

Release (0.0.1) binaries + symbols for NWN2 1.0.23.1765: http://www.nynaeve.net/Skywing/nwn2/xp_objectattributes/xp_objectattributes_01.zip (Please see above note about requirement to install the VC2005 CRT.)

Script APIs exposed by xp_objectattributes are listed below. See important notes:

* Note: Some attributes (appearance changes in particular) do not save to player GFFs permanently. This may change in the future. I recommend limiting usage of the apperance editing APIs to just NPCs.
* Note: Some attributes (appearance changes in particular), though synchronized to the client, do not cause the client to properly reload model data until the client leaves and re-joins the area (or the NPC being edited leaves and rejoins the area -- with roughly 300ms minimum between the parting and rejoining). If you are editing an NPC in an area with players, you will need to shunt the NPC to a temporary standby area, wait 300ms, then shunt the NPC back to where it resided before. This ensures that clients will see updated model/appearance data.


Changelog:

Version 0.0.1:

- Initial release.


New script APIs added by current xp_objectattributes release:

Code:

void
XPObjectAttributesSetHeadVariation(
   object Creature,
   int Variation
   );
/*++

Routine Description:

   This routine changes the head variation of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   Variation - Supplies the new variation value.

Return Value:

   None.

Environment:

   Any script callout.

--*/

void
XPObjectAttributesSetHairVariation(
   object Creature,
   int Variation
   );
/*++

Routine Description:

   This routine changes the hair variation of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   Variation - Supplies the new variation value.

Return Value:

   None.

Environment:

   Any script callout.

--*/


void
XPObjectAttributesSetTailVariation(
   object Creature,
   int Variation
   );
/*++

Routine Description:

   This routine changes the tail variation of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   Variation - Supplies the new variation value.

Return Value:

   None.

Environment:

   Any script callout.

--*/

void
XPObjectAttributesSetWingVariation(
   object Creature,
   int Variation
   );
/*++

Routine Description:

   This routine changes the wing variation of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   Variation - Supplies the new variation value.

Return Value:

   None.

Environment:

   Any script callout.

--*/

void
XPObjectAttributesSetFacialHairVariation(
   object Creature,
   int Variation
   );
/*++

Routine Description:

   This routine changes the facial hair variation of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   Variation - Supplies the new variation value.

Return Value:

   None.

Environment:

   Any script callout.

--*/

void
XPObjectAttributesSetBodyTint(
   object Creature,
   struct XPObjectAttributes_TintSet TintSet
   );
/*++

Routine Description:

   This routine changes the body tint of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   TintSet - Supplies the new tint set value.

Return Value:

   None.

Environment:

   Any script callout.

--*/

void
XPObjectAttributesSetHeadTint(
   object Creature,
   struct XPObjectAttributes_TintSet TintSet
   );
/*++

Routine Description:

   This routine changes the head tint of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   TintSet - Supplies the new tint set value.

Return Value:

   None.

Environment:

   Any script callout.

--*/

void
XPObjectAttributesSetHairTint(
   object Creature,
   struct XPObjectAttributes_TintSet TintSet
   );
/*++

Routine Description:

   This routine changes the hair tint of a creature object.

Arguments:

   Creature - Supplies the object id of a creature object to modify.

   TintSet - Supplies the new tint set value.

Return Value:

   None.

Environment:

   Any script callout.

--*/

struct XPObjectAttributes_Color
CreateXPObjectAttributes_Color(
   float r,
   float g,
   float b,
   float a
   );
/*++

Routine Description:

   This routine constructs a struct XPObjectAttributes_Color.

Arguments:

   r - Supplies the red value [0...1]

   g - Supplies the green value [0...1].

   b - Supplies the blue value [0...1].

   a - Supplies the alpha value [0...1].

Return Value:

   The routine returns a constructed struct XPObjectAttributes_Color.

Environment:

   Any script callout.

--*/

struct XPObjectAttributes_TintSet
CreateXPObjectAttributes_TintSet(
   struct XPObjectAttributes_Color Tint0,
   struct XPObjectAttributes_Color Tint1,
   struct XPObjectAttributes_Color Tint2
   );
/*++

Routine Description:

   This routine constructs a struct XPObjectAttributes_TintSet.

Arguments:

   Tint0 - Supplies the first tint value.

   Tint1 - Supplies the second tint value.

   Tint2 - Supplies the third tint value.

Return Value:

   The routine returns a constructed struct XPObjectAttributes_TintSet.

Environment:

   Any script callout.

--*/
Back to top
View user's profile Send private message
Krarsht



Joined: 21 Oct 2010
Posts: 5

PostPosted: Tue Apr 26, 2011 12:21    Post subject: Reply with quote

Hi Skywing,

Great, I will use it for sure ^_^

Krarsht
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group