Jump to content

scripted spell assistance?


Sineko

Recommended Posts

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

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 like

SCN Ztemperal SCRIPT

 

BEGIN ScriptEffectStart

Player.AddItem Ztemperal1 1

Player.AddItem Ztemperalhorn1 1

Player.EquipItem Ztemperal1

Player.EquipItem Ztemperalhorn1

END

 

Begin scripteffectfinish

If (Player.GetItemCount Ztemperal1 == 1)

Player.UnEquipItem Ztemperal1

Player.RemoveItem Ztemperal1 1

endif

If (Player.GetItemCount Ztemperalhorn1 == 1)

Player.UnEquipItem Ztemperalhorn1

Player.RemoveItem Ztemperalhorn1 1

endif

END

At 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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...