Author Topic: Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen  (Read 862 times)

Legacy_BortSonofBort

  • Jr. Member
  • **
  • Posts: 87
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #15 on: August 04, 2014, 03:36:06 pm »


               

Hi All,


 


Bort here—this module’s author.


 


Firstly, I want to thank MM for taking the time to help me sift through these issues. Secondly, I want to thank everyone in the thread for offering their insights and opinions. It’s so appreciated.


 


If someone has the knowledge to be able to pinpoint what scripts I would need to delete from the module, please let me know. I’m happy to make whatever modifications are necessary to see the work MM is putting in come to fruition, I would just need help identifying the problem scripts for replacement/deletion.


 


This update/refresh to the module is 11 years in the making, so you can imagine I’m very excited to see it uploaded in top form.


 


Thank you!



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #16 on: August 04, 2014, 06:08:40 pm »


               

I have the module and looked at it with NWN Explorer.  The module created compiled scripts (.ncs) and the Toolset viewable scripts of the module (.nss) do not have a 1:1 ratio. 


 


The compiled only have the following for the creature events


x0_ch_hen_attack

x0_ch_hen_block

x0_ch_hen_damage

x0_ch_hen_distrb

x0_ch_hen_rest

 


They are thus missing these events and the script you are viewing in the Toolset for these events is not what has been compiled.


Combat round end

Conversation

Death

Heartbeat

Perception

Spawn

Spell

User Defined


 


I then opened the module and tried to compile the combat round, and immediately got a compiling error in x0_inc_henai for an undefined function ClearActions().  I noticed that the module had updated x0_inc_henai, so I went to NWNExplorer and found that this update had never compiled.  Same thing for x0_i0_henchman, and finally got to the problem in your updated nw_i0_generic (which did compile).  The updated nw_i0_generic is missing the proper includes.  The usual path to ClearActions() is from nw_i0_generic is x0_i0_anims -> x0_i0_walkway -> x0_i0_spawncond -> x0_i0_combat -> x0_i0_talent -> x0_inc_generic -> x0_i0_equip -> x0_i0_assoc.  The reason why you could update nw_i0_generic and get it to compile is that the script was changed to never call ClearActions() even though scripts that include it will call ClearActions().  To get this script working properly you will need to include x0_i0_behavior and x0_i0_anims, and recompile x0_i0_henchman, x0_inc_henai, and then finally your event scripts.


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #17 on: August 04, 2014, 07:49:01 pm »


               

Thanks, Whizard.


 


Why am I apparently able to compile the CombatRoundEnd script, though?  Open the script, press "Save and Compile," and it compiles with no issues.


 


Nor did using Build Module detect any issue.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #18 on: August 04, 2014, 07:56:19 pm »


               


Thanks, Whizard.


 


Why am I apparently able to compile the CombatRoundEnd script, though?  Open the script, press "Save and Compile," and it compiles with no issues.


 


Nor did using Build Module detect any issue.




 


Does your override folder contain nw_i0_generic, x0_i0_henchman, or x0_inc_henai?



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #19 on: August 04, 2014, 07:59:45 pm »


               

No, only some head files and soundset.2da.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #20 on: August 04, 2014, 08:10:31 pm »


               

Check with NWN Explorer to see if the script actually compiled.  There should be an .ncs file with the script name.  If one does not exist, then the issue you are having is with the Toolset compiler not reporting errors.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #21 on: August 04, 2014, 08:16:19 pm »


               

Huh.  That is weird.  So I just randomly added a letter 's' in the CombatRoundEnd script and it compiled just fine...which it should now.


 


Then I opened a module of my own, randomly picked a script, randomly added an 's'...and it threw an error.


 


Why would it detect the problem in my module but not in Bort's?



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #22 on: August 04, 2014, 08:23:17 pm »


               

As I stated above, check to see if the compiling actually happened (by NWN Explorer), or whether the Toolset is giving you a false message.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #23 on: August 04, 2014, 08:55:31 pm »


               

Sorry, yeah, it's giving me a false "things are okay" message in Bort's module (but the script doesn't actually compile).  But it's completely fine in my module.  Why would that be?



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #24 on: August 04, 2014, 09:07:05 pm »


               

When I tried compiling x0_i0_henchman it timed out without producing an error; so a resource count may be the issue.  I have counted (roughly) 2567 scripts of which only 2520 actually compiled.  Most of the scripts have trivial differences and thus could whittled down with the use of local variables as trackers.  Just the time delay of the response to expanding the script category to view the number of scripts takes a while for my computer to process.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #25 on: August 04, 2014, 10:33:18 pm »


               

So how do we fix this issue with Bort's module?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #26 on: August 04, 2014, 11:12:09 pm »


               


So how do we fix this issue with Bort's module?




i already gave my advice...


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #27 on: August 04, 2014, 11:20:21 pm »


               

Er, what does your advice have to do with the compiler not working properly for some reason *but only in Bort's module*?



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #28 on: August 04, 2014, 11:27:31 pm »


               

Just tested something -- compiler correctly throws an error for a brand new script in his module but not for events we're discussing.  Why would that be?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Cannot Seem to Trigger OnDeath/OnPerception/OnHeartbeat Script for Henchmen
« Reply #29 on: August 04, 2014, 11:34:52 pm »


               


Er, what does your advice have to do with the compiler not working properly for some reason *but only in Bort's module*?




i misunderstood


 


Anyway, the problem is clearly not in Bort's module but somewhere in your game installation. Both me and Whizard are not able to compile the script in the module, so there is something that makes the issue on your side. The include scripts in override/patch-hak was also what I thought of at first (nice example why adding scripts into override/hak/patch-hak is terrible idea), if you already checked that and they are not there, then I would try to run 1.69 critical rebuild, if not try disable override folder, if still doesn't help disable patch folder.


 


Also, aren't you using NWNTX by any chance? Try it without it, it has a imo critical issue inside with haks (which shouldn't be problem there) if you are switching modules, so maybe there is more of these issues.