View previous topic :: View next topic |
Author |
Message |
Ravine
Joined: 26 Jul 2006 Posts: 105
|
Posted: Sat Oct 09, 2010 19:48 Post subject: |
|
|
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 |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Fri Oct 22, 2010 9:34 Post subject: |
|
|
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 |
|
|
Squatting Monk
Joined: 28 Jun 2007 Posts: 76
|
Posted: Thu Nov 04, 2010 7:08 Post subject: |
|
|
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 |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Thu Nov 04, 2010 11:43 Post subject: |
|
|
Yes, it doesn't hook NPC nodes' action scripts yet. _________________ In Soviet Russia, NWN plays you! |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Fri Dec 03, 2010 19:25 Post subject: |
|
|
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 |
|
|
Squatting Monk
Joined: 28 Jun 2007 Posts: 76
|
Posted: Sat Dec 04, 2010 7:43 Post subject: |
|
|
virusman wrote: | GetScriptReturnValue (run any conditional script with RunScript, then get the result with this function). |
Ohmigod, I will worship you forever for this. |
|
Back to top |
|
|
Paul R
Joined: 17 Apr 2009 Posts: 42
|
Posted: Wed Jun 01, 2011 21:06 Post subject: |
|
|
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 |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Wed Jun 01, 2011 22:08 Post subject: |
|
|
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 |
|
|
Paul R
Joined: 17 Apr 2009 Posts: 42
|
Posted: Thu Jun 02, 2011 3:52 Post subject: |
|
|
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 |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Thu Jun 02, 2011 8:02 Post subject: |
|
|
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 |
|
|
Ravine
Joined: 26 Jul 2006 Posts: 105
|
Posted: Fri Jun 03, 2011 15:59 Post subject: |
|
|
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 |
|
|
Paul R
Joined: 17 Apr 2009 Posts: 42
|
Posted: Fri Jun 03, 2011 19:03 Post subject: |
|
|
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
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 |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Sat Jun 04, 2011 1:28 Post subject: |
|
|
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 |
|
|
Paul R
Joined: 17 Apr 2009 Posts: 42
|
Posted: Mon Jun 06, 2011 1:13 Post subject: |
|
|
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 |
|
|
Skywing
Joined: 03 Jan 2008 Posts: 321
|
Posted: Mon Jun 06, 2011 6:39 Post subject: |
|
|
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 |
|
|
|