Faction Potion

Post » Tue Jun 19, 2012 7:50 pm

How would i go about making a potion that adds the player to a certain faction, for example "BanditFriendFaction"?

Im sure its an easy script or something but i havnt a clue where to start

- Hypno
User avatar
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am

Post » Tue Jun 19, 2012 4:39 pm

http://www.creationkit.com/AddToFaction_-_Actor

And use this one when the potion's effect wears off:

http://www.creationkit.com/RemoveFromFaction_-_Actor
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Tue Jun 19, 2012 10:49 pm

thanks for helping Redwood. How does this look?

Scriptname SetBanditFriendEvent OnEffectStart(Actor Target, Actor Caster)debug.MessageBox("You are now a friend to Bandits")Target.AddToFaction (BanditFriendFaction)EndEvent

I have checked the "no duration" box in the magic effect properties window, so do i need an OnEffectFinish? and what do i put next to "extends"?

- Hypno

EDIT: gave it a go and it didnt compile. what am i missing?


Starting 1 compile threads for 1 files...
Compiling "SetBanditFriend"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SetBanditFriend.psc(5,24): variable BanditFriendFaction is undefined
No output generated for SetBanditFriend, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on SetBanditFriend

EDIT2:
I figured out how to get it to compile. i added a faction property, called it "BanditFriendFaction" and selected "BanditFriendFaction" from the object drop down list

here is the latest script:

Scriptname SetBanditFriend extends ActiveMagicEffectFaction Property BanditFriendFaction  Auto  Event OnEffectStart(Actor Target, Actor Caster)debug.MessageBox("You are now a friend to Bandits")Target.AddToFaction (BanditFriendFaction)EndEvent
User avatar
cosmo valerga
 
Posts: 3477
Joined: Sat Oct 13, 2007 10:21 am

Post » Tue Jun 19, 2012 5:24 pm

The default is what you need for a magic effect...that's "ActiveMagicEffect"

You will need an OnEffectFinish event to remove the effect when the potion runs out, more like this:

scriptName SetToBanditFriendSCRIPT extends ActiveMagicEffectEvent OnEffectStart(Actor Target, Actor Caster)	debug.Notification("You are now a friend to Bandits")	Target.AddToFaction (BanditFriendFaction)EndEventEvent OnEffectFinish(Actor Target, Actor Caster)	debug.Notification("Bandit Friendship Effect wearing off.")	Utility.Wait(5.0)	Target.RemoveFromFaction (BanditFriendFaction)EndEvent

Note that I gave the player a 5 second warning before turning the faction off.
User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm

Post » Tue Jun 19, 2012 6:28 pm

Thanks again. I am planning on making it semi-perminent, no duration time. With a seperate "antidote" potion to remove it if the player chooses. Im going to test the potion with the revised code above and see if it works...

- Hypno
User avatar
gary lee
 
Posts: 3436
Joined: Tue Jul 03, 2007 7:49 pm

Post » Wed Jun 20, 2012 12:14 am

Thank you very much for all the help Redwood, its working perfectly!

- Hypno
User avatar
Lizzie
 
Posts: 3476
Joined: Sun Nov 19, 2006 5:51 am

Post » Wed Jun 20, 2012 2:16 am

An hour long duration is close enough to permanent, probably. Also, you might want to have the effect self-cancel if the player attacks any of the bandits...it voids your "Disguise"
User avatar
Blaine
 
Posts: 3456
Joined: Wed May 16, 2007 4:24 pm

Post » Tue Jun 19, 2012 7:01 pm

I don't think an hour is very permanent
User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Wed Jun 20, 2012 6:39 am

I don't think an hour is very permanent

Name one dungeon you can't walk through with a whole hour of the mobs not attacking you...heh. If it's a potion, the player would be able to brew/obtain more, right? probably sold by a sneaky Khajiit Merchant....
User avatar
Rich O'Brien
 
Posts: 3381
Joined: Thu Jun 14, 2007 3:53 am

Post » Tue Jun 19, 2012 4:57 pm

Lol, I agree its long enough for a dungeon, but I still dont think an hour is 'permanent' :P
User avatar
Zach Hunter
 
Posts: 3444
Joined: Wed Aug 08, 2007 3:26 pm


Return to V - Skyrim