Help with Weapon of Energy

View previous topic View next topic Go down

Help with Weapon of Energy

Post  Dozer on Fri Oct 19, 2012 10:36 am

Kaedrin, first off your pack looks great. From what I've read, it is well loved by the community. I myself don't use your classes, but I am interested in some of your spells, particularly the Weapon of Energy Spell. For some reason though I can't get it to work. All it does is add 1d6 physical damage to a weapon and not any elemental damage that i select.

Here's what I have done:

1. I copied over the cmi_s0_energywpn.nss & .ncs to override in my docs.

2. Coppied cmi_ginc_spells.nss & x0_i0_spells.nss to verrride folder in my docs( not sure if i needed to).

3. Copied over the Weapon_Energy, Weapon_Energy_F/A/C/E lines to my spells.2da file and made sure the SubRadSpell1-4 correspdoned with Weapon_Energy as well as made sure the F/A/C/E lines had Weapon_Energy set as thier Master.

4. dialog.tlk was updated to show the new spells.




There is only one spells.2da file, that I have in my override folder and its my own, that I add on to, depending on what modules I'm playing and/or if i decide to add something new.

I noticed that there are no .ncs to either cmi_ginc_spells.nss & x0_i0_spells.nss. Is this suppose to be correct?

Also opening up the weapon of energy script i noticed that it says to include the x2_inc_spellhook. I downloaded all your files on the vault and didn't see it.

I have about 15 other, of your spells, an they all work except for the Weapon of Energy Spell.

Perhaps if you or anyone who may know, could list the files that are needed to get the spell working, that would be great. Thanks for the content you create for the community to use/appreciate.

Dozer

Posts : 4
Join date : 2012-10-19

View user profile

Back to top Go down

Re: Help with Weapon of Energy

Post  Raygereio on Sat Oct 20, 2012 5:37 am

cmi_ginc_spells.nss & x0_i0_spells.nss.
These are so called include files. These scripts are not compiled, nor are they run on their own by the game's engine. They are included in other scripts when those scripts are compiled.

x2_inc_spellhook
This is a vanilla file that Kaedrin doesn't override.

One potential problem that I can come up with the spell's id. If you look in cmi_s0_energywpn, you'll see this piece of code:
Code:

   int nSpellId = GetSpellId();
   int DamageType;
   
   if (nSpellId == SPELL_Weapon_Energy || nSpellId == SPELL_Weapon_Energy_F)
      DamageType = DAMAGE_TYPE_FIRE;
   else
   if (nSpellId == SPELL_Weapon_Energy_A)
      DamageType = DAMAGE_TYPE_ACID;
   else
   if (nSpellId == SPELL_Weapon_Energy_C)
      DamageType = DAMAGE_TYPE_COLD;
   else
   if (nSpellId == SPELL_Weapon_Energy_E)
      DamageType = DAMAGE_TYPE_ELECTRICAL;

What this does is get the id of the spell that has been cast, compares it to certain constants set in cmi_includes and then set the damage to the apropriate type.
If the id's in your spells.2da aren't the same as those on Kaedrin's .2da, this code will fail and the damage type won't be set properly. Simply change the constants used to the values you use in your .2da file.

If you are really uncomfortable editing a script, then I suppose an alternative option is to edit your spells.2da file and match Kaedrin's entries by putting a whole lot of padding (empty entries) in.

Raygereio

Posts : 21
Join date : 2011-07-24

View user profile

Back to top Go down

Re: Help with Weapon of Energy

Post  Dozer on Sat Oct 20, 2012 3:17 pm

First off, thanks for replying to my post Ray, i appreciate it.

I took your suggestion and opened up the cmi_includes script and changed the constants to correspond to my own .2da, and still the spell wont fire of any elemental damage, only shows physical damage being added on.

Maybe I'm missing a few more scripts that need to go in my override? I didnt know about the cmi_includes until you posted about it.

I don't suppose you or anyone else would mind listing the scripts needed to make the Weapon of Energy spell to work? I can then open them up an see what they do and compare to what i have and do any modifiying on my end.

Dozer

Posts : 4
Join date : 2012-10-19

View user profile

Back to top Go down

Re: Help with Weapon of Energy

Post  Raygereio on Sun Oct 21, 2012 4:04 am

To get the obvious question out of the way: did you recompile cmi_s0_energywpn after making your edits?
To compile a script open up the toolset. File -> Open Conversation/Script. Open cmi_s0_energywpn after making your edits to cmi_includes then hit Save&Compile.

The only file needed to make energy weapon actually work ingame is cmi_s0_energywpn.ncs. That is the compiled script the game engine uses. You make this by compiling to sourcefile cmi_s0_energywpn.nss. When compiling you'll need several include files. I could list them for you, but haven't yet had my morning coffee so I'm afraid I'll miss one. Just temporarily have all sourcefiles of Kaedrin's pack in your override.

Raygereio

Posts : 21
Join date : 2011-07-24

View user profile

Back to top Go down

Re: Help with Weapon of Energy

Post  Dozer on Mon Oct 22, 2012 2:18 pm

Yeah, I compiled and saved the script.

I did as you suggested once again, by placing all source files ( im thinking all files in the scripts folder) in my override folder. Still the spell doesnt work.

I spent a good part of the day checking and checking all my files to be sure that nothing conflicted, and could not see any. I am not a scripter but have had succes in making some spells and tweaking them, in the past, so I'll try and make my own version of energy weapon and se if it will work.

Thanks for your help ray, learned some new things from the scripts you mentioned and other functions.


Dozer

Posts : 4
Join date : 2012-10-19

View user profile

Back to top Go down

Re: Help with Weapon of Energy

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum