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...

Leecarter

Allies
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Leecarter

  1. Sure.

    First you cast the weapon as a Form object. Pass (true) in GetEquippedWeapon() if you want the one in the left hand:

    
    form theWeapon = theTarget.GetEquippedWeapon() as Form
    
    
    Then you load up the shader (I've never used shaders, but I'm assuming they work the same)
    
    theEffect = *your scripts variable"  
    
    
    Then call play:
    
    theEffect.Play(theWeapon)
    
    

    Again, I've never worked with shaders, but this is how I would do a VisualEffect or ImpactDataSet so *maybe* they work the same.

  2. I found a way to do it by over-riding the inheritance of ObjectReference, creating properties in the new higher class, and then injecting variables from the local player script into the new top level script.

    After the variables are injected by an event on the player (I used OnHit()) they will be available everywhere in any script using Game.GetPlayer().MY_NEW_VARIABLE.

    Incorporated this into my first mod here:

    http://skyrim.nexusmods.com/downloads/file.php?id=13281

    There are 3 scripts, all beginning with "GM_".

  3. I should clarify this a little more.

    I have a quest set up that contains the variable in a script property - added a quest property to the actor's script - populated the property for the actor with the quest in the CK.

    That works fine for accessing and persisting objects for the player, but I want something truly global. So let's say I want to access an object from *any* script.

    Maybe this isn't even possible?

  4. I know there are global variables you can create in the CK, but they're limited only to 3 numeric datatypes.

    What I'm looking for is a way to make objects available globally. I've read this is possible by creating a quest that runs on start, then attach a script with the properties you want to make accessible globally. This directions I've found online to do this thus far haven't worked (or I did it wrong).

    For example, one of the things I'd like to have globally accessible is a VisualEffect property, but this could apply to perks, weapons, or whatever else you wanted to use as a property in your scripts.

    Has anyone here used this approach for creating global properties?

  5. Also, I noticed you forgot to set Guardian = "Warrior" in addSign1.

    Another possible refactor might look something like this:

    
    
    EVENT onACTIVATE(OBJECTREFERENCE obj)
    
    
       ; //check to see if the player is the activator and we havent already activated
    
       IF(doOnce && obj AS ACTOR == game.getPlayer())
    
    
          doOnce = FALSE
    
    
          IF (isValidForStone())
    
            pDoomAlreadyHaveMSG.show()
    
            utility.wait(2)              
    
            doOnce = TRUE
    
          ELSE
    
            debug.MessageBox("The Stone does not respond to your touch")
    
            utility.wait(2)                         
    
            doOnce = TRUE
    
         ENDIF
    
    
         IF (!doOnce)
    
            handleStoneTouch()   
    
            doOnce = TRUE
    
         ENDIF
    
      ENDIF
    
    
    endEVENT
    
    
    FUNCTION isValidForStone()
    
    
      IF(bMage && Guardian == "Mage")
    
            return true
    
      ELSEIF(bThief && Guardian == "Thief")
    
            return true
    
      ELSEIF(bWarrior && Guardian == "Warrior")
    
            return true
    
      ELSE
    
            return false
    
     ENDIF
    
    
    EndFunction
    
    
    
    FUNCTION handleStoneTouch()
    
    
      IF(bMage)
    
          Guardian = "Mage"
    
         Response = pDoomMageMSG.Show()
    
      ELSEIF(bThief)
    
          Guardian = "Thief"
    
         Response = pDoomThiefMSG.Show()
    
      ELSEIF(bWarrior)
    
         Guardian = "Warrior"
    
         Response = pDoomWarriorMSG.Show()
    
      ENDIF
    
    
      addSign(Response)
    
      SELF.playAnimation("playanim01")
    
      utility.wait(15) 
    
      Debug.Notification("You have taken " + Guardian)
    
    
    EndFunction
    
    
    FUNCTION addSign(int numSign)
    
       game.AddAchievement(29)
    
    
       IF (numSign == 1)
    
    	addFirstDoomAbility()
    
       ELSEIF (numSign == 2)
    
    	addSecondDoomAbility()
    
       ELSEIF (numSign == 3)
    
    	addThirdDoomAbility()
    
       ENDIF  
    
    
    ENDFUNCTION
    
    
    FUNCTION addFirstDoomAbility()
    
    
       IF(bMage)
    
          game.getPlayer().addSpell(pDoomMageAbility)
    
       ELSEIF(bThief)
    
         game.getPlayer().addSpell(pDoomThiefAbility)
    
       ELSEIF(bWarrior)
    
         game.getPlayer().addSpell(pDoomWarriorAbility)
    
       ENDIF
    
    
    EndFunction
    
    
    
    FUNCTION addSecondDoomAbility()
    
    
       IF(bMage)
    
          game.getPlayer().addSpell(pDoomMageAbility2)
    
       ELSEIF(bThief)
    
         game.getPlayer().addSpell(pDoomThiefAbility2)
    
       ELSEIF(bWarrior)
    
         game.getPlayer().addSpell(pDoomWarriorAbility2)
    
       ENDIF
    
    
    EndFunction
    
    
    
    FUNCTION addThirdDoomAbility()
    
    
       IF(bMage)
    
          game.getPlayer().addSpell(pDoomMageAbility3)
    
       ELSEIF(bThief)
    
         game.getPlayer().addSpell(pDoomThiefAbility3)
    
       ELSEIF(bWarrior)
    
         game.getPlayer().addSpell(pDoomWarriorAbility3)
    
       ENDIF
    
    
    EndFunction
    
    
    
    

  6. Also maybe structuring it like this would help make it clearer? At work and just did this in textpad real quick, but just to get the general idea:

    
    
    
    
    EVENT onACTIVATE(OBJECTREFERENCE obj)
    
    
       ; //check to see if the player is the activator and we havent already activated
    
       IF(doOnce && obj AS ACTOR == game.getPlayer())
    
    
          doOnce = FALSE
    
    
          IF (isValidForStone())
    
    	pDoomAlreadyHaveMSG.show()
    
            utility.wait(2)   	     
    
            doOnce = TRUE
    
          ELSE
    
            debug.MessageBox("The Stone does not respond to your touch")
    
            utility.wait(2)                         
    
            doOnce = TRUE
    
         ENDIF
    
    
         IF (!doOnce)
    
    	handleStoneTouch()   
    
            doOnce = TRUE
    
         ENDIF
    
    
    endEVENT
    
    
    FUNCTION isValidForStone()
    
    
      IF(bMage && Guardian == "Mage")
    
    	return true
    
      ELSEIF(bThief && Guardian == "Thief")
    
    	return true
    
      ELSEIF(bWarrior && Guardian == "Warrior")
    
    	return true
    
      ELSE
    
    	return false
    
     ENDIF
    
    
    EndFunction
    
    
    
    FUNCTION handleStoneTouch()
    
    
      IF(bMage)
    
         Response = pDoomMageMSG.Show()
    
      ELSEIF(bThief)
    
         Response = pDoomThiefMSG.Show()
    
      ELSEIF(bWarrior)
    
         Response = pDoomWarriorMSG.Show()
    
      ENDIF
    
    
      IF Response == 0
    
        addSign1()                                        
    
        SELF.playAnimation("playanim01")
    
        utility.wait(15)
    
      ELSEIF Response == 1
    
        addSign2()
    
        SELF.playAnimation("playanim01")
    
        utility.wait(15)
    
      ELSEIF Response == 2
    
       addSign3()
    
       SELF.playAnimation("playanim01")
    
       utility.wait(15) 
    
      ELSE
    
        utility.wait(2)
    
      ENDIF
    
    
    EndFunction
    
    
    

  7. Hmm, total newbie at Papyrus and just a stab here, but I would guess it has something to do with the doOnce variable.

    doOnce is initalized as true. If it enters the first wrapping IF statement but then never triggers any of the nested IFs it will stay false, so the next time it's called it never passes the first condition.

    Is it possible it got called earlier and flipped doOnce to false?

  8. Solution: echo pointed me in the right direction when he mentioned ObjectReference. Thanks.

    The way I'm understanding it, that perk scripts must extend Perk, and since Perk does not have access to OnHit() it wouldn't bind correctly (just like the error above said).

  9. I have no clue what reference perk scripts use. That could be the problem. Given that the CK is so new it's a pain finding online answers to questions like that. But then I suppose that's what we're creating here. :)

    Not sure what you mean by having no conditions for checking what is doing the hitting. My thoughts were just to get a working script that drops me a note in the log, I was going to take baby steps and add conditions to the script later. Unless I need to do that somehow to get it to work.

    The script must be getting associated to the character somehow because "error: Unable to bind script GM_fstLight to (14000D63) because their base types do not match." pops up in the log every time my character is hit. So if I start the game and get hit twice, the error appears twice. If I get hit 3 times the same error appears 3 times, and so on.

    So I've got to be close.

  10. Hello everyone, nice forums you have here. :)

    So I'm just getting my feet wet with the CK. I've made some new very basic perks and I'm trying to attach a script to one. I've got the script associated to the perk fine.

    Ultimately I want to populate a WEAPON property via the perk's script property dialog. But right now I'm just doing an extremely basic script to make sure I've got all my pieces put together right. Turns out I don't.

    The script:

    
    Scriptname GM_fstLight extends ObjectReference
    
    
    
    Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) 
    
    
    
    Debug.notification("In onHit!")
    
    
    
    EndEvent
    
    

    The log:

    error: Unable to bind script GM_fstLight to (14000D63) because their base types do not match.

    Any ideas where I went wrong? I'd really appreciate it.

    Thanks, Lee

×
×
  • Create New...