Jump to content

Recommended Posts

Posted

Hiya everyone Im having some issues getting the following script working any help is greatly apprecieated

 

Scriptname zzz_illusionResearchScript extends activemagiceffect

Actor Property PlayerRef Auto
Int Property GreaterThanInt Auto
Int Property LessThanInt Auto

Event OnInit()
if PlayerRef.GetAV ("Illusion > GreaterThanInt and Illusion < LessThanInt")
Game.IncrementSkillBy("Illusion", 1)
debug.messagebox("You learn about illusion")
else
debug.messagebox("You fail to learn anything new")
endif
EndEvent

 

What Im trying to do is increase the players illusion skill if thier skill is between 2 numerical points

 

Thank you in advance

Posted

Change

 if PlayerRef.GetAV ("Illusion > GreaterThanInt and Illusion < LessThanInt")

to

 

 

Int IllusionValue
IllusionValue == PlayerRef.GetAV("Illusion")
If (IllusionValue > GreaterThanInt) && (IllusionValue < LessThanInt)

 

If the compiler complains about the INT thing, change all your values to FLOAT. Skill values may be stored as floats in order to display skill progress bar on the skills screen.

Posted (edited)

Also increment skill doesn't have a 2nd parameter. it just increases by 1.

Scriptname zzz_illusionResearchScript extends activemagiceffect

Int Property GreaterThanInt Auto
Int Property LessThanInt Auto

Event OnInit()
    Int i = Game.GetPlayer().GetAV("Illusion") As Int
    If i > GreaterThanInt && i < LessThanInt
        Game.IncrementSkill("Illusion")
        Debug.MessageBox("You learn about illusion")
    Else
        Debug.MessageBox("You fail to learn anything new")
    EndIf
EndEvent
Edited by sLoPpYdOtBiGhOlE
  • Recently Browsing   0 members

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