-
Posts
2754 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by SKKmods
-
-
I am trying to centralise quest alias-trigger-stage event logic from individual alias/stage scripts into a main script for many and varied reasons.
Attaching a standard trigger script to all aliases works great for pre-filled forced references, passing the various events (OnTriggerEnter, OnDeath, OnPlayerDialogueTarget, onActivate ... blah blah) events to the main script:
Quest alias: pMQScript.MQTriggerEvent(Self.GetReference(), akActionRef)
Main script: Function MQTriggerEvent(ObjectReference akCaller, ObjectReference akAction)
Which matches and validates against public properties for action. Fine.
The problem is for unfilled quest aliases that are runtime generated either in the stage (PlaceActorAtMe + ForceRefTo) or using the {Create Ref to Object Alias} function. The Main Quest script cant match their Self.GetReference() to anything public for action.
So, is it possible to expose example below variables akGunnerBoss or Alias_MQGunnerboss that are generated in a quest stage fragment to the main script for matching when it receives their Self.GetReference() triggers ?
Actor akGunnerBoss = pMQTriggerLocation.PlaceActorAtMe(pLvlGunnerBoss, iLevelMod)
Alias_MQGunnerBoss.ForceRefTo(akGunnerBoss as ObjectReference)
I have had a read around public properties and conditional scripts, but they elude my comprehension.
-
No panic playerref is for production, getplayer when debugging to reduce references.
-
Using .ForceRefTo() on ObjectReferences fine, but whats the approach to forcing unique actors and NPCs into a quest alias ?
Alias_MQPlayerRef.ForceRefTo(Game.GetPlayer()) ... or any Actor reference gives: type mismatch on parameter 1 - cannot pass a actorbase to a objectreference
-
yeah, I seem to have have more error handling and workaround code than stuff doing actual work. will give the forcefill a go as well.
-
Still no idea why I am seeing this but the workaround is:
Main quest script does validation and if the quest should start it calls setstage(0) which tests some of the quest reference aliases.
If stage 0 finds aliases are empty, it calls a quest reset function which includes Reset() Stop() .. stopping ... Start() .. starting ... to do it all over. This seems to fix any issues and bump start the quest aliases to fill.
PS I may also have a go at ForceRefTo fill the aliases in code suggestion.
-
Unfortunately I am not ever seeing OnQuestInit fire in the error condition. Its quite odd:
Load a clean (never modded) savegame pre V111 exit (MQ102 stage 9) with the quest mod enabled and everything works great. I see Event OnInit() ... Event OnQuestInit() ... Event OnPlayerLoadGame() ... Stage(0) fragment which is set to run on start fires ... and all the quest aliases fill nicely.
Load any clean or dirty savegame post V111 exit (MQ102 stage >=15) with the quest mod enabled and I only ever see Event OnInit(), nothing else. That calls OnLocationChange which forces the quest to start and some stages to fire, but .... the quest aliases are never ever filled. All aliases are set to optional and allow disabled to avoid blocking. What the hell !
If I console SetQuestAliases it all comes to life and runs fine. Is there a similar function in Papyrus I can use to over-ride whatever is going on ?
-
I have a quest set StartGameEnabled YES & RunOnce YES that fails to fill its Aliases when staged through its main script OnInit():
Path 1 Main Script OnInit() validates conditions OK and calls .SetStage(10)FAIL: Quest starts but no reference aliases are filled.Path 2 QuestPlayerRefAlias OnPlayerLoadGame() validates conditions and calls the same code to .SetStage(10)SUCCESS: Quest starts and all reference aliases filled OKSo staging the quest through OnInit() it starts with zero aliases (Forced or Unique) filled, but OnPlayerLoadGame() works fine.Is this unusual or a known issue, and if so is there a workaround to get a new installed quest running as soon as the game is launched ? -
Good for a cerial killer.
/ill get my coat then.
-
Its not bad advice, rather helpful pointers that I appreciate to keep pushing the CK functions until they work for me :)
I am constantly baffled by the lack of explicit clarity in the CK documentation as to what functions or methods can be called by/on what resources.
-
Right that is the function I needed, but implemented differently. For a target triggered solution which works with standard trader menu options from named (e.g. Trudi) and unnamed NPCs (e.g Egg Rock Pond trader). Attach a script to the NPC trader Quest Alias:
Event OnPlayerDialogueTarget() Debug.Trace (Self + " OnPlayerDialogueTarget") MQScript.QuestStageTrader("MQActorTrudi") ; call a main quest script function with a flag EndEvent
Or, player triggered (this only works for scripted quest dialogue, not standard packages) attach a script to the PlayerRef Quest Alias:
Event OnSpeechChallengeAvailable(ObjectReference akSpeaker) Debug.Trace (Self + " OnSpeechChallengeAvailable " + akSpeaker) MQScript.QuestDialogue(akSpeaker) ; call a main quest script function with the speaker EndEvent
The return [ObjectReference < (00106A00)>] could lookup, but simply flags dialogue conflict from another quest (in this case OrderUp at Drumlin when trying to trigger Trudi's barter menu)
-
Seconded render window CTRL+T and ALT+T don't do anything for me either.
-
With the basic mechanics running, optimisations to follow including replacing Game.GetPlayer() and such. Right now most of my time is spent working around rubbish documentation by looking at debug output. A lot of debug output.
-
For completeness I now have a stack of these running L_TRIGGER activators for multiple marked objectives in a single stage. Really do appreciate the help.
Auto State Wating Event OnTriggerEnter(ObjectReference akActionRef) Debug.Trace( Self + " firing on " + akActionRef ) If ( akActionRef == Game.GetPlayer()) && pSKK_MQ.IsRunning() GotoState("Finished") Disable() Float fCount = pSKK_MQCounterHostile.GetValue() fCount += 1 pSKK_MQCounterHostile.SetValue(fCount) Debug.Notification( "You have cleared " + ( fCount as Int) + " of the hostile locations." ) Debug.Trace( Self + " set SKK_MQCounterHostile to " + fCount ) EndIf If ( pSKK_MQ.GetStage() == 40 ) && ( pSKK_MQCounterHostile.GetValue() >= 6 ) pSKK_MQ.SetStage(50) EndIf EndEvent EndState State Finished ;void EndState
-
Good ideas but not for this:
RegisterForMenuOpenCloseEvent doesnt have any target info, just the event and trying to correlate to an actor via say location is hard work and unpredictable (esp with targets that move,or Trudi and Carla both in Drumlin or whatever).
RegisterForRemoteEvent wont take an actor or actor alias ... "is not a known script type and therefore cannot be the source of the onmenuopencloseevent event".
-
I am looking to trigger a quest objective complete or quest stage change on talking to a unique caravan trader NPC with their default vendor dialog.
Example: Find and talk to Carla - triggers a new quest stage.
Finding her as a quest objective target is automatic, but I cant get an event to trigger/catch a dialog event:
Event OnPlayerDialogueTarget()
Game.GetPlayer().GetDialogueTarget()
akSpeaker.IsInDialogueWithPlayer()
If there is a blindingly obvious tutorial, please point me at it. /frustrated
-
Nice, that will save constant if statement processing.
-
Trigger Volume - fantastic, haven't used them yet so will try out. Appreciated.
& Later: Trigger volumes do the job great (memo: common activator, individual scripts, set primitive collision layer L_TRIGGER).
Cant figure out how to disable a trigger after it has fired, so use a silent objective get/set per location as a unique flag placeholder.
-
I have a quest that involves visiting a bunch of unmarked wilderness locations, defined with Xmarkerrefs. The Target Ref quest map markers show on the map through the Alias Refs fine.
The problem is defining the objective/stage completion when the player gets to them. No killing or picking up stuff, just "visit the location" and enjoy the view. None of the location based condition functions or code methods wants to work on an Alias or Objref.
Is there an easy way to establish a "player has visited location" quest objective completion, or should I not be using Xmarkerrefs ?
IsCleared() - type mismatch
.IsSameLocation - type mismatch
.IsInSameCurrentLocAsRef - no viable input
I have poked around the MQ/BOS quests and still cant figure it out. /brain-hurty
-
hey, is there an FO4 CK method or function to dynamically enumerate all the placed/built objectrefs in a workshop build area during runtime ?
The console command prid.scrapall must do something like this.
Passing spawned Quest Ref variables to a main quest script
in Creation Kit and Modders
Posted · Edited by SKK50