View previous topic :: View next topic |
Author |
Message |
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Fri Apr 16, 2010 10:10 Post subject: |
|
|
Nope, what I was looking for was reading out what a PC got at what level.
However Get/SetBodyBag? Useful for flagging "activated" in the subrace system I'm working with. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Fri Apr 16, 2010 19:44 Post subject: |
|
|
Do you mean the type of bodybag or whether one is left on death? |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sat Apr 17, 2010 2:51 Post subject: |
|
|
The latest version can be found at the vault.
Code: | v 0.0.61
Added:
Get/SetItemValue
SetItemWeight
SetItemCharges
SetDomain
GetDomain
SetWizardSpecialization
GetWizardSpecialization
ReplaceKnownSpell
GetRemainingSpellSlots
SetRemainingSpellSlots
GetMaxSpellSlots
GetBonusSpellSlots
GetMemorizedSpellSlot
SetMemorizedSpellSlot
RestoreMemorizedSpells
GetFeatCount
GetKnownSpells
GetKnownSpellCount
SetConversation
GetConversation
GetEffectRemainingDuration
Get/SetBodyBag
GetFeatsGainedAtLevel
GetSkillRanksGainedAtLevel
GetSpellsGainedAtLevel
GetStatsGainedAtLevel
Fixed:
The default number of skills (if not set in nwnx.ini) was 27 instead of 28
Changed:
GetFirst/GetNextLocalVariable:
Plugin functions are prone to crashing the server.
Script function GetNextLocalVariable now uses localvar_s struct returned by GetFirstLocalVariable as argument
GetAllKnownFeats:
Spacer should be set to a valid length automatically and hopefully not cause problems in the toolset script editor anymore
Init Function:
Call from OnModuleLoad!
This is necessary to get a pointer on the module itsef in order for GetEffectRemainingDuration to work
|
I'm still not sure about GetFirst/GetNextLocalVariable.
The old versions seemed to cause (random) crashes on our PW while it worked fine on my test server. |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sat Apr 17, 2010 3:28 Post subject: |
|
|
Got some issues with the new include file.
When I build the module scripts I get the following error:
Access violation at address 007FB463 in module 'nwtoolset.exe'. Read of address 0B2E4000.
Never had this sort of problem with a script before.
EDIT: May have found the problem. It's saying the MemorizedSpellSlot structure is being redefined.
EDIT 2: Looks like you forgot to rename MemorizedSpellSlot to MemorizedSpellSlot_s.
I made the changes and things compile just fine now. Hope that helps |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sat Apr 17, 2010 19:22 Post subject: |
|
|
I downloaded the archive from the vault again to make sure I hadn't put any old files in there and the following compiled just fine
Code: |
#include "nwnx_funcs"
void main()
{
struct MemorizedSpellSlot slot;
slot.id=10;
slot.ready=1;
NWNXFuncs_SetMemorizedSpellSlot(OBJECT_SELF, 9, 1, 0, slot);
} |
I have to admit I haven't used the toolset compiler in a while but the toolset shouldn't throw an access violation because of an error in a script, should it? |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sat Apr 17, 2010 20:30 Post subject: |
|
|
MaxRock wrote: | I downloaded the archive from the vault again to make sure I hadn't put any old files in there and the following compiled just fine
Code: |
#include "nwnx_funcs"
void main()
{
struct MemorizedSpellSlot slot;
slot.id=10;
slot.ready=1;
NWNXFuncs_SetMemorizedSpellSlot(OBJECT_SELF, 9, 1, 0, slot);
} |
I have to admit I haven't used the toolset compiler in a while but the toolset shouldn't throw an access violation because of an error in a script, should it? |
I don't really know. I've never seen that error pop up before because of scripts. There were no hakpaks in my test module but I did have some of my own scripts. They may have been what was causing it.
It's probably on my end but so far everything looks great. Thanks so much for porting these. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Apr 22, 2010 6:49 Post subject: |
|
|
VirgiL wrote: |
i spot in linux port of this plugin, there are some 'quickslot' functions - do you think you will be able to make some functions that can set/get the current setup of player quickslots?
would be really great... even im not sure what those linux port functions do |
Alright here's a little update on saving and restoring quickslots.
Excluding items and DM creator objects I've got it to where I can save and restore quickslots without crashing the server (I really hate string handling);
And I've got a little demo which essentially adds 20 more quickslots via saving and restoring the last 10 (CTRL+F3-F12).
What I still can't figure out are items.
They're no problem while the server is running - the quickslot data simply holds the oIDs. But looking into the bic file, any quickslot with an item has data which is not found in memory while the server is running (e.g.: x/y coordinates, cast spell properties).
My guess is that when a character is exported a function cycles through the quickslots and pulls the data from items there. |
|
Back to top |
|
|
ArielT
Joined: 26 Jan 2010 Posts: 30
|
Posted: Thu Apr 22, 2010 10:41 Post subject: |
|
|
Hi, I was looking at converting over the PRC's letoscript character creator to a "real time" version. You've got most of the stuff here, with only like 3 "essentials" missing: race, class and max hit points. Less importantly are gender and portrait Are these on your to do list? |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Apr 22, 2010 10:54 Post subject: |
|
|
Wow, can't believe I forgot SetClass.
SetRace and SetMaxHitpoints are already there though |
|
Back to top |
|
|
ArielT
Joined: 26 Jan 2010 Posts: 30
|
Posted: Thu Apr 22, 2010 14:37 Post subject: |
|
|
MaxRock wrote: | Wow, can't believe I forgot SetClass.
SetRace and SetMaxHitpoints are already there though | Sorry, is the readme not complete, then? Find and manual searches through it don't seem to reveal either of those. |
|
Back to top |
|
|
Baragg
Joined: 22 Apr 2009 Posts: 6
|
Posted: Thu Apr 22, 2010 19:29 Post subject: |
|
|
How is this coming Max? _________________ We are never so defensless against suffering, as when we Love.
Sigmund Freud |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Fri Apr 23, 2010 1:21 Post subject: |
|
|
Baragg wrote: | How is this coming Max? |
Well, we're about to reboot our server to get the latest build online. ... and to see how quickly players manage to crash the server
Edit:
OHHKAY! My quickslot extension script crashes the server really well.
So I started a test server on my own machine; separate nwserver, separate mysql, but compiled scripts are loaded from our PW server via resman.
It works fine as long as the quickslots are stored on the PC (local strings).
Switching to an item in the PC's inventory for persistency throws things out of whack. "ERROR: IP OUT OF CODE SEGMENT", "ERROR: INVALID OP CODE" Despite this my test server is still running, BUT:
The PW machine reboots everytime I change quickslots! |
|
Back to top |
|
|
Xylou
Joined: 06 Apr 2010 Posts: 7 Location: France
|
Posted: Fri Apr 23, 2010 9:18 Post subject: |
|
|
ArielT wrote: | Less importantly are gender and portrait Are these on your to do list? |
Just after reading that, I've just thought a SetGender and SetPortrait could be used together in a "Disguise process".
So, I join you ArielT for this kind of request !
Let's hope one day MaxRock will grant us this wish |
|
Back to top |
|
|
Baragg
Joined: 22 Apr 2009 Posts: 6
|
Posted: Fri Apr 23, 2010 16:26 Post subject: |
|
|
MaxRock wrote: | Baragg wrote: | How is this coming Max? |
Well, we're about to reboot our server to get the latest build online. ... and to see how quickly players manage to crash the server
Edit:
OHHKAY! My quickslot extension script crashes the server really well.
So I started a test server on my own machine; separate nwserver, separate mysql, but compiled scripts are loaded from our PW server via resman.
It works fine as long as the quickslots are stored on the PC (local strings).
Switching to an item in the PC's inventory for persistency throws things out of whack. "ERROR: IP OUT OF CODE SEGMENT", "ERROR: INVALID OP CODE" Despite this my test server is still running, BUT:
The PW machine reboots everytime I change quickslots! |
It is always nice to find new ways to crash the server. _________________ We are never so defensless against suffering, as when we Love.
Sigmund Freud |
|
Back to top |
|
|
Baragg
Joined: 22 Apr 2009 Posts: 6
|
Posted: Fri Apr 23, 2010 17:00 Post subject: |
|
|
K, mayhap I am a bit confused. I copy the dll into my NWN folder, compile the include into my test mod and bam the functions should work? I created a boulder with this in the onused:
Code: | #include "nwnx_funcs"
void main()
{
int iCount = NWNXFuncs_GetAreaCount();
SpeakString(IntToString(iCount), TALKVOLUME_SHOUT);
} |
There are 3 areas in the module but this shouts 0. _________________ We are never so defensless against suffering, as when we Love.
Sigmund Freud |
|
Back to top |
|
|
|