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 Events
Goto page Previous  1, 2, 3 ... , 10, 11, 12  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Ravine



Joined: 26 Jul 2006
Posts: 105

PostPosted: Sat Oct 09, 2010 19:48    Post subject: Reply with quote

No, i mean PREVENT the disturbance, and get the item which was tried.
Shops don't have the onDisturbed event by the way, and i wanna use it on them...
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Oct 22, 2010 9:34    Post subject: Reply with quote

Hooked object deletion.. It's very sensitive - about a half of NWScript functions will crash the server when called inside the event handler, but it may be useful, since localvars, tag, resref and other base information is accessible.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Squatting Monk



Joined: 28 Jun 2007
Posts: 76

PostPosted: Thu Nov 04, 2010 7:08    Post subject: Reply with quote

Is there any way to get the absolute node ID in the action script of an NPC node? GetSelectedAbsoluteNodeID() works for PC action nodes, and GetCurrentAbsoluteNodeID() works for PC and NPC check nodes, but neither works for NPC action nodes.

My work-around thus far has been to get put a check script on every NPC node that has an action script and use GetCurrentAbsoluteNodeID() to store the ID as a local int for retrieval in the action script. Is there a better way, or is this a bug?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Nov 04, 2010 11:43    Post subject: Reply with quote

Yes, it doesn't hook NPC nodes' action scripts yet.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Dec 03, 2010 19:25    Post subject: Reply with quote

Unreleased material: object destruction hook, GetScriptReturnValue (run any conditional script with RunScript, then get the result with this function).
I'll release it when I have time. If you need it sooner, you can ask here.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Squatting Monk



Joined: 28 Jun 2007
Posts: 76

PostPosted: Sat Dec 04, 2010 7:43    Post subject: Reply with quote

virusman wrote:
GetScriptReturnValue (run any conditional script with RunScript, then get the result with this function).

Ohmigod, I will worship you forever for this. Shocked
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Wed Jun 01, 2011 21:06    Post subject: Reply with quote

Hi,

Just wondering if anyone else has this same issue. I'm currently using 1.3.2 but even with earlier versions anything captured with the EVENT_TOGGLE_MODE produces a STACK UNDERFLOW message such as :

Quote:
Script ae_ev_modevent, OID:fffffffd, Tag: , ERROR: STACK UNDERFLOW


In that specific case I was toggling counterspell against an NPC but the same happens with a player. The following code is used:

Code:
    case EVENT_TYPE_TOGGLE_MODE:
      oPC = OBJECT_SELF;
      nSubType = GetEventSubType();
      oTarget = GetEventTarget();

...

      if (nSubType == ACTION_MODE_COUNTERSPELL) {
        SendMessageToDev("DBG: Counterspell bypass for "+ GetName(oPC) +" target was "+ GetName(oTarget));
        BypassEvent();
      }
      break;


oTarget is invalid and the event is not bypassed. I have also taken out that debug line and the attempt to get the event target with the same results.

The nwnx_event.txt log shows this:

Code:
ToggleMode: pCreature=7FFFFFFD, nMode=5
Request: "GET_EVENT_ID"
Params:  "          "
Request: "GET_EVENT_SUBID"
Params:  "          "
ObjRequest: "TARGET"
Request: "BYPASS"
Params:  "1"


I'm quite wary about wary about what is called when in that event script so apart from a couple of GetLocalInts to grab variables or SetDescription on the EXAMINE it is fairly clean.

Any clues, gotchas or anything else I can check?

Paul
_________________
oops
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Wed Jun 01, 2011 22:08    Post subject: Reply with quote

Could you post a link to the compiled script, source, and debug symbols for it (ncs, nss, and ndb files)? (Or PM them to me.)

I'd be curious to see whether this appears to be a compiler issue or just a runtime problem with the NWNX code mismanaging the VM stack. I've got some tools for performing static analysis on compiled scripts that should let us identify whether the compiler was at fault here.
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Thu Jun 02, 2011 3:52    Post subject: Reply with quote

hmm, in case it matters I'm using the nwnnsscomp from the Linux command line to compile all of the scripts. There is no version string but the copyright header is:

Copyright 2002-2003, Edward T. Smith
Copyright 2003, The Open Knights Consortium

The binary is 796535 bytes.

I can create a cutdown version of the event script and see if that still has issues, if so I'll post a link to it. If that cutdown version does not have the issues I'll add the code back in till it does.

In the meantime I have downloaded the Advanced Script Compiler zip file and will have a look tomorrow.

Thanks for your help

Paul
_________________
oops
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Thu Jun 02, 2011 8:02    Post subject: Reply with quote

I'd be interested to see what the results are.

(The Advanced Script Compiler is an extended version of the compiler core behind nwnnsscomp, with a number of patches to fix bugs and add warnings/errors to bring it into parity with the standard BioWare compiler in compatibility mode, plugged in to a different resource loader backend and with a rewritten compiler driver frontend. I don't produce a Linux port of it, but brianmeyer at irc.nwn2source.net/#nwn2cr has been patching an OSX fork of nwnnsscomp with my changes, if you're curious. Since nobody else has been maintaining ETS's compiler, I've more or less assumed maintainership of my own fork of it.)
Back to top
View user's profile Send private message
Ravine



Joined: 26 Jul 2006
Posts: 105

PostPosted: Fri Jun 03, 2011 15:59    Post subject: Reply with quote

Hi!

I also had that STACK UNDERFLOW errors all the time. First, i thought resman plugin causing it, but it's not that. Probably you're right, it must be the compiler, because when i changed the main switch/case structure to if/else, everything is OK.
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Fri Jun 03, 2011 19:03    Post subject: Reply with quote

Interesting, I'm glad you said that as that validates something I have seen before.

I tried that same workaround as well a couple of months back and it did clear up some of them, in that case it fixed the DM Pause event in a different case block. I did put it down to the event code being running the VM and as mentioned tried to keep things as clean and direct as possible to avoid issues.

But when I did that this week when I added the counterspell case to that case block it still had the issues as if/then/else versions (actually it brought more in as I was capturing the stealth feat activation before and that brings up the error now).

I'm away this weekend unfortunately and I will have more time next week so I will rewrite that a bit and see what happens.

I was also going try and just compile the code as it is in the toolset (if it will due to the include files I use) as that would be a very simple test.

Thank you Smile


Skywing, I use the Linux compiler quite a bit so I don't mind putting in some time to getting some of your patches in and make it more stable if you don't mind.
_________________
oops
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sat Jun 04, 2011 1:28    Post subject: Reply with quote

Paul, could you find me on irc.nwn2source.net (#nwn2cr)? We can see about merging the changes I've made into your source tree. I'd appreciate having a maintainer for a Linux build of the old nwnnsscomp shell with the many compiler updates that have been happening if you're willing.
Back to top
View user's profile Send private message
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Mon Jun 06, 2011 1:13    Post subject: Reply with quote

Sure, will do tomorrow when I come back from work UK time, what timezone are you in?

I took the code and used the toolset compiler which initially failed with this:

Code:
ERROR: SKIPPING DECLARATION VIA "case" STATEMENT DISALLOWED.


as I had a variable declaration inside the case block as mentioned, the command line version didn't mind it.

Unfortunately there were players on all night so I will have to try it tomorrow. I compiled the updated script in the command line and toolset versions so it will be easy to swap them in and out.
_________________
oops
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Mon Jun 06, 2011 6:39    Post subject: Reply with quote

Paul R wrote:
Sure, will do tomorrow when I come back from work UK time, what timezone are you in?

I took the code and used the toolset compiler which initially failed with this:

Code:
ERROR: SKIPPING DECLARATION VIA "case" STATEMENT DISALLOWED.


as I had a variable declaration inside the case block as mentioned, the command line version didn't mind it.

Unfortunately there were players on all night so I will have to try it tomorrow. I compiled the updated script in the command line and toolset versions so it will be easy to swap them in and out.


This is one of the bugs I've fixed in the Advanced Script Compiler.

I'm on Pacific time.
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 development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3 ... , 10, 11, 12  Next
Page 11 of 12

 
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