Jump to content

SKKmods

Premium Member
  • Posts

    2754
  • Joined

  • Last visited

Posts posted by SKKmods

  1. Its not passing/getting the reference that's the problem they all send and receive fine. The problem is finding something to compare the received reference to in the main script to know what the received reference actually is.


    For persistent stuff the script matches to defined ObjectReference properties fine, example:




    Received: MQTriggerEvent called by [ObjectReference < (0101B1C6)>] action by [ObjectReference < (00000014)>]
    Matched: MQTriggerEvent called by pTriggerGunnersLocation action by PlayerRef


    For the transient spawned stuff created in the quest stage fragments I cant see a way of getting the declarations to the main script, example from the GunnerBoss spawn code above:




    Received: MQTriggerEvent called by [ObjectReference < (FF00190B)>] action by [ObjectReference < (00000014)>]
    Matched: MQTriggerEvent called by ???????????????????? action by PlayerRef


    The main script has no way of knowing what FF00190B is. Manually stepping through the logs I can see it is the spawned ref for akGunnerBoss & Alias_MQGunnerBoss. So, how to elegantly post that fact to the main script for evaluation.


    The simple workaround I started with is to attach an individual calling script with hard coded flag e.g. "I am Alias_MQGunnerBoss" to each of the spawned aliases, but that is unpleasing whilst I'm tidying up the package.

  2. 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.

  3. 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.

  4. 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 ?

  5. 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 OK
    So 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 ?
  6. 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)

  7. 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
    
  8. 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".

  9. 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

  10. 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

×
×
  • Create New...