Jump to content

[LE] How to properly script a custom conditional system which will be used by a quest script?


Recommended Posts

Too many scripts, its very hard to to follow you and find out what you want to reach with this. But now back to the base scripts:

 

qlBerserk_ArmorScript

  Reveal hidden contents

 

 

qlBerserk_EffectScript

  Reveal hidden contents

 

 

;Scriptname Berserk_RefAlias_Playerreplacement_Script extends ReferenceAlias
;Scriptname qlBerserk_PlayerAliasScript extends ReferenceAlias

qlBerserk_ReplacementAliasScript

  Reveal hidden contents

 

 

; Scriptname qlMEBerserkerTransformScript extends ActiveMagicEffect

; Scriptname qlMEBerserkerTransformDangerScript extends ActiveMagicEffect

; Scriptname qlMENegativeEffectsScript extends ActiveMagicEffect

qlBerserk_TransformFinishScript

  Reveal hidden contents

 

 

qlBerserk_TransformScript

  Reveal hidden contents

 

Edited by ReDragon2013
Link to comment
Share on other sites

And now the quest script, but you have it already changed. I tried my best to understand the script and functionality.

 

qlBerserk_QuestScript

  Reveal hidden contents

 

Link to comment
Share on other sites

Thanks a lot! :smile:

 

Btw i need to ask to confirm several things.

1. It seems that you merged qlBerserk_PlayerAliasScript into qlBerserk_ReplacementAliasScript. But i couldn't find the function from qlBerserk_PlayerAliasScript inside qlBerserk_ReplacementAliasScript. So, where did it go? I couldn't find any function about adding severe damage spell into the player in other scrips either.

Edit: I think i can simply add it to your new merged script. Yeah, that should work.

 

2. You merged those 3 smaller other scripts into qlBerserk_TransformFinishScript, then where should it attached to?

Previously, they were attached to 3 different magic effects, but now it's merged into a single script, and the last magic effect has different global value than the previous 2 magic effects. How to make it work?

Edit: Nvm. Just a trivial issue. I should be able to fix it now.

 

3. A question regarding this code from qlBerserk_TransformScript:

IF akTarget.IsEquipped(ArmorBerserkerCuirass) && akTarget.IsEquipped(ArmorBerserkerBoots)
    self.Dispel()
    RETURN    ; - STOP - /1    failsafe, player is not the target
ENDIF 

How do it check if the player is not the target? All i can understand is that it checks whether the target is wearing both armors and if so, then dispel the spell. I'm not sure that's what we want, if that's really the case.

 

4. A question regarding these codes from qlBerserk_QuestScript (under Loosecontrol() function):

; *** ql added
    IF player.HasMagicEffect(BerserkArmorBeastT)
;###       (BerserkArmorBeastT as SCRBerserkArmorB).RevertForm(player)

    ELSEIF player.HasMagicEffect(BerserkArmorBeastTDanger)
;###       (BerserkArmorBeastTDanger as SCRBerserkArmorB).RevertForm(player)
    ENDIF 

Note: "SCRBerserkArmorB" has been renamed into "qlBerserk_TransformScript", ie. transformation script

Why did you comment it out? Is there something wrong or have them already done by other codes?

I added these codes to make the player revert back from transformed state if he/she's losing control. Did i do something wrong in this part?

Edited by qwertypol012
Link to comment
Share on other sites

Answers:

 

1) It seems that you merged qlBerserk_PlayerAliasScript into qlBerserk_ReplacementAliasScript.

No, no .. I renamed this script back (to go along with name convention) because it is not really a PlayerAlias script.

 

2) you merged 3 smaller scripts into qlBerserk_TransformFinishScript

Cannot see any problem here, you have two properties "MEValueDefiner" and "EffectValue", which can be prefilled by CK as you need.

 

3) about qlBerserk_TransformScript I forgot an "ELSE" here, you asked: "How do it check if the player is not the target?"

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
IF (akTarget == Game.GetPlayer())
ELSE
    self.Dispel()
    RETURN    ; - STOP - /0    failsafe, player is not the target
ENDIF
;--------------------- from here down to endevent: akTarget == Game.GetPlayer()
IF akTarget.IsEquipped(ArmorBerserkerCuirass) && akTarget.IsEquipped(ArmorBerserkerBoots)
ELSE               ; forgotten last time !!!
    self.Dispel()
    RETURN    ; - STOP - /1    failsafe, player does not have equipped berserker armor
ENDIF
;---------------------

4. regarding qlBerserk_QuestScript (under Loosecontrol() function):

Note: "SCRBerserkArmorB" has been renamed into "qlBerserk_TransformScript", ie. transformation script

Why did you comment it out? Is there something wrong or have them already done by other codes?

I added these codes to make the player revert back from transformed state if he/she's losing control. Did i do something wrong in this part?

 

As I wrote at the begin of my preview posting, too many scripts and its not so easy to follow, next should be done here.

; *** ql added
IF player.HasMagicEffect(BerserkArmorBeastT)
;### (BerserkArmorBeastT as SCRBerserkArmorB).RevertForm(player)
       (BerserkArmorBeastT as qlBerserk_TransformScript).RevertForm(player)

ELSEIF player.HasMagicEffect(BerserkArmorBeastTDanger)
;### (BerserkArmorBeastTDanger as SCRBerserkArmorB).RevertForm(player)
      (BerserkArmorBeastTDanger as qlBerserk_TransformScript).RevertForm(player)
ENDIF 
Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

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