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 
 
SetTag

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Wed Oct 01, 2008 15:47    Post subject: SetTag Reply with quote

I have not changed over to the nwnx_funcs yet, cause im lazy and havnt gotten to it, but is there a bug with SetTag?

Im using it in my forge and setting tags OnAcquire and i have noticed that the tags will never be set longer then 12-14 characters. But its weird that it tends to vary as to how many characters it will use.

Here is my function to change the tags. You will notice alot have had to be shortened. I was just curious if a known bug existed

Code:
void SetUpForgeTags(object oAcquired)
{
string sNewTag;

////////////////////////////////////////////////////////////////////////////////
//:: 55 Primary Componenets                                                 :://
////////////////////////////////////////////////////////////////////////////////

//ABILITY_BONUS
    if(GetTag(oAcquired) == "x2_it_cmat_adam")          sNewTag = "PRIMARY_00";    //Bar of Adamantine
//AC_BONUS
    else if(GetTag(oAcquired) == "zep_holy_water")      sNewTag = "PRIMARY_01";    //Holy Water

////////////////////////////////////////////////////////////////////////////////
//:: Secondary Components                                                   :://
////////////////////////////////////////////////////////////////////////////////
    else if(GetTag(oAcquired) == "NW_IT_MPOTION015")    sNewTag = "ABILITY_STR";    //Potion of Bull's Strength
    else if(GetTag(oAcquired) == "NW_IT_MPOTION014")    sNewTag = "ABILITY_DEX";    //Potion of Cat's Grace
    else if(GetTag(oAcquired) == "NW_IT_MPOTION013")    sNewTag = "ABILITY_CON";    //Potion of Endurance
    else if(GetTag(oAcquired) == "NW_IT_MPOTION017")    sNewTag = "ABILITY_INT";    //Potion of Fox Cunning
    else if(GetTag(oAcquired) == "NW_IT_MPOTION018")    sNewTag = "ABILITY_WIS";    //Potion of Owl's Wisdom
    else if(GetTag(oAcquired) == "NW_IT_MPOTION010")    sNewTag = "ABILITY_CHA";    //Potion of Eagle's Splendor

    SetTag(oAcquired, sNewTag);
}


I removed the majority cause not everyone can know the recipies Razz
Back to top
View user's profile Send private message
acaos



Joined: 08 May 2007
Posts: 153

PostPosted: Thu Oct 02, 2008 0:57    Post subject: Reply with quote

Yes, there is a bug with the nwnx_functions SetTag() where it cannot extend the length of the existing tag.

The one in nwnx_funcs has a different bug, where it may leak memory (it does not de-allocate the existing tag, but simply creates a new tag). Unfortunately, I found that de-allocating the existing tag sometimes crashes the server.

On Higher Ground, we only set tags rarely, and since there are at most 64 bytes per tag, the leak is not a concern for us. If you were setting them on thousands of objects, that might be more of an issue.

Acaos
Back to top
View user's profile Send private message
Extreme



Joined: 28 Nov 2007
Posts: 135

PostPosted: Thu Oct 02, 2008 6:14    Post subject: Reply with quote

well i revamped my forge to use variables instead of SetTag so that i can offer it to others easily. But i just wanted to ask to make sure it was known
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support 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