View previous topic :: View next topic |
Author |
Message |
Xylou
Joined: 06 Apr 2010 Posts: 7 Location: France
|
Posted: Wed May 19, 2010 20:41 Post subject: |
|
|
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 |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Wed May 19, 2010 20:44 Post subject: |
|
|
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. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Wed May 19, 2010 23:15 Post subject: |
|
|
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. |
If you only need to change the model, SetAppearanceType should do the trick. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Wed May 19, 2010 23:49 Post subject: |
|
|
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. |
If you only need to change the model, SetAppearanceType should do the trick. |
Unfortunately it doesn't |
|
Back to top |
|
|
Xylou
Joined: 06 Apr 2010 Posts: 7 Location: France
|
Posted: Thu May 20, 2010 8:52 Post subject: |
|
|
MaxRock is right, I've already had the same 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 |
|
|
ArielT
Joined: 26 Jan 2010 Posts: 30
|
Posted: Thu May 20, 2010 20:31 Post subject: |
|
|
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 |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu May 20, 2010 21:45 Post subject: |
|
|
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 |
|
|
ArielT
Joined: 26 Jan 2010 Posts: 30
|
Posted: Thu May 20, 2010 23:04 Post subject: |
|
|
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 |
|
|
Xylou
Joined: 06 Apr 2010 Posts: 7 Location: France
|
Posted: Fri May 21, 2010 9:08 Post subject: |
|
|
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. |
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. |
|
Back to top |
|
|
axs
Joined: 11 Feb 2005 Posts: 76
|
Posted: Fri May 21, 2010 9:29 Post subject: |
|
|
Game protocol may not support that change so maybe only solution is to force player reconnection
ActivatePortal(oPC, YourServerIP, YourServerPassord, "", TRUE); |
|
Back to top |
|
|
ArielT
Joined: 26 Jan 2010 Posts: 30
|
Posted: Sun May 23, 2010 1:48 Post subject: |
|
|
Neat. If you use NWNXFuncs_AddKnownSpell() you can add to the sorcerer spell list... But only for that log in. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sun May 23, 2010 4:51 Post subject: |
|
|
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 |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Mon May 24, 2010 4:03 Post subject: |
|
|
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 |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Mon May 24, 2010 23:01 Post subject: |
|
|
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
_________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Tue May 25, 2010 3:44 Post subject: |
|
|
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 |
|
|
|