Jump to content

[LE] Need help with Scripting for a horse summon mod


Recommended Posts

hello i am making a mod that add 2 summon horse to the game but i need some help.

I can summon the horse without a problem but i am having a issue to make a unsummon script and there is another issue where i cant summon them in solstheim and soul cairn.

 

the other problem that i have is that i tried to make a unsummon to work like that

When the horse is already summon if i tried to cast the spell to summon him again he will be unsummon/dismiss.

 

 

Scriptname 2GhostHorsesSummon extends activemagiceffect  

ObjectReference Property HorseRef Auto
WorldSpace property Tamriel Auto
Sound Property SummonFX Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if Game.GetPlayer().GetWorldSpace() == Tamriel
	HorseRef.MoveTo(akCaster)
	SummonSFX.play(akcaster)
		Dispel()
		return
		HorseRef.MoveTo(akCaster)
		SummonFX.play(akcaster)
	else
		Debug.Messagebox("You Can't summon here")
		endif
EndEvent
Link to comment
Share on other sites

Dawnguard.esm "Summon Arvak"

    [SPEL:0200C600]  DLC01SummonSoulHorse
    [MGEF:0200C601]  DLC01SummonSoulHorseEffect
    [NPC_:0200BDD0]  DLC01SoulCairnHorseSummon "Arvak"

(1) create a new GlobalVariable like "natsuSummonState" to decide summon or unsummon

or

(2) create a new quest like "natsuSummonQuest" for example, assign a script to this quest and use this quest script as storage by using a property of type int

 

your effect script could look as follow: natGhostHorsesSummonScript

 

Scriptname natGhostHorsesSummonScript extends ActiveMagicEffect 
; https://forums.nexusmods.com/index.php?/topic/8733508-need-help-with-scripting-for-a-horse-summon-mod/

  GlobalVariable PROPERTY natsuSummonState auto   ; the new created globalVar, [default = GetValue() == 0.0]

  WorldSpace PROPERTY Tamriel  auto
  Sound      PROPERTY SummonFX auto

; horses you are calling for
  Actor PROPERTY Horse1Ref auto   ; clone 1 of DLC01SoulCairnHorseSummon
  Actor PROPERTY Horse2Ref auto   ; clone 2 of DLC01SoulCairnHorseSummon

; -- EVENTs -- 

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
IF (akCaster == Game.GetPlayer())
ELSE
    self.Dispel()
   RETURN ; - STOP -  not casted by player
ENDIF
;----------------------------
IF (akCaster.GetWorldSpace() == Tamriel)
ELSE
    Debug.Messagebox("You cannot summon here")
    self.Dispel()
   RETURN ; - STOP -  player is not in tamriel world
ENDIF
;----------------------------
    IF (natsuSummonState.GetValue() == 0)
        Horse1Ref.MoveTo(akCaster)                    ; move disabled horse to player
        Horse2Ref.MoveTo(akCaster)
        SummonFX.Play(akCaster)                       ; play sound
        Horse1Ref.Enable()
        Horse2Ref.Enable()
        natsuSummonState.SetValue(1)                  ; summoned horses
    ELSE
        Horse1Ref.Disable()
        Horse2Ref.Disable()
        SummonFX.Play(akCaster)
        natsuSummonState.SetValue(0)                  ; unsummoned horses
    ENDIF
ENDEVENT

 

 

 

Do not forget to fill every property within Creatin Kit and make sure horse1Ref is different to horse2Ref! You have to create the clones by duplicating the original arvak NPC.

Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

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