Basic Quest Question - OnEvent, but only in a specific cell

Post » Fri Nov 16, 2012 6:24 pm

Looking at the quest manager for the first time.

I know you can't nest events, so what is a non-save bloating way to trigger an event only when the player is in a specific named cell and performs a specific action (in this case, OnPlayerBowShot)?
User avatar
Ilona Neumann
 
Posts: 3308
Joined: Sat Aug 19, 2006 3:30 am

Post » Fri Nov 16, 2012 4:17 pm

Well, you could have a quest with an alias for the player that puts a script on them with an OnPlayerBowshot event. You could make this a ChangeLocation event started quest, with a condition on it in the SM event node making it start only in that location, and then have another quest with a condition for not being in that location that stops it. Alternatively you could have a single quest in the ChangeLocation node which stops and starts (with keywords - which allows you to send start up data) other quests as needed. Either way you need two quests, though.
User avatar
Sarah Knight
 
Posts: 3416
Joined: Mon Jun 19, 2006 5:02 am

Post » Fri Nov 16, 2012 3:30 pm

Locations... weren't what I had in mind, but I think I can make them work. Thanks.
User avatar
Jessica Thomson
 
Posts: 3337
Joined: Fri Jul 21, 2006 5:10 am

Post » Fri Nov 16, 2012 11:07 am

Okay. I don't really know what I'm doing, and IsInLocation and GetLocation aren't conditions. Am I trying to use LocAliasIsLocation?
User avatar
REVLUTIN
 
Posts: 3498
Joined: Tue Dec 26, 2006 8:44 pm

Post » Fri Nov 16, 2012 3:07 pm

If you look at Bethesda's quests they tend to use GetEventData, GetisID NewLocation, LocationName. And that works fine for vanilla locations, but I've not got it (or any other GetEventData-NewLocation condition) to work with mine - I don't know whether this is a CK bug or me somehow setting up my locations wrongly, so it would be good if others could comment.

But at any rate the ChangeLocation event fires when I enter my location, so then for example a GetWithinDistance SomeObject condition can do the job.
User avatar
Damien Mulvenna
 
Posts: 3498
Joined: Wed Jun 27, 2007 3:33 pm

Post » Fri Nov 16, 2012 1:40 pm

I'm going to try Player GetInCurrentLoc, and pray that that works. Thanks for trying!
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am

Post » Fri Nov 16, 2012 4:05 pm

Actor Property PlayerREF AutoCell Property SomeCell AutoEvent OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing)	If PlayerREF.GetParentCell() == SomeCell		; Do Something	EndIfEndEvent
Since you'll already be using a PlayerAlias, you could use states to listen only when appropriate.
Actor Property PlayerREF AutoCell Property SomeCell AutoEvent OnLocationChange(Location akOldLoc, Location akNewLoc)	If PlayerREF.GetParentCell() == SomeCell		GoToState("Listening")	Else		GoToState("")	EndIfEndEventState Listening	Event OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing)		; Do something	EndEventEndState
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Fri Nov 16, 2012 1:20 pm

I would attach that script to an autoadded quest, Justin?
User avatar
Lexy Dick
 
Posts: 3459
Joined: Mon Feb 12, 2007 12:15 pm

Post » Fri Nov 16, 2012 6:03 pm

Pretty sure I tried Player GetInCurrentLoc, and LocationHasKeyword, and other things besides - I'm not sure whether the whole conditions system is unaware of custom locations, or it's just something funny about the SM event.
User avatar
Steve Smith
 
Posts: 3540
Joined: Sat Jun 30, 2007 10:47 am

Post » Fri Nov 16, 2012 12:53 pm

I would attach that script to an autoadded quest, Justin?
Unless editing the player's base record (a ReferenceAlias is far less likely to conflict with anything) or using an or an ActiveMagicEffect script, It'd be on your Player's ReferenceAlias script which you'll need for http://www.creationkit.com/OnPlayerBowShot_-_Actor as it's only sent to the Player, just like http://www.creationkit.com/OnPlayerLoadGame_-_Actor.
User avatar
FABIAN RUIZ
 
Posts: 3495
Joined: Mon Oct 15, 2007 11:13 am

Post » Fri Nov 16, 2012 2:11 pm

PlayerAlias what?

...You know, I think I'm just going to do this in Magic Effects, take like a week off of modding, then start boning up on quests from the start for v5 of the mod.
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Fri Nov 16, 2012 2:46 pm

PlayerAlias what?

...You know, I think I'm just going to do this in Magic Effects, take like a week off of modding, then start boning up on quests from the start for v5 of the mod.
In your quest's Aliases tab, add a PlayerAlias of the "Specific Reference" type, the fill it in the window there with PlayerREF found in (any) cell. From there, you can attach a script to the Player via your alias and it'll receive the OnPlayerBowShot event while simultaneously enabling the ability to listen only when appropriate via OnLocationChange.
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Fri Nov 16, 2012 5:02 pm

If by 'autoadded' you mean a 'starts game enabled' quest, that would be fine. You'd add an alias to the player in the quest's aliases tab, click on the Add button to add a script to that alias, and then paste JustinOther's code in it. And that would be it

Edit: beaten to it, hmph. So I'll just point out that you can use UniqueActor 'Player' rather than Specific reference, any, PlayerRef. Takes a little less clicking. :)
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm

Post » Fri Nov 16, 2012 7:21 am

Yup, just copypastata/fill in the blanks. All it needs is a ScriptName. Aliases are amazing and, once you start using them, you'll never look back.
User avatar
KiiSsez jdgaf Benzler
 
Posts: 3546
Joined: Fri Mar 16, 2007 7:10 am

Post » Fri Nov 16, 2012 7:12 pm

Ah, okay. Gotcha.

Thanks! In the end, the Magic Effect solution http://skyrim.nexusmods.com/mods/17353, but this will be useful reference when I go back to coding. Which will not be for at least a day or two, I hope, 'cause I logged 90 hours on the CK in five days.
User avatar
Nick Jase Mason
 
Posts: 3432
Joined: Sun Jul 29, 2007 1:23 am


Return to V - Skyrim