Author Topic: [solved] Getting item and its script into OC  (Read 1005 times)

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #15 on: January 03, 2012, 06:26:42 am »


               Just to note Lightfoot is correct concerning the ExecuteScript() placement.

However, I have never really seen how the ExecuteScriptAndReturnInt() really functions in the On Hit: Unique Power spell script.  If after the script being called completes, the value X2_EXECUTE_SCRIPT_END is found to be set, then the calling script immediately completes and ends, otherwise it naturally completes and ends.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #16 on: January 03, 2012, 06:32:16 am »


               Yea, That was just a cut and paste.   commenting out the check for the TagBased scripting switch since TBS is not enabled in the OC anyway.
               
               

               
            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #17 on: January 03, 2012, 02:49:13 pm »


               

WhiZard wrote...

The order from what I've been told many times is...

Module Scripts> Hak pak > override > core scripts


This looks wrong. (Sorry, I'm too lazy to search it now ;p )
IIRC this should be

hak pak > override > module scripts > core scripts
               
               

               
            

Legacy_zamiwas

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #18 on: January 03, 2012, 05:32:21 pm »


               I'm a bit stumped.   I don't even think the "x2_s3_onhitcast" script is being reached and executed.

edit:  I noticed HotU mod has different Module Properties,  for Events.  So I'll troubleshoot there
               
               

               


                     Modifié par zamiwas, 03 janvier 2012 - 07:40 .
                     
                  


            

Legacy_Axe_Murderer

  • Full Member
  • ***
  • Posts: 199
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #19 on: January 03, 2012, 08:23:35 pm »


               It goes
highest ---> lowest priority
hak -> module -> override -> core resources

the only thing you can override using the overrides folder are core resources. If the module itself (or a hak) has the same resource in it, that version will have priority over both overrides and core resources. I believe that's what you're seeing here.

Why don't you simply edit the hotu module directly, add in your stuff, then rebuild it?
               
               

               
            

Legacy_zamiwas

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #20 on: January 03, 2012, 08:25:51 pm »


               I'm trying to.  Its getting the item's script for On-hit-cast-spell-unique-power to work that's the problem
               
               

               


                     Modifié par zamiwas, 05 janvier 2012 - 04:43 .
                     
                  


            

Legacy_zamiwas

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #21 on: January 04, 2012, 02:30:47 pm »


               Thanks guys,  the x2_s3_onhitcast  is working.
Its just that my spell isnt, in the HoTU mod only.  It's just strange.
               
               

               


                     Modifié par zamiwas, 05 janvier 2012 - 04:44 .
                     
                  


            

Legacy_zamiwas

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
[solved] Getting item and its script into OC
« Reply #22 on: January 04, 2012, 03:32:21 pm »


               Woohoo!!  Solved

Thanks everyone especially WhiZard.  

Summed up answer:   
Copy the HoTU files ("X2..") from the nwm folder into modules folder. Give a different filename AND .mod extension.

In the Toolset, open the modules' "x2_s3_onhitcast"  script.   Add a statement  'if (GetTag(oItem) == "item-tag" ', containing the weapon's on-hit script directly.  Then make an item, or put the .UTI into the override folder.   Save, and start the OC through the New > other modules.

I used Lilac Soul's script program for the on-hit script.  Also used cheat dm_spawnitem (item) to get item in game.
               
               

               


                     Modifié par zamiwas, 05 janvier 2012 - 04:46 .