[Help] Equipping armor by applying perk

Post » Sun Nov 18, 2012 9:00 am

Hi guys,

the topic says it all. I'm trying to find a way so that a armorpieces automatically gets equipepd when a perk gets activated. I couldn't find any entry-points helping me here (correct me if I 'm wrong), so I was wondering if there was a script somewhere?

Cheers,
xyks
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Sun Nov 18, 2012 5:58 am

No applicable Entry Points I can see ...

Best I can think of is to create a quest - with a script - that dons the relevant armor when the perk is present.

Look at - Quest:

On the following wiki-page: http://www.creationkit.com/Perk
User avatar
Mrs shelly Sugarplum
 
Posts: 3440
Joined: Thu Jun 15, 2006 2:16 am

Post » Sun Nov 18, 2012 1:49 am

you can create a perk as an ability. and in your ability magic effect, you can use a script to equip the armor OnEffectStart
User avatar
Paula Ramos
 
Posts: 3384
Joined: Sun Jul 16, 2006 5:43 am

Post » Sun Nov 18, 2012 2:25 am

Thanks a lot both of you! I'm still getting myself into Papyrus but that should be basic enough to give it a first try and now I actually even have alternatives. Thanks!
User avatar
Jonathan Montero
 
Posts: 3487
Joined: Tue Aug 14, 2007 3:22 am

Post » Sat Nov 17, 2012 11:20 pm

Alright, I think I need a little more help. I started getting into writing scripts today, so most possibly this is s a stupid mistake (most probably the whole is script is a mistake :P). I don't see it though.
This is the script i got :

Scriptname _VLR_Armor extends activemagiceffect
{Equip Armor}

Armor Property Armor1 Auto
Armor Property Armor2 Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
Function EquipItem(Form akItem, bool abPreventRemoval = true, bool abSilent = true) native

Game.GetPlayer().EquipItem(Armor1Property, true)
Game.GetPlayer().EquipItem(Armor2Property, true)

EndFunction

I can't compile it and I get the error message: no viable alternative at input '-'
I have already looked the error up at http://www.creationkit.com/Papyrus_Compiler_Errors , but I can't say now I know whats wrong exactly...
User avatar
Poetic Vice
 
Posts: 3440
Joined: Wed Oct 31, 2007 8:19 pm

Post » Sun Nov 18, 2012 1:48 am

you dont need to define the function EquipItem(), it is already native to the actor script.

also in this case you do not need to call Game.GetPlayer(). instead (and is faster) you can pull the value of the actor from akTarget (which is a variable defined in the OnEffectStart event). basically when the effect starts, the caster and the target are "stored" as variables within the event function (since this is a "cast on self" type ability, the akTarget is the active user of the effect). so you can just call those variables, as it is much faster and more efficient.

so,

akTarget.EquipItem(Armor1, true)

etc



since akTarget is of the type "Actor" it can inherit all the functions of the Actor script natively, such as EquipItem. so you dont need to define that function in your script.
User avatar
Kaley X
 
Posts: 3372
Joined: Wed Jul 05, 2006 5:46 pm

Post » Sun Nov 18, 2012 3:34 am

Thanks! I'm still looking comprehensive guide for total newbies. I can't say the CK wiki is really helpful.
Anyway I still get these errors when compiling:

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\VLR_Armor.psc(8,0): no viable alternative at input 'Function'
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\VLR_Armor.psc(9,10): no viable alternative at input '.
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Sun Nov 18, 2012 4:03 am

Scriptname _VLR_Armor extends activemagiceffect{Equip Armor}Armor Property Armor1 AutoArmor Property Armor2 AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)akTarget.EquipItem(Armor1, true)akTarget.EquipItem(Armor2, true)EndEvent

you just needed to remove your function definition, and end your event block with EndEvent
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Sun Nov 18, 2012 11:09 am

It works! Thank you so much! No way I would have done that without you. Thanks for the support, this counity truly is great.
User avatar
Jade
 
Posts: 3520
Joined: Mon Jul 10, 2006 6:42 am

Post » Sun Nov 18, 2012 4:35 am

Edit: Nevermind. Got it figured out ;)
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am


Return to V - Skyrim