Jump to content

[LE] Simple question related to "delete.self" in a script.


Recommended Posts

 

Hey Toby.
I don't really mind if an other mod will delete or overwrite it, this is just a small bonus attached to a possible "player's house" in a secret room (if he decides to use it as a player's house).
The mod's secret room offers the player the chance to gain 10 point of Health or Stamina or Magicka, or gain a Perk for the Perk tree or advance any Skill he wishes to (level up), always for a price.
I'm even thinking to add a sacrifice ritual for those players playing dark characters.
So i don't really mind for other mods overwriting it, it doesn't have a PRIMARY importance, especially since the house has Sooooo much more to offer to the player.

 

 

One option is to use ModActorValue instead of a Set/Get combination, but it works somewhat differently and adds a modifier to the base AV instead of changing the base AV directly. This results in green text in the skills screen, for example, or if used on an NPC, can break their health bar (it won't show damage until their health drops below their base health).

Link to comment
Share on other sites

 

 

Hey Toby.
I don't really mind if an other mod will delete or overwrite it, this is just a small bonus attached to a possible "player's house" in a secret room (if he decides to use it as a player's house).
The mod's secret room offers the player the chance to gain 10 point of Health or Stamina or Magicka, or gain a Perk for the Perk tree or advance any Skill he wishes to (level up), always for a price.
I'm even thinking to add a sacrifice ritual for those players playing dark characters.
So i don't really mind for other mods overwriting it, it doesn't have a PRIMARY importance, especially since the house has Sooooo much more to offer to the player.

 

 

One option is to use ModActorValue instead of a Set/Get combination, but it works somewhat differently and adds a modifier to the base AV instead of changing the base AV directly. This results in green text in the skills screen, for example, or if used on an NPC, can break their health bar (it won't show damage until their health drops below their base health).

 

Interesting suggestion...
I'm already using "ModActorValue" in another script to exchange "Dragon Souls" for "Perks".
Link to comment
Share on other sites

Similar to foamyesque script with ability of reseting like TobiasPL suggested:

 

aXMDshrinePowerUpSCRIPT

 

Scriptname aXMDshrinePowerUpSCRIPT extends ObjectReference  
{Activate a custom shrine}    ; player needs X filled Black SoulsGems to gain Y points of Health / Magicka / Stamina

; https://forums.nexusmods.com/index.php?/topic/7537261-simple-question-related-to-deleteself-in-a-script/

  Float PROPERTY fActorValueBoost = 10.0 auto    ; (Y) How much to increase the ActorValue depends on shrine? [default=10.0]

  String  PROPERTY myAV  auto        ; sets what ActorValue to work on
        ; "Health"
        ; "Magicka"
        ; "Stamina"

  Message PROPERTY myMsg auto        ; message to show, if you do not have BlackSoulgems
        ; NoBlackSoulsMessage01 for HEALTH shrine
        ; NoBlackSoulsMessage02 for MAGICKA shrine
        ; NoBlackSoulsMessage03 for STAMINA shrine

  SoulGem PROPERTY FilledBlackSouls     auto    ; Requierd item - Black Soul
  Int     PROPERTY iSacrificeCount = 10 auto    ; (X) amount of items required. [default=10]

  EffectShader PROPERTY PowerUpVisualFX auto    ; Visual FX to Play
  Sound        PROPERTY PowerUpSoundFX  auto    ; Sound FX to play when Powered up


; -- EVENTs --

EVENT OnActivate(ObjectReference akActionRef)
IF (akActionRef == Game.GetPlayer() as ObjectReference)
    TryToSolveMe(akActionRef)
ENDIF
ENDEVENT


;==============================
state Waiting
;============
EVENT OnActivate(ObjectReference akActionRef)
ENDEVENT

EVENT OnReset()
    UnRegisterForUpdateGameTime()
    gotoState("")                    ; ### STATE ### boost is ready, while cell has been reset
ENDEVENT

EVENT OnUpdateGameTime()
    gotoState("")                    ; ### STATE ###  boost is ready now for next activation, after three days ingame
ENDEVENT
;=======
endState


; -- FUNCTION --

;-------------------------------------------------
FUNCTION TryToSolveMe(ObjectReference akActionRef)
;-------------------------------------------------
IF (akActionRef.GetItemCount(FilledBlackSouls as Form) < iSacrificeCount)
    myMsg.Show()                            ; not enough soulgems
ELSE
    gotoState("Waiting")            ; ### STATE ###  protection against the player is spamming the activate button for free upgrades
    RegisterForSingleUpdateGameTime(72.0)

    (akActionRef as Actor).ModActorValue(myAV, fActorValueBoost)
    akActionRef.RemoveItem(FilledBlackSouls, iSacrificeCount)
;;    Debug.Notification("You are blessed now..")

    Game.ForceThirdPerson()
    PowerUpSoundFX.Play(akActionRef)
    PowerUpVisualFX.Play(akActionRef, 3)
ENDIF
endFUNCTION

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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