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 ... 19, 20, 21 ... 27, 28, 29  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Sat Feb 05, 2011 10:13    Post subject: Reply with quote

Get/SetEventscript seems to work for me too. I've set and read all of them back for all the different object types without problems.

Same for the custom trap geometry.

What's wrong with using BootPCWithMessage from nwnx_functions? I only ask because when I try to do it the server goes down Embarassed

I'm not sure what exactly was wrong with PossessCreature that caused a crash.
I just tested it and was able to switch between a commoner and a regular PC more or less fine, except that the commoner:
- immediately could level up to 40
- rested in zero time
- saving the character saved the commoner not the original PC
but no crashes
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Sat Feb 05, 2011 12:35    Post subject: Reply with quote

Boot pc with message works for me, I use the code I posted on previous page inside nwnx_funcs.

As far as possession goes, I didn't know it was working last time I tried it, it would crash the server if I possessed an npc and then tried resting or levelling. Odd.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Feb 06, 2011 6:36    Post subject: Reply with quote

I had problem with trap geometry, but that was only because I had missing ini settings, it works fine otherwise.

BootPCWithMessage from nwnx_functions worked for me AFAIK, but its quite long time ago I used it, im not building my PW atm.

Welcome back btw Wink
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Greyfort



Joined: 20 Jul 2010
Posts: 66

PostPosted: Sun Feb 06, 2011 22:13    Post subject: Reply with quote

God Bless welcome back MaxRock, whats the link for the newest work you've done?

Also I was wondering if you or anyone else was working on these functions for windows Functions...
Renamed CalculateEffectDurationBasis() to CalculateStructDurationBasis()
Added GetItemPropertyDuration()
Added GetItemPropertyDurationRemaining()
Added GetItemPropertyInteger()
Added SetItemPropertyInteger()
Added GetItemPropertySpellId()
Added SetItemPropertySpellId()


from the linux nwnx_structs
They would be nice to have so we can have persistant unique item storage

EDIT ADD:

I found this link on source forge for the functions posted above:

http://sourceforge.net/tracker/index.php?func=detail&aid=3168942&group_id=332110&atid=1392706

but found no comments.

I found this link for your newest NWNX_FUNCS:

http://sourceforge.net/projects/mrnwnxstuff/

Thanks for all your work MaxRock. Did you plan on working on those functions is that why you made a post on source forge?
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Feb 07, 2011 1:54    Post subject: Reply with quote

Greyfort wrote:

http://sourceforge.net/tracker/index.php?func=detail&aid=3168942&group_id=332110&atid=1392706

but found no comments.

I found this link for your newest NWNX_FUNCS:

http://sourceforge.net/projects/mrnwnxstuff/

Thanks for all your work MaxRock. Did you plan on working on those functions is that why you made a post on source forge?


The first link is the "feature request" tracker - figured I might as well use it since it's there - so es, I am working on those; having a little trouble getting the iprp struct the way nwnx_structs does it.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Mon Feb 07, 2011 13:40    Post subject: nwnx_visability Reply with quote

Hi Max -
I made the following feature request on your sourceforge.

Quote:

Virusman released nwnx_visability which was able to programatically set whether player a is able to see player b
The result is being able to set player 'a' invisible to player 'b', but not invisibile to player 'c'.

The way this was done, was via creating an array list of objects (players) for each player, and then setting visibility true or false or default for each one.

Then this value is read back, in a hook for the internal Visability check function.


Is there any chance of getting this converted to Win32?
Currently, I am having to do this via EffectSanctuary - to make the player vanish, but it only makes the player vanish to hostiles, I would love to make it so player vanishes to all players in the vicinity.

-Baaleos



Its just a desirable feature, as currently it only exists in Linux.


Note - What sort of error do you get when you try to use BootPCWithMessage

When I get home, I will paste the exact source code I am using in my own edit of nwnx_funcs - But as far as I know, it should match what I pasted on previous pages.


Note - the code I use, should be something like this

this in cNetLayer - I think
Code:

int            (__thiscall *CNetLayer__DisconnectPlayer)(CNetLayer *pTHIS, uint32_t plyer,uint32_t iMsg, int iConst)  = (int (__thiscall *)(CNetLayer *pTHIS, uint32_t plyer,uint32_t iMsg, int iConst))0x0041F490;



int CNetLayer_s::BootPlayerWithMessage(uint32_t PlayerID, uint32_t iVal){
   return CNetLayer__DisconnectPlayer(this,PlayerID,iVal,1);
   //return NULL;
   //return CNetLayer__DisconnectPlayer(PlayerID, iVal, 1);
}




and this in Funcs_def
Code:

int CNWNXFuncs::BootWithMessage() {
   int iMsg = 0;
   sscanf(Params, "%d", &iMsg);
   CNWSObject *obj = (CNWSObject*)oObject;
   nwn_objid_t plID = obj->obj_generic.obj_id;
   CNWSPlayer* pPlayer = ((*NWN_AppManager)->app_server)->GetClientObjectByObjectId(plID);
   if(pPlayer != NULL)
   {
   uint32_t pID = pPlayer->pl_id;
   CNetLayer* netlayer = (*NWN_AppManager)->app_server->srv_internal->srv_network;
   
   netlayer->BootPlayerWithMessage(pID,iMsg);
   return 1;
   }
   return 0;
}
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Feb 07, 2011 19:18    Post subject: Reply with quote

Your code works fine, Baaleos. I've added it already.
Thank you Very Happy
Back to top
View user's profile Send private message Send e-mail MSN Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Feb 07, 2011 22:22    Post subject: Reply with quote

How important are SetItemPropertyInteger() SetItemPropertySpellId()?

I assume they're for applying custom item properties via script... In that case I might have to think of something different.

I have all the requested "Get" functions working but the "Set" ones don't actually do anything.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Tue Feb 08, 2011 1:02    Post subject: Reply with quote

v 086 is up
Quote:

Added:
NWNXFuncs_GetEffectSubType
NWNXFuncs_BootPCWithMessage
NWNXFuncs_GetItemPropertyDuration
NWNXFuncs_GetItemPropertyDurationRemaining
NWNXFuncs_GetItemPropertyInteger
NWNXFuncs_GetItemPropertySpellId
NWNXFuncs_SetItemPropertyInteger
NWNXFuncs_SetItemPropertySpellId
NWNXFuncs_ItemPropertyCustom


NWNXFuncs_SetItemPropertyInteger and NWNXFuncs_SetItemPropertySpellId unfortunately don't have any effect on the itemproperty though Confused
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Greyfort



Joined: 20 Jul 2010
Posts: 66

PostPosted: Thu Feb 10, 2011 23:06    Post subject: Reply with quote

so the SET functions from the linux nwnx_structs work in the linux struct, whats the defining factor? Otherwise the get work so we can get the data but if we try to reverse the proces we have to use the nwn standard functions. Until you can fix it correct?
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Fri Feb 11, 2011 0:24    Post subject: Reply with quote

Greyfort wrote:
so the SET functions from the linux nwnx_structs work in the linux struct, whats the defining factor? Otherwise the get work so we can get the data but if we try to reverse the proces we have to use the nwn standard functions. Until you can fix it correct?


Working on it. I didn't take into account that items could have effects applied to them.

EDIT
Nor that I was not changing the actual effect.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Feb 27, 2011 12:43    Post subject: Reply with quote

Seems there is a bug in GetLocalVarByPosition function, I have this code that is supposed to delete all variables on item.

Code:
void ProjdiInventar(object oPoklad, int nType, int nLevel)
{
int nTh, nNum = NWNXFuncs_GetLocalVariableCount(oPoklad);
DebugInt("nNum",nNum);
 for(;nTh < nNum;)
 {
 struct localvar_s l = NWNXFuncs_GetLocalVarByPosition(oPoklad,nTh++);
  switch(l.iType)
  {
  case LV_TYPE_INT:
  DeleteLocalInt(l.obj,l.sName);
  break;
  case LV_TYPE_STR:
  DeleteLocalString(l.obj,l.sName);
  break;
  }
 }
SpeakString(GetName(oPoklad)+" hotov");
}

But each loop only half of them is actually deleted, not sure which, but after some time when I found out where was problem I was by repeating able to delete them all...
_________________
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: Sun Feb 27, 2011 19:00    Post subject: Reply with quote

Yes, deleting variables in a loop is kind of a problem; unlike DestroyObject for example DeleteLocal*** seems to be called immediately which changes the list

Let's say we have this:

nTh = 0;
var[0]: 55
var[1]: 66
var[2]: 77

After you delete var[0] and increase your counter by 1:

nTh = 1
var[0]: 66
var[1]: 77

Since the list has been "reindexed" you're skipping '66'

Deleting all locals should be possible with this
Code:

while (NWNXFuncs_GetLocalVariableCount(oPoklad)) {
   struct localvar_s l = NWNXFuncs_GetLocalVarByPosition(oPoklad,0);
   switch(...) {
    delete ...
   }
}


Hm.. I guess not incrementing nTh when you actually delete a variable should work too.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Feb 27, 2011 19:13    Post subject: Reply with quote

aah, ok, that explains everything, thanks
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Mon Feb 28, 2011 12:05    Post subject: Reply with quote

On temporary item properties, how are you acquiring the item property in script? There's lots of wonkiness there.
_________________
Neversummer PW NWNx powered mayhem Wink
Back to top
View user's profile Send private message
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 ... 19, 20, 21 ... 27, 28, 29  Next
Page 20 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