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 
 
NWNX2 Events question..

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
Zaith



Joined: 05 Jun 2007
Posts: 21

PostPosted: Sun Jun 17, 2007 3:21    Post subject: NWNX2 Events question.. Reply with quote

I updated my test server to NWNX2 2.7b2, it loads correctly and none of the log files give any errors.

However, when I go into the test module and attack something it says "Attacking events_demo" instead of "Attacking Dummy" which is what I attacked... It also does the same thing with Pick Pocketing.. "events_demo" is the tag of the module that comes with the Events plugin so I have no idea why it would be returning that. I also compiled the plugin myself instead of using the .so that comes with the package. The compile also gave no errors.

I didn't test the "Use Item" hook, but I'm assuming that it does the same thing.

I only have one more question. Is there a way to stop the action from happening? Like stopping the actual default pickpocket? I tried to use BypassEvent() thinking that would work, but it didn't.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sun Jun 17, 2007 9:34    Post subject: Reply with quote

Set debuglevel to 4 and paste the log file contents here.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Zaith



Joined: 05 Jun 2007
Posts: 21

PostPosted: Sun Jun 17, 2007 16:44    Post subject: Reply with quote

nwnx_events.txt
Code:

NWNX Events version 1.1.5 for Linux.
(c) 2006-2007 by virusman (virusman@virusman.ru)
! SaveChar hooked at 805d694.
! ActPickPocket hooked at 81166f0.
! ActAttack hooked at 8116da0.
! UseItem hooked at 8113e98.
! ConversationNodeSelect hooked at 82399b0.
! ShowEntryNode hooked at 81ce26c.
! ConditionalScript hooked at 82385b4.
! RunProc located at 825d38c.
o EVENTS: Fired event 2 (7FFFFFFE). Calling 'vir_events'
Request: "GET_EVENT_ID"
Params:  "      "
o Shutdown.
Request: "BYPASS"
Params:  "1"
o EVENTS: Fired event 3 (7FFFFFFE). Calling 'vir_events'
Request: "GET_EVENT_ID"
Params:  "      "
o Shutdown.
UseItem: oPC=7FFFFFFE, oTarget=7FFFFFFE, oItem=00000010, vTarget=0.000000/0.000000/0.000000
o EVENTS: Fired event 4 (7FFFFFFE). Calling 'vir_events'
Request: "GET_EVENT_ID"
Params:  "      "
o Shutdown.
o Shutdown.
Request: "GET_EVENT_POSITION"
Params:  "                                              "


nwnx2.txt
Code:

NWN Extender v2.7-beta2
--------------------------------
MNX plugin Registerred.
Address: B7C95160
ODBC plugin Registerred.
Address: B7C8A2A0
HASHSET plugin Registerred.
Address: B7A42420
FUNCTIONS plugin Registerred.
Address: B7C8131C
EVENTS plugin Registerred.
Address: B7A32F80
CHAT plugin Registerred.
Address: B7A21240
* NWNX2 activated.
name='NWNX!INIT'
value='1'
INIT(S): valid ret=0x0820149c
name='NWNX!INIT'
INIT(O): valid ret=0x08201129
name='NWNX!EVENTS!GET_EVENT_ID'
value='      '
* Library EVENTS!GET_EVENT_ID found: B7A32F80
* OnRequest address: 0000000D
name='NWNX!EVENTS!TARGET'
* Library EVENTS!TARGET found: B7A32F80
* OnRequest address: 00000011
name='NWNX!EVENTS!BYPASS'
value='1'
* Library EVENTS!BYPASS found: B7A32F80
* OnRequest address: 0000000D
name='NWNX!EVENTS!GET_EVENT_ID'
value='      '
* Library EVENTS!GET_EVENT_ID found: B7A32F80
* OnRequest address: 0000000D
name='NWNX!EVENTS!TARGET'
* Library EVENTS!TARGET found: B7A32F80
* OnRequest address: 00000011
name='NWNX!EVENTS!GET_EVENT_ID'
value='      '
* Library EVENTS!GET_EVENT_ID found: B7A32F80
* OnRequest address: 0000000D
name='NWNX!EVENTS!TARGET'
* Library EVENTS!TARGET found: B7A32F80
* OnRequest address: 00000011
name='NWNX!EVENTS!ITEM'
* Library EVENTS!ITEM found: B7A32F80
* OnRequest address: 00000011
name='NWNX!EVENTS!GET_EVENT_POSITION'
value='                                              '
* Library EVENTS!GET_EVENT_POSITION found: B7A32F80
* OnRequest address: 0000000D


nwserverLog1.txt
Code:

[Sun Jun 17 10:36:59] NWNX Event fired: 2, 'Pererin Nert'
[Sun Jun 17 10:36:59] Pererin Nert tried to steal from events_demo
[Sun Jun 17 10:37:07] NWNX Event fired: 3, 'Pererin Nert'
[Sun Jun 17 10:37:07] Pererin Nert attacked events_demo
[Sun Jun 17 10:37:13] NWNX Event fired: 4, 'Pererin Nert'
[Sun Jun 17 10:37:13] Pererin Nert used item 'events_demo' on events_demo
Back to top
View user's profile Send private message
Zaith



Joined: 05 Jun 2007
Posts: 21

PostPosted: Mon Jun 18, 2007 2:22    Post subject: Reply with quote

Has anyone else had this problem that might be able to point me in the right direction?
Back to top
View user's profile Send private message
Zaith



Joined: 05 Jun 2007
Posts: 21

PostPosted: Mon Jun 18, 2007 3:19    Post subject: Reply with quote

Ok, so after recompiling about 10 times it finally gives the correct information.

Can I add allowing BypassEvent() to bypass the PP event to the wishlist?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Jun 18, 2007 9:31    Post subject: Reply with quote

Zaith wrote:
Ok, so after recompiling about 10 times it finally gives the correct information.
What was the problem?
Zaith wrote:
Can I add allowing BypassEvent() to bypass the PP event to the wishlist?
Sure.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Zaith



Joined: 05 Jun 2007
Posts: 21

PostPosted: Mon Jun 18, 2007 22:31    Post subject: Reply with quote

I'm not exactly sure what the problem was.. It was probably something on my end, and not anything to do with the plugin itself.

Oh, and about the BypassEvent() working with PP.. I read through the HookFunc.cpp (I took a semester of C++ during college, so I can read it somewhat, just not write it myself), and changed the PP hook from:

Code:

void PickPocketHookProc()
{
   asm ("pusha");
   if (!scriptRun)
   {
      //Get oPC
      asm ("mov 0x8(%ebp), %eax");
      asm ("add $4, %eax");
      asm ("mov %eax, oPC");

      //Get oTarget
      asm ("mov 0xC(%ebp), %eax");
      asm ("mov %eax, oTarget_b");
      events.oTarget = oTarget_b;
      //asm ("sub $4, %edi");
      events.FireEvent(*(dword *)oPC, EVENT_PICKPOCKET);
   }
   asm ("popa");
   asm ("leave");
   asm ("mov $d_ret_code_pp, %eax");
   asm ("jmp %eax");
}


to

Code:

void PickPocketHookProc()
{
   asm ("pusha");
   if (!scriptRun)
   {
      //Get oPC
      asm ("mov 0x8(%ebp), %eax");
      asm ("add $4, %eax");
      asm ("mov %eax, oPC");

      //Get oTarget
      asm ("mov 0xC(%ebp), %eax");
      asm ("mov %eax, oTarget_b");
      events.oTarget = oTarget_b;
      //asm ("sub $4, %edi");
      bBypass_b = events.FireEvent(*(dword *)oPC, EVENT_PICKPOCKET);
   }
   asm ("popa");
   asm ("leave");
   if(bBypass_b)
   {
      asm("mov $1, %eax");
      asm("ret");
   }
   asm ("mov $d_ret_code_pp, %eax");
   asm ("jmp %eax");
}


and it now allows me to bypass the event. Is that going to break anything? I just copied and pasted from the Use Item function, and it works.. but I've learned that 'works' and 'works without breaking something else' are two different things.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
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