Buffing the Player with Scripts

Post » Mon Jun 18, 2012 8:03 am

I'm just starting to get into scripting after a weekend of learning the Creation Kit and could really use some help.

I have a pedistal with a Book on it and I want the player to be able to click on the book and receive a temporary buff (for example +50 Carrywieght for 24 hours)

At the moment my book says "Hello Word"

Event OnActivate(ObjectReference akActionRef)	Debug.MessageBox("Hello, World!")endEvent

A long way to go i know :smile:

Has anyone got an example scrpt I can rip apart or is there something similar in the game I can copy and deconstruct to get a better understanding?

I'm guessing I will need to use this somehow?

Game.GetPlayer().ModActorValue("CarryWeight", 50)
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm

Post » Mon Jun 18, 2012 11:11 am

Would this work as the Get Naked book?

Event OnActivate(ObjectReference akActionRef)        Game.GetPlayer().UnequipAll()endEvent
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm

Post » Mon Jun 18, 2012 11:04 am

Exactly.
User avatar
Mason Nevitt
 
Posts: 3346
Joined: Fri May 11, 2007 8:49 pm

Post » Mon Jun 18, 2012 9:36 pm

I'm in work so cant test it at the moment

So this will give the player a permanent buff of 50 CarryWeight?

Event OnActivate(ObjectReference akActionRef)		Game.GetPlayer().ModActorValue("CarryWeight", 50)endEvent

The next step is making it a temporary buff im struggling to find the code to make it temporary

http://www.creationkit.com/Actor_Value_List
User avatar
LuBiE LoU
 
Posts: 3391
Joined: Sun Jun 18, 2006 4:43 pm

Post » Mon Jun 18, 2012 2:12 pm

You could make a constant effect carry weight spell with a duration, make sure you have a spell property in the script, then change the book activation code to:
Game.GetPlayer().AddSpell(carryweightspell)
User avatar
patricia kris
 
Posts: 3348
Joined: Tue Feb 13, 2007 5:49 am

Post » Mon Jun 18, 2012 7:32 pm

Nice one! So my next question :P How to add the spell property and where to add it?

I've been searching the Wiki for this but not having much joy as the documentation is so poor at the moment.
User avatar
Theodore Walling
 
Posts: 3420
Joined: Sat Jun 02, 2007 12:48 pm

Post » Mon Jun 18, 2012 6:45 pm

I'd recommend looking up the TempleBlessingScript:
Scriptname TempleBlessingScript extends ObjectReference Conditional Spell Property TempleBlessing  Auto Event OnActivate(ObjectReference akActionRef)TempleBlessing.Cast(akActionRef, akActionRef)if akActionRef == Game.GetPlayer()  AltarRemoveMsg.Show()  BlessingMessage.Show()endifEndEventMessage Property BlessingMessage  Auto Message Property AltarRemoveMsg  Auto 

And if you look up the object "ShrineofArkay" you'll see how it works:
the script has a properties button that you can click, there you'll see the options for changing spells applied and message shown.

Hope this helps get you on the right track :)
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

Post » Mon Jun 18, 2012 1:17 pm

Awesome I think we've cracked it :)
User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

Post » Mon Jun 18, 2012 1:57 pm

Ok I've got it nailed and it all works nicely but I have a minor problem with it. The Blessing is a 24 Hour Alchemy Effect (+ 50 CarryWeight)

It show the duration in seconds which looks a bit silly. is there any way to edit the spell so it doesnt show the duration in seconds (all 86400 of them) :)

http://cloud.steampowered.com/ugc/523778879621010301/B55926AE941F5674F66FB46B18E74CEE629A604E/

[img]http://cloud.steampowered.com/ugc/523778879621010301/B55926AE941F5674F66FB46B18E74CEE629A604E/[/img]
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Mon Jun 18, 2012 7:58 pm

I'll change to to fortify carryweight by 300 for 60 secs. Much more useful for a house when you accidentally pick up the contents of an entire chest :)
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Mon Jun 18, 2012 12:51 pm

Apologies for the necro thread but my question is related and didn't want to start another.

I've made myself a new shrine buff, using an existing one as a template. But I want to do is add multiple Spell buffs.
I'm assuming this is possible and I just can't figure it out.

It currently buffs 1 Handed, but I also want it to buff 2 Handed & Health Regeneration.

I've tried just adding a TempleBlessing property, but that fails.


So any advice on that would be great. And The same querry as magicpanda about duration showing on your tool tip as several thousand seconds anyone know how to change that?

Cheers
User avatar
Alex [AK]
 
Posts: 3436
Joined: Fri Jun 15, 2007 10:01 pm

Post » Mon Jun 18, 2012 4:16 pm

Use an ability with constant effect, those don't have a duration.
To add additional effects, just add additional magic effects to the ability the script is casting (or adding to the player).
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm

Post » Mon Jun 18, 2012 7:02 pm

Ah ok cheers I'll take a look at doing that. Feel I may have to tweak down the buff if it's going to not have a duration.
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm


Return to V - Skyrim