ooook... I already had the feeling of "that was TOO easy"!
First, about the resting-thing: I have seen that, and I planned to add areas without "enemies" (or introducing a "rest area") where the PC is allowed to rest. Outside of that, "no sleep" is fine.
However, I understood that there was an error in my idea: I believed that the brazier would only attack the PC while he is in range/sight. Obviously, that was stupid, because the brazier actually
never attacks the PC! The SignalEvent only "tells" the PC he has been attacked - no matter if this really happened or not!
The fact that the script would be active in the whole module is fine, too, because it will be a "contest of thieves", and the disabling of take 20 is in fact needed module-wide. But you are right - due to my error from above this is not quite the thing I wanted to achieve.
These are no excuses, I just explained why I was thinking my little script could do the job for this special purpose.
However, I understand your arguements! And after reading and (successfully) understandig MrZork's script I must admit it is WAY more elegant, especially because it does not need any brazier around.
'>
Then, unfortunately - the script also has one issue that looks important to me because of the thing I want to do:
It still allows "take 20" for "SKILL_SEARCH / SUBSKILL_FLAGTRAP"!!!!
It is fired when the PC is actually going to interact with the door/chest/whatever. At that point, however, searching will already be done (most probably by taking 20 ...)
While my script is way more crude (name it primitive, if you like
'> ), it
does deny take 20 for searches, too. But I also do understand the drawbacks! So, I will have to put some more brains into it:
nwn.wikia / The Lexicon say, that it is possible to GetCurrentAction of "ACTION_MODE_DETECT", but if I understood that right that event is only triggered if either the PC is actively using "search" OR standing around. It will not be triggered while walking "normally" or running. By thus, using that flag would deny take 20s while standing or searching, but NOT while walking/running - which, of course, is the worst thing that could happen!
IF there's a function or constant that could be checked for whenever a "search" happens, I was not able to find it.
'>
'>
May be that could be done fiddling around with GetDetectMode(), but that would require to manually calculate the failure/success for each object in sight of the PC - in the hope of overriding the default AI. It's weird that there seems to be no flag for "ACTION_SKILL_*" or something like that.
So, here's plan B!!I seems obvious to me (correct me, if I'm wrong!!), that the "thread" denying the take 20 for searching traps must be triggered already from quite some distance to the chest/door/floor that has a trap.
Suggestion:
Create a named "common" subarea (or "trigger area"; don't know if this is the correct translation of the toolset - mine is in german
'> ).
Then adding a GetMyArea(OBECT_SELF) function to the script instead of the GetLastAction() and compare the result (which should be a string) to the name of the subarea. If TRUE, the simulated attack will be triggered using MrZorks improved version of SignalEvent.
Additonally, a single attack will be signalized "onEnter" of the subarea to ensure that the heartbeat (6 seconds can be a long time in a narrow dungeon!) does not allow the PC to come close to the trap.
Less elegant, but at least the attack-warnings will only come up within these named areas - and resting should now be possible outside of them. Best of two worlds??
Btw., how big/complex can subaeras be? The toolset seems to allow pretty huge areas, but I'm unsure about what's legit!
'>
[EDIT - SUGGESTION NOT WORKING!!!!]Ok, so I'm wrong again: Apart from the fact that GetMyArea always seems to return an empty string, also GetArea and GetTag(oArea) don't do what I want - there seems to be no way to find out if the PC is inside a closed trigger area. GetTag(oArea) always tells me it's "Area001" - which is the module's area. Also adding variables to the trigger and such stuff did not help - the heartbeat script is not able to determine if the PC is inside or outside the subarea.
[/EDIT]
Sorry for bothering you again, but that search traps thing is important to me. However, I'm open to all suggestions! And I hope you can see that I really try to fiddle things out myself before posting.
TIA!
Belushi
Modifié par Belushi1965, 08 février 2014 - 02:01 .