Refilling cleared aliases without restarting their quest

Post » Wed Jun 20, 2012 7:40 pm

If my quest's alias gets filled and I Clear() it, and want it to get filled again without resetting the whole quest, what do I do?
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm

Post » Wed Jun 20, 2012 5:13 am

forcerefto
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Wed Jun 20, 2012 7:53 am

Thanks but the thing is that I don't want to hand-pick who fills the thing. I want it to look for the current best actor who fits the criteria I set for the alias to get filled in the first place. It's like what would happen if I did restart the quest from scratch and the game filled the refaliases for me, only I don't want to restart the quest. (I don't want other refaliases in the same quests to get cleared/refilled at that moment, just one particular one.)

I'm sorry if I'm not being clear.
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Wed Jun 20, 2012 1:54 pm

I don't really understand what you're saying. Why would filling the alias restart your quest? I juggle alias references like mad in my mod, and I've never been given the impression that it is restarting the quest.

Now that I'm thinking about it though, perhaps you're unaware of the command to fill aliases. As Amethyst stated above, there is a script command called "ForceRefTo".
http://www.creationkit.com/ForceRefTo_-_ReferenceAlias
Function ForceRefTo(ObjectReference akNewRef) native

So you would just do:
AliasName.Clear()AliasName.ForceRefTo(New Object Reference that you want to put into the alias)

Also, you said that you do not wish to hand pick the target, but that doesn't really make much sense. If you set criteria for a reference alias, simply check for that same criteria in a script, assign the "one that fits it" to a object reference variable, and fill the alias with that variable.
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Wed Jun 20, 2012 3:14 pm

I guess he wants to dynamically exchange reference aliases, for example picking random objects of certain object types around the player (I remember this stuff from an open spell script), which you cannot(!) do with normal scripting. ForceRefTo only allows you to add aliases you know in beforehand (so thats not dynamic...)
@topic: unfortunately I think you can only do it by restarting the quest...
User avatar
Jennifer Munroe
 
Posts: 3411
Joined: Sun Aug 26, 2007 12:57 am

Post » Wed Jun 20, 2012 4:36 pm

Use the family of functions like this maybe?

www.creationkit.com/FindRandomReferenceOfType_-_Game

Listed here:

http://www.creationkit.com/Game_Script


Something like
bool goodpickobjectreference pickwhile !goodpickpick = Game.FindRandomReferenceOfType(Diamond, 0.0, 0.0, 0.0, 5.0) ;use most appropriate find function and criteriaif Pick.HasKeyword(Somekeyword) && pick.GetGoldValue > 50  ;A random selection of conditions, but you can get the idea  goodpick = trueendIfloopAliasName.ForceRefTo(New Object Reference that you want to put into the alias)



not trying to make good papyrus, but do you get the idea? Do limit the number of loops of course, in case you don't find one >.< Also random might not randomize between loops, and calling those functions might not find a new one each time, you may have to mix up the data you send to the findreference or findactor functions. I haven't experimented with these yet, but you look like you're in a good position to do so :D
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am

Post » Wed Jun 20, 2012 10:13 am

If you really want to refill the alias using the... I'm not sure what to call it, Radiant Story Quest Manager? Well, if you really want to have your alias refilled similarly to how it's filled when the quest first starts, I suggest just having two quests.

One quest will only be responsible for filling aliases. The second would be your actual quest, where you do stuff. Whenever you want to refill your alias, just reset the first quest, then use ForceRefTo() on the aliases in your second quest.
User avatar
Stryke Force
 
Posts: 3393
Joined: Fri Oct 05, 2007 6:20 am

Post » Wed Jun 20, 2012 1:35 pm

Thanks guys. MrMuh understood what I wanted exactly and SinderionsBones who brought up something that might work. To narrow it down further maybe I can do what he said but with FindClosestReferenceOfAnyTypeInList, after dynamically adding candidates to the list first. I'm not sure if that would be more efficient. Either way, thanks at least I have some angles to try.

It would be alright if random didn't pick a new one because I don't mind if the alias is refilled by its original occupant, so long as it still meets the criteria.
User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am


Return to V - Skyrim