Is there a way to specify, not in whiterun as a location?

Post » Wed Jun 20, 2012 8:53 pm

I want to be able to specify that a npc can only wear certain clothes while inside a city, in this case, Whiterun. Is there a way to specify a location as NOT Whiterun? In other words, inside the city they wear this outfit, outside the gates they change to a different default outfit. Thanks.

As I have it now, the npc will change clothes when they step outside Breezehome and that works fine, I just want them to be battle ready when they go outside the gate. :)
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Thu Jun 21, 2012 3:58 am

GetInCurrentLoc != WhiterunLocation

however, someparts outside of the city are considered Whiterun location i think (like the stable and just outside the gates)

if you want to restrict it just to the city border, you may want to use GetInWorldspace instead
User avatar
sexy zara
 
Posts: 3268
Joined: Wed Nov 01, 2006 7:53 am

Post » Thu Jun 21, 2012 6:06 am

Lots of ways to do it.

The simplest is probably to have script on the Alias (or actor, if you are not using Aliases ... though you should be) that changes the NPC outfit when it enters a specific location.

http://www.creationkit.com/IsInLocation_-_ObjectReference

(Look also at the link on that page to "Location")


http://www.creationkit.com/OnLocationChange_-_Actor - might also help
User avatar
James Smart
 
Posts: 3362
Joined: Sun Nov 04, 2007 7:49 pm

Post » Thu Jun 21, 2012 7:15 am

Lots of ways to do it.

The simplest is probably to have script on the Alias (or actor, if you are not using Aliases ... though you should be) that changes the NPC outfit when it enters a specific location.

http://www.creationkit.com/IsInLocation_-_ObjectReference

(Look also at the link on that page to "Location")


http://www.creationkit.com/OnLocationChange_-_Actor - might also help

I'm already doing that. I was asking how to reference NOT Whiterun so that I don't have to test on every single location to decide what to wear. Thanks!
User avatar
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am

Post » Thu Jun 21, 2012 4:45 am

if you are using papyrus instead of the built in condition functions all you need is an exclamation point to invert the condition

If !npc.IsInLocation(Whiterun)

translates to : if the npc is not in whiterun
User avatar
Rachell Katherine
 
Posts: 3380
Joined: Wed Oct 11, 2006 5:21 pm

Post » Wed Jun 20, 2012 11:37 pm

Thanks for the suggestions.

My script works but the problem is, it doesn't switch clothes until you go through a door not in the Whiterun location. FYI, apparently the Whiterun Stables are not part of WhiterunLocation because she will switch clothes moving through that door. My simple script is...

Scriptname ActorSwitchOutfitsOutsideWhiterun extends Actor  {Forces an Actor to switch Outfits when entering and leaving a specific Location.}Weapon Property IronDagger  AutoLocation Property ChangeOutfitWhiterunLocation  Auto  {The location at which to change outfits}Outfit Property OutsideWhiterunOutfit  Auto  {Outfit to wear outside the Location}auto STATE waitingEvent OnLocationChange(Location akOldLoc, Location akNewLoc)	if (akOldLoc == ChangeOutfitWhiterunLocation)		gotoState("waiting")		Self.SetOutfit(OutsideWhiterunOutfit)		Self.AddItem(IronDagger, 1)		Self.RemoveItem(IronDagger, 1)	endifendEventendStateSTATE done; do nothingendState

Anyway to reference the actual gate(s) of Whiterun? Is OnOpen something I could use? I'm trying to look it up now. I'm not really a papyrus scripter. Now I'm looking at OnAreaTransitionCheck but I don't know how to use it and haven't found an example yet.

Now I'm looking at what Amethyst Deceiver said GetInWorldspace but I don't know how to use that either. :P
User avatar
James Rhead
 
Posts: 3474
Joined: Sat Jul 14, 2007 7:32 am

Post » Thu Jun 21, 2012 7:11 am

The other alternative that I could live with is, if she just changed clothes when the npc became my follower. Any ideas?
User avatar
Dark Mogul
 
Posts: 3438
Joined: Tue Feb 20, 2007 11:51 am

Post » Thu Jun 21, 2012 11:28 am

Did you spawn a distance away from whiterun and walk in, or just spawn at whiterun stables If I remember right, oldlocation does not update until you have been to your second place ... because it is NULL the first time you spawn?

Also, it is not instant ... did you wander around whiterun for a moment or two, or just dive in the first door?


Finally - I think the door will have an OnActivate Event, so you could use that - make the door an AliasReference in your quest and put the onactivate event on the Alias

http://www.creationkit.com/Door
User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Wed Jun 20, 2012 11:32 pm

Did you spawn a distance away from whiterun and walk in, or just spawn at whiterun stables If I remember right, oldlocation does not update until you have been to your second place ... because it is NULL the first time you spawn?

Also, it is not instant ... did you wander around whiterun for a moment or two, or just dive in the first door?


Finally - I think the door will have an OnActivate Event, so you could use that - make the door an AliasReference in your quest and put the onactivate event on the Alias

http://www.creationkit.com/Door

I went in and out of the doors a few times because I noticed the behavior you are talking about, that you have to go through the door twice.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Thu Jun 21, 2012 9:21 am

I went in and out of the doors a few times because I noticed the behavior you are talking about, that you have to go through the door twice.
I asked because I may have a related issue ... I made a seperate post about that. I'll post back in here if someone solves my issue.
User avatar
Marlo Stanfield
 
Posts: 3432
Joined: Wed May 16, 2007 11:00 pm


Return to V - Skyrim