Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Passing Float Variables to another script?


Raikel
 Share

Recommended Posts

Does anyone know how to properly transfer float variables from parent and child scripts? I had already marked the variables as a float property and they work in it's own script, but when I access the variable in a child script, the value does not show (compiling works). I thought that I didn't fill in the property on CK, but I still didn't get the value to transfer when I did.

 

Just writing up a sample to give the idea:

Scriptname ScriptA extends ActiveMagicEffect

Float Property VarA Auto
Float Property VarB Auto
Float StoredVarB
Int Casting = 0

Event OnEffectStart(Actor Target, Actor Caster)
    If Caster.GetAV("Infamy") == 0
        VarA = Caster.GetScale()
    EndIf
    Casting = 1
EndEvent

Event OnEffectFinish(Actor Target, Actor Caster)
    If Casting == 1
        StoredVarB = VarB
        VarB = 0
        Casting = 0
    EndIf
EndEvent


Scriptname ScriptB extends ScriptA

Float RoC
Float VarC
Float Casting

Event OnEffectStart(Actor Target, Actor Caster)
    RoC = (Caster.GetAV("Fame") - VarA) / 100
    If Caster.GetAV("Fame") > VarA
        Caster.ModAV("Fame", RoC)
        VarC += RoC
        Casting = 1
    EndIf
    Utility.Wait(1)
EndEvent

Event OnEffectFinish(Actor Target, Actor Caster)
    If Casting == 1
        VarB = VarC
        Casting = 0
        VarC = 0
    EndIf
EndEvent

I need values to be able to transfer back and forth, but I have not been able to make that happen despite my code compiling correctly. Tried everything and looked up everything. So I'm all out of ideas and immensely frustrated. =/

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...