Sineko Posted April 24, 2010 Share Posted April 24, 2010 ok so essentially im attempting to make a cm mod which i understand completely, but the hard part is the spell im attempting to make for my partners, it is supposed to summon a piece of "armor" and equip it to the partners, well my attempt sorta worked, the spell is to last 180 seconds and when the spell runs out unequips the armor. well the scripts saved, and ran fine inworld but didnt equip the "armor" because it ran through every option immediately. ill paste the origanal script i started with which adds 2 pieces and if someone could tell me where i went wrong or even fix it for me that would be great. 3 hours of head smashing has yielded nothing for me -.-. And to ANYONE that can help in anyway thank you in advance. SCN Ztemperal SCRIPT BEGIN ScriptEffectStart Player.AddItem Ztemperal1 1 Player.AddItem Ztemperalhorn1 1 Player.EquipItem Ztemperal1 Player.EquipItem Ztemperalhorn1 Else If (Player.GetItemCount Ztemperal1 == 1) If (Player.GetItemCount Ztemperalhorn1 == 1) Player.UnEquipItem Ztemperal1 Player.UnEquipItem Ztemperalhorn1 Player.RemoveItem Ztemperal1 1 Player.RemoveItem Ztemperalhorn1 1 EndIf END Link to comment Share on other sites More sharing options...
Vagrant0 Posted April 25, 2010 Share Posted April 25, 2010 This is not C++, You cannot have an ELSE without an IF, and Blocktypes determine the specific conditions when that part of the script will be run. You have everything within a scripteffectstart block, so naturally it will do everything as soon as the spell is applied.http://cs.elderscrolls.com/constwiki/index.php/Magic_effect_scripts To fix your script, it would probably be something likeSCN Ztemperal SCRIPT BEGIN ScriptEffectStartPlayer.AddItem Ztemperal1 1Player.AddItem Ztemperalhorn1 1Player.EquipItem Ztemperal1Player.EquipItem Ztemperalhorn1END Begin scripteffectfinishIf (Player.GetItemCount Ztemperal1 == 1)Player.UnEquipItem Ztemperal1Player.RemoveItem Ztemperal1 1endifIf (Player.GetItemCount Ztemperalhorn1 == 1)Player.UnEquipItem Ztemperalhorn1Player.RemoveItem Ztemperalhorn1 1endifENDAt casting start, it should equip the items. When duration runs out, or the spell is dispelled, it should remove the items if the items are still present. Link to comment Share on other sites More sharing options...
Sineko Posted April 26, 2010 Author Share Posted April 26, 2010 ah ok, thank you very much, heh this is out of my normal scope of scripting most ive done is make an enchanted item lol. but tyvm for the help and the link. Link to comment Share on other sites More sharing options...
Recommended Posts