rohtvak Posted March 29, 2011 Share Posted March 29, 2011 Hello I need some help with a script. I am trying to make a mod that uses up items for spells instead of magicka.For this mod you have to collect ingredients to make potions, then once you have made the potion you cast the spell on a target NPC or Creature and if you have the potion in your inventory the spell effect works but if you don't have it the effect won't work. The script does not work can anyone tell me why? :wallbash: Here is the script:----------------------------------------------------------------------------------------------------------------------------------------------------------------------ScriptName AAdeathspell Begin ScriptEffectStart if GetItemCount AAdeathpotion >= 1killMessage "HAHAHAH all of that collecting paid of in the end !!"removeitem AAdeathpotion 1elseMessageBox "You still need to make the potion."endifEnd----------------------------------------------------------------------------------------------------------------------------------------------------------------------- Even if I have the potion in my inventory it still just displays the MessageBox "You still need to make the potion." and does nothing at all to the spells target. I have made mods before and know my way around the TEScs but I am very bad at scripting. So if you can help me in any way i would be thankfull. 0_o :wacko: Link to comment Share on other sites More sharing options...
enlo Posted March 29, 2011 Share Posted March 29, 2011 since your script is attached to a item, I think you have to use player.GetItemCount Link to comment Share on other sites More sharing options...
whalecakes Posted March 29, 2011 Share Posted March 29, 2011 You're using it on a spell effect that you are casting on someone else.In spell effects, things like GetItemCount and Kill will use the spell's target by default.So, what your script is doing is checking if your target has the potion, not the player. Link to comment Share on other sites More sharing options...
fg109 Posted March 29, 2011 Share Posted March 29, 2011 Yesterday I finally figured out how to reference the caster in a spell script! (Yeah, I know I'm stupid not to have figured it out before.) scn example array_var temparray ref tempref short tempshort Begin ScriptEffectStart let temparray := GetActiveEffectCasters let tempshort := ar_size temparray - 1 let tempref := temparray[tempshort] ;rest of your code Just in case you want NPCs to be able to use the spell too. Link to comment Share on other sites More sharing options...
rohtvak Posted March 29, 2011 Author Share Posted March 29, 2011 Ahhh so I was trying to make the npc poison it'self {It's tamriel so i guess you never know ! }than you very much !!! ;D :D 8) :) :yes: :wink: :geek: :cool: :woot: :smile: :blush: :happy: :laugh: :mellow: :tongue: :teehee: :turned: :biggrin: :biggrin: Link to comment Share on other sites More sharing options...
rohtvak Posted March 30, 2011 Author Share Posted March 30, 2011 Sorry back again. How do I get the number of things the PC has killed. Such as: GetNPCsKilledByPlayer. I know that's not a real command but I want a command like that. Any thoughts? :sweat: Tis not so wide as a church door nor so deep as a well but tis enough twil do. Link to comment Share on other sites More sharing options...
fg109 Posted March 30, 2011 Share Posted March 30, 2011 creatures killed = GetPCMiscStat 5people killed = GetPCMiscStat 6 Link to comment Share on other sites More sharing options...
rohtvak Posted March 30, 2011 Author Share Posted March 30, 2011 Thanx :pinch: :geek: Link to comment Share on other sites More sharing options...
rohtvak Posted March 31, 2011 Author Share Posted March 31, 2011 Hi again. I Have two problems #1 I just managed to add 1 item to the inventory's of every single human NPC o_O and I have to do it again!??! So is there any way to make it faster than 700000000 :wallbash: :wallbash: :wallbash: Click and drags later? # 2 Is there anything wrong with this script? because it does not work in game, in fact it does a C.T.D. :wallbash: :wallbash: --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ScriptName AAresurrectspell Begin ScriptEffectStartif Player.GetItemCount AAbloodhuman >= 1.00 && Player.GetItemCount SacredLotusSeeds >= 1.00ResurrectPlayer.Removeitem AAbloodhuman 1Player.RemoveItem SacredLotusSeeds 1Message "It's ALIVE !!!!!!!!!!!!!!!"elseif Player.GetItemCount AAbloodhuman == 0.00 && Player.GetItemCount SacredLotusSeeds >= 1.00MessageBox "You still need to collect the human blood"elseif Player.GetItemCount SacredLotusSeeds == 0.00 && Player.GetItemCount AAbloodhuman >= 1.00MessageBox "You still need to collect the Sacred Lotus Seeds"elseif Player.GetItemCount AAbloodhuman == 0.00 && Player.GetItemCount SacredLotusSeeds == 0.00MessageBox "You still need to collect both the Human Blood and the Sacred Lotus Seeds"elseendifEnd-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Thanxx for your help already ! Link to comment Share on other sites More sharing options...
fg109 Posted March 31, 2011 Share Posted March 31, 2011 About #2... http://cs.elderscrolls.com/constwiki/index.php/Talk:Resurrect Discussion there says that you need to use "Resurrect 1" in scripts or else it will crash the game. Link to comment Share on other sites More sharing options...
Recommended Posts