View previous topic :: View next topic |
Author |
Message |
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sun Feb 19, 2012 0:57 Post subject: |
|
|
werehound wrote: | Function
Code: | // changes the SpellID (returned by GetEffectSpellID or GetEffectSpellIDInternal) of the last effect applied
// on oObject to iSpellID. If the last effect applied used EffectLinkEffects(...) this will affect
// all the effects linked together.
void NWNXFuncs_SetLastEffectSpellID(object oObject, int iSpellID); |
Has no defined body? Cannot use it? |
You should be able to achieve the same result with Code: | NWNXFuncs_SetEffectSpellIDByEffectID(oObject, NWNXFuncs_GetHighestEffectID(oObject), iNewID);
|
|
|
Back to top |
|
|
werehound
Joined: 17 Aug 2010 Posts: 41
|
Posted: Sun Feb 19, 2012 7:30 Post subject: |
|
|
Uhhh.... How do I use it? Is EffectID the result from "GetSpellEffectID"? |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Tue Feb 21, 2012 0:38 Post subject: |
|
|
int EffectID = NWNXFuncs_GetHighestEffectID(oObject) will get the ID of the last effect that was applied to oObject. Then, you can use this ID to change the spell id of that effect with NWNXFuncs_SetEffectSpellIDByEffectID(oObject, EffectID, NewSpellID). |
|
Back to top |
|
|
werehound
Joined: 17 Aug 2010 Posts: 41
|
Posted: Thu Feb 23, 2012 6:17 Post subject: |
|
|
Fantastic! Thank you! |
|
Back to top |
|
|
apsoft
Joined: 08 Mar 2012 Posts: 1
|
Posted: Thu Mar 08, 2012 10:36 Post subject: |
|
|
hi,
I've a problem with NWNXFuncs_AddKnownSpell, OS is Win7
When i add a spell on this PC "5 lev Sorcerer + 10 Lev Pale Master" with this func
Code: | NWNXFuncs_AddKnownSpell (oPC, CLASS_TYPE_SORCERER, 1, SPELL_MAGIC_MISSILE); |
the server works fine, but when i modify my script with
Code: | NWNXFuncs_AddKnownSpell (oPC, CLASS_TYPE_SORCERER, 3, SPELL_GREATER_MAGIC_WEAPON); |
script adds the spell to the creature's list of known spells but the server crashes when player log out , anyone knows why?
thank you to all
p.s. sorry for my english XD |
|
Back to top |
|
|
Peepsy
Joined: 07 Apr 2012 Posts: 6
|
Posted: Sat Apr 07, 2012 6:51 Post subject: |
|
|
Hey Maxrock. First, thanks so much for doing this... You've saved lives, I am sure you know. I was wondering if you can do something with the linux function
"GetMeetsLevelUpFeatRequirements()"
This would save us a huge headache of 2da looping, if possible. Thanks. |
|
Back to top |
|
|
Greyfort
Joined: 20 Jul 2010 Posts: 66
|
Posted: Wed Apr 11, 2012 21:57 Post subject: |
|
|
Forgive me, ware is the link for the latest and greatest nwnx_functtions. I'm have trouble finding it? |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Apr 12, 2012 22:25 Post subject: |
|
|
The dll can be found on vault I think.
Or you can build it yourself from the nwnx_win32 svn.
Its in the branches.
Hey Max, or Terra, or anyother c++ guru's out there.
Code: |
#include "stdafx.h"
int CallMyDLL(char* strAssembly, char* strClassFunc, char* pszArgs[])
{
/* get handle to dll */
HINSTANCE hGetProcIDDLL = LoadLibrary(strAssembly);
/* get pointer to the function in the dll*/
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),strClassFunc);
/*
Define the Function in the DLL for reuse. This is just prototyping the dll's function.
A mock of it. Use "stdcall" for maximum compatibility.
*/
typedef int (__stdcall * pICFUNC)(char *[]);
pICFUNC MyFunction;
MyFunction = pICFUNC(lpfnGetProcessID);
/* The actual call to the function contained in the dll */
int intMyReturnVal = MyFunction(pszArgs);
/* Release the Dll */
FreeLibrary(hGetProcIDDLL);
/* The return val from the dll */
return intMyReturnVal;
} |
Can someone comment on whether this will work?
Im trying to make it possible to execute a .Net dll / method, from c++.
The idea being that the funcs dll receives the command, then delegates to a dot net dll, which can then do other things.
I just wana know if im on the right track?
Would any of you be able to perfect this? |
|
Back to top |
|
|
Kato
Joined: 05 Mar 2010 Posts: 47
|
Posted: Fri Apr 13, 2012 21:49 Post subject: |
|
|
Does anyone else have a problem with the function NWNXFuncs_GetStatsGainedAtLevel()? The struct member iAbility returns -1 for any level I check, wich is probably normal except for levels 4, 8, 12 and so on.
The log after a test, passing 4 as the level to check:
- StrReq: "GETSTATSGAINEDATLEVEL" Params: "4 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
o Error (GetSpellsGainedAtLevel): Could not get stats for given level(-1).
EDIT: I have reverted to 089 and the problem disappeared, but 09* versions dont work for me regarding the specified function.
Thanks
Kato |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Apr 25, 2012 15:49 Post subject: |
|
|
If plugins for restart with module change through scripts? |
|
Back to top |
|
|
werehound
Joined: 17 Aug 2010 Posts: 41
|
Posted: Thu Apr 26, 2012 3:24 Post subject: |
|
|
Kato wrote: | Does anyone else have a problem with the function NWNXFuncs_GetStatsGainedAtLevel()? The struct member iAbility returns -1 for any level I check, wich is probably normal except for levels 4, 8, 12 and so on.
The log after a test, passing 4 as the level to check:
- StrReq: "GETSTATSGAINEDATLEVEL" Params: "4 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
o Error (GetSpellsGainedAtLevel): Could not get stats for given level(-1).
EDIT: I have reverted to 089 and the problem disappeared, but 09* versions dont work for me regarding the specified function.
Thanks
Kato |
Anythign apst 0.8.9 bugs for me as well with GetDamageImmunity. |
|
Back to top |
|
|
Sag
Joined: 24 Sep 2009 Posts: 8
|
Posted: Fri Apr 27, 2012 22:26 Post subject: |
|
|
I'm having trouble with SetTag. Server crashes whenever I run it.
Code: |
[04/27/2012 13:14:58] Windows NWNX Funcs plugin v.0.0.9.3
[04/27/2012 13:14:58] log level: 2
[04/27/2012 13:14:58] * CustomEffect function hooked
[04/27/2012 13:14:58] * CNWVirtualMachineCommands__ExecuteCommandGetItemPropertyType hooked
[04/27/2012 13:14:58] * CNWVirtualMachineCommands__ExecuteCommandItemPropertyEffect hooked
[04/27/2012 13:14:58] * CNWSMessage__TestObjectVisible hooked
[04/27/2012 13:14:58] * CNWSCreatureStats__GetEffectImmunity hooked
[04/27/2012 13:14:58] * CServerExoAppInternal__RemovePCFromWorld hooked; script to run: onplayerleaving.nss
[04/27/2012 13:15:36] - StrReq: "SETTAG" Params: "AUCTION_ITEM4"
|
Code: | NWN Extender V.2.7-beta4
(c) 2004 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
(c) 2007-2008 by virusman
visit us at http://www.nwnx.org
* Loading plugins...
* Plugin events is loaded.
* Plugin fixes-svn40 is loaded.
* Plugin fixes is loaded.
* Plugin funcs is loaded.
* Plugin odbc is loaded.
* Plugin profiler is loaded.
* NWNX2 activated.
* NWNX2 shutting down...
* NWNX2 shutdown successfull. |
Running on Windows 7 Home Premium x64
I could have sworn I had this working at some point. Thanks for the help. |
|
Back to top |
|
|
werehound
Joined: 17 Aug 2010 Posts: 41
|
Posted: Sat Apr 28, 2012 0:57 Post subject: |
|
|
Revert to 0.8.9. |
|
Back to top |
|
|
doxic
Joined: 07 Oct 2008 Posts: 13
|
Posted: Mon Apr 30, 2012 17:13 Post subject: |
|
|
I also have some issues with nwnx_funcs lately:
Code: | NWNX_PopupMessage() |
and
Code: | NWNXFuncs_ItemPropertyCustom(36, -1, 5, -1) (example for IP with costtable only) |
are always crashing my server. Is there anything i did wrong? Maybe inserting a 0 instead of -1 for values that i don't use?
Or do I need another nwnx_plugin like nwnx_structs? |
|
Back to top |
|
|
Flutterby
Joined: 01 May 2012 Posts: 11
|
Posted: Tue May 01, 2012 12:14 Post subject: |
|
|
apsoft wrote: | hi,
I've a problem with NWNXFuncs_AddKnownSpell, OS is Win7
When i add a spell on this PC "5 lev Sorcerer + 10 Lev Pale Master" with this func
Code: | NWNXFuncs_AddKnownSpell (oPC, CLASS_TYPE_SORCERER, 1, SPELL_MAGIC_MISSILE); |
the server works fine, but when i modify my script with
Code: | NWNXFuncs_AddKnownSpell (oPC, CLASS_TYPE_SORCERER, 3, SPELL_GREATER_MAGIC_WEAPON); |
script adds the spell to the creature's list of known spells but the server crashes when player log out , anyone knows why?
thank you to all
p.s. sorry for my english XD |
I'm having the same problem. Some more specifics:
- The crash only occurs when learning a spell of a level that is not normally available for that character, given his base class. E.g. my sorc 10 / pale master 10 would normally be able to learn spells up to spell level 5. If I add a spell of spell level 5 or below, the server will not crash. If I add a spell of level 6 or up, the server will crash.
- In either case, the character will not have the newly learned spell available when logging in to the server again.
This issue occurs when using 0.0.93 as well as 0.0.91 or 0.0.89.
Here's to hoping someone will be able to help out!
Edit: Using Windows 7, 64 bit |
|
Back to top |
|
|
|
|
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
|