Jump to content

[LE] Simple Papyrus question -- Trying to get started.


ThunderCluck

Recommended Posts

First off, I wanna apologize for another one of hundreds of new people asking for help, but I'm not sure where else to go for help. It's appreciated!

I've played around in the creation kit a little bit but I want to start getting into Papyrus. I've no prior coding knowledge, but it seems relatively simple.

 

 

Now to the point.

I want to start with something simple. Dropping a dragon priest mask to summon the dragon priest.

(mask is destroyed, but the priest would spawn wearing it)

 

I imagine we would use "OnContainerChanged - ObjectReference" to activate once the mask is dropped.

(Moved from player inventory to no inventory) Then simply connect the summoning effect.

 

If someone could walk me through how to do this, it would be a great help on learning how to connect the {commands?} to script to get something to happen.

 

 

 

Side note, would "DropObject - ObjectReference" be used to drop it without going intop the inventory if hotkeyed?

PS, whats the proper term for the actions such as "DropObject - ObjectReference"?

 

 

Thank you to anyone who took the time to read this!

Link to comment
Share on other sites

Relatively simple?

 

While I agree that this cannot be compared to a real programming language as it's rather an engine-implemented script language - it still can be annoying as hell sometimes. ^^

Especially when you come from the previous script language for Gamebryo and now feel funny about getting a compilation error at least once per new script, as you forgot to use () after a call for a native function.

Goodbye

 

Player.Additem <EditorID> <amount>

:(

 

Anyways, I think your attempt is good with "OnContainerChanged".

SurfsideNaturals gave me a very good example about using OnContainerChanged and she wrote pretty clear comments to understand what's going on there:

https://forums.nexusmods.com/index.php?/topic/8360833-is-it-possible-to-track-if-the-player-just-used-a-specific-soul-gem/page-5&do=findComment&comment=77164713

 

I hope this helps you too. :)

Link to comment
Share on other sites

OnContainerChanged is a good event to use for what you're trying to do. DropObject makes whatever actor, or reference, drop objects of the form you specify, so you would use it on the player. Here's a script that should work, and it will drop itself whenever you equip it.

 
Scriptname SummonDragonPriestMask extends ObjectReference 
 

Actor Property pPlayerRef Auto
Actor Property SummonEncDragonPriest Auto
 
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 
    If akNewContainer == none && akOldContainer == pPlayerRef ;if dropped from players inventory
        Utility.Wait(1)
        Actor Priest = Self.PlaceActorAtMe((SummonEncDragonPriest.GetBaseObject() as ActorBase)) ;spawns dragon priest 
        Priest.EquipItem(Self.GetBaseObject()) ;dragon priest equips this mask
        Self.Disable()
        Self.Delete()
        Priest = none ;clears priest so this mask can be deleted
    EndIf 
    
EndEvent 
 
Event OnEquipped(Actor akActor)
    If akActor == pPlayerRef
        pPlayerRef.UnEquipItem(self.GetBaseObject()) ;unequips self
        pPlayerRef.DropObject(self.GetBaseObject(), 1) ;drops 1 of self's form
    Endif 
EndEvent

 
Edited by dylbill
Link to comment
Share on other sites

  • Recently Browsing   0 members

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