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 
 
nwnx_funcs for windows
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 27, 28, 29  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Xylou



Joined: 06 Apr 2010
Posts: 7
Location: France

PostPosted: Wed May 19, 2010 20:41    Post subject: Reply with quote

I've just tested the SetGender function.
It's working but the player must disconnect/reconnect to see the visual change in the appearance. Is that normal and due to nwn limitations?
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Wed May 19, 2010 20:44    Post subject: Reply with quote

Its a nwn thing, it only does the visual part of the gender change when the PC object is initiated. Which only happens on login I think. You could try applying a very short polymorph effect - like 0.5 seconds, that could cause the model to reload. Very Happy
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Wed May 19, 2010 23:15    Post subject: Reply with quote

Terra_777 wrote:
Its a nwn thing, it only does the visual part of the gender change when the PC object is initiated. Which only happens on login I think. You could try applying a very short polymorph effect - like 0.5 seconds, that could cause the model to reload. Very Happy


If you only need to change the model, SetAppearanceType should do the trick.
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Wed May 19, 2010 23:49    Post subject: Reply with quote

Fireboar wrote:
Terra_777 wrote:
Its a nwn thing, it only does the visual part of the gender change when the PC object is initiated. Which only happens on login I think. You could try applying a very short polymorph effect - like 0.5 seconds, that could cause the model to reload. Very Happy


If you only need to change the model, SetAppearanceType should do the trick.


Unfortunately it doesn't Crying or Very sad
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Xylou



Joined: 06 Apr 2010
Posts: 7
Location: France

PostPosted: Thu May 20, 2010 8:52    Post subject: Reply with quote

MaxRock is right, I've already had the same idea Idea but using SetAppearanceType doesn't solve the problem.

Nevertheless I don't have tried the Terra_777's polymorph trick. I'll try it asap.
Back to top
View user's profile Send private message
ArielT



Joined: 26 Jan 2010
Posts: 30

PostPosted: Thu May 20, 2010 20:31    Post subject: Reply with quote

Right now to set an integer (the caster level on the spell I just cast, I had to make a whole separate function that iterates to find a proper selection.

Code:
void AddCasterLevel(object oTarget, int CasterLevel)
{
    int nSpellID = GetSpellId();
    NWNXFuncs_GetFirstEffect(oTarget);
    // This shouldn't be called wihtout this at least being true

    do
    {
        if (NWNXFuncs_GetEffectSpellId() == nSpellID) // Makes sure it's the right spell
        {
            if (NWNXFuncs_GetEffectInteger(7) == 0) // Is this an already existening instance?
            {
                NWNXFuncs_SetEffectInteger(7,CasterLevel);
                break;
            }
        }
    }
    while (NWNXFuncs_GetNextEffect(oTarget));
}


Is there some way I should be doing this differently? It works as is, but I was thinking a function to jump the pointer (I assume that's what GetFirstEffect uses) last created effect or something similar might be nice.
Back to top
View user's profile Send private message MSN Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Thu May 20, 2010 21:45    Post subject: Reply with quote

ArielT wrote:

Is there some way I should be doing this differently? It works as is, but I was thinking a function to jump the pointer (I assume that's what GetFirstEffect uses) last created effect or something similar might be nice.


The problem is that the last effect might not be the one that was last applied:
For example EffectAbilityIncrease(...) actually applies 2 effects: the ability increase one and one that shows an icon for the player. Use NWNXFuncs_DumpEffects to get a clearer picture; the" true effect type" it shows can be found in nwn_const.h in the include folder.
The effects list is also automatically sorted by this true type, so the last in the list is not the last one applied.
I hope this makes some kind of sense.

On the positive side, I might have found the spot in the object stucture that stores the pointer to the effect of the GetFirst/GetNextEffect calls. I'm still getting weird results but I'm hoping to eventually do away with the custom NWNXFuncs_GetFirst/GetNext effect loop and use the regular one.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ArielT



Joined: 26 Jan 2010
Posts: 30

PostPosted: Thu May 20, 2010 23:04    Post subject: Reply with quote

MaxRock wrote:
The problem is that the last effect might not be the one that was last applied:
For example EffectAbilityIncrease(...) actually applies 2 effects: the ability increase one and one that shows an icon for the player. Use NWNXFuncs_DumpEffects to get a clearer picture; the" true effect type" it shows can be found in nwn_const.h in the include folder.
The effects list is also automatically sorted by this true type, so the last in the list is not the last one applied.
I hope this makes some kind of sense.
Yes, it makes good sense... Is there no order of precedence, then? Could it not just check for whether the effect type will be displayed or not and work backward?

Quote:
On the positive side, I might have found the spot in the object stucture that stores the pointer to the effect of the GetFirst/GetNextEffect calls. I'm still getting weird results but I'm hoping to eventually do away with the custom NWNXFuncs_GetFirst/GetNext effect loop and use the regular one.
>.> W00t.
Back to top
View user's profile Send private message MSN Messenger
Xylou



Joined: 06 Apr 2010
Posts: 7
Location: France

PostPosted: Fri May 21, 2010 9:08    Post subject: Reply with quote

Terra_777 wrote:
Its a nwn thing, it only does the visual part of the gender change when the PC object is initiated. Which only happens on login I think. You could try applying a very short polymorph effect - like 0.5 seconds, that could cause the model to reload. Very Happy

For info, I've tried it and, unfortunately, the polymorph trick doesn't help to reload the model linked to the current gender. So a player need to disconnect/reconnect in order to see the correct appearance of his character's gender. Confused
Back to top
View user's profile Send private message
axs



Joined: 11 Feb 2005
Posts: 76

PostPosted: Fri May 21, 2010 9:29    Post subject: Reply with quote

Game protocol may not support that change so maybe only solution is to force player reconnection
ActivatePortal(oPC, YourServerIP, YourServerPassord, "", TRUE);
Back to top
View user's profile Send private message
ArielT



Joined: 26 Jan 2010
Posts: 30

PostPosted: Sun May 23, 2010 1:48    Post subject: Reply with quote

Neat. If you use NWNXFuncs_AddKnownSpell() you can add to the sorcerer spell list... But only for that log in.
Back to top
View user's profile Send private message MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun May 23, 2010 4:51    Post subject: Reply with quote

ArielT wrote:
Neat. If you use NWNXFuncs_AddKnownSpell() you can add to the sorcerer spell list... But only for that log in.
Yes but you can add them again after new log in. And new spell in quickslots remains.

But what makes this useable is that arcane mod level adds new spell uses that means, when Palemaster levels do nothing by default, if you add new spells from spell level the character has not from sorcerrer (for example 3sorc/10pm -> adding 2. and higher spell level spells) after rest he gain spell uses as he would be lvl 8sorc!

This means, only thing you have to do is something where player choose spells, and then make them persist.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon May 24, 2010 4:03    Post subject: Reply with quote

Latest version (0.71) is on the vault http://nwvault.ign.com/View.php?view=Other.Detail&id=1447

Code:

   Added:
      NWNXFuncs_ApplyVisualEffectForPC (Apply VFX_FNF_* and VFX_IMP_* effects for a specific PC only)
      
      New effect functions for use in a regular GetFirst/GetNextEffectLoop (the old ones have been renamed, see Changed section and updated fx_example)
         NWNXFuncs_GetEffectIntegers
         NWNXFuncs_GetEffectInteger
         NWNXFuncs_SetEffectInteger
         NWNXFuncs_GetEffectRemainingDuration
         NWNXFuncs_GetEffectID
         NWNXFuncs_GetEffectRealType
      
   Fixed:
      NWNXFuncs_AddFeat should now correctly handle feats with Uses per Day (instead of having unlimited uses until the player relogs)
   
   Changed:
      This update breaks existing scripts which use the following functions:
            NWNXFuncs_GetEffectIntegers
            NWNXFuncs_GetEffectInteger
            NWNXFuncs_SetEffectInteger
            NWNXFuncs_GetEffectRemainingDuration
            NWNXFuncs_GetEffectID
            NWNXFuncs_GetEffectRealType
     More about this in readme.txt

Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Mon May 24, 2010 23:01    Post subject: Reply with quote

wonderfull

now there is included almost everything a builder can want

so if you run out of ideas there is a small request list (ordered by useability for me):

- monk UBAB handling with weapons - like add quaterstaff to include monk ubab
- allowing feats to work on new baseitem just like some default weapon feat
- speed handling without need to relog
- new spellbooks
- special ability handling - adding/removing them to PCs
- changing effect icon
- itemproperty struct handling

Twisted Evil
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Tue May 25, 2010 3:44    Post subject: Reply with quote

Quote:

- itemproperty struct handling
- special ability handling - adding/removing them to PCs

Those two are on the todo list

Quote:

- monk UBAB handling with weapons - like add quaterstaff to include monk ubab
- allowing feats to work on new baseitem just like some default weapon feat

I actually have the GetAttackBonusVersus function used by the combat engine "recreated" to work with the PRC attack scripts.
This would be a good place for that, together with all other PRC combat feats.
I'm still trying to figure how to hook it back / override it into the game, but this might be something for a new combat plugin.

Quote:

- speed handling without need to relog

If I can figure out what exactly is done on login... Might help with virusman's area pluging too.

Quote:

- changing effect icon
- new spellbooks

Haven't even looked at any of these. Would be nice though.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 27, 28, 29  Next
Page 6 of 29

 
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