Jump to content

Alias doesn't fill when using "find matching reference in loaded area"


Recommended Posts

OK.

Let's give some names to the quests (or it will be difficult to understand each other.)

 

Your main controller quest: bnwMainQuest

The quest to fill aliases: bnwAliasesQuest

 

bnwMain quest can start as you wish.

bnwAliasesQuest should NOT start when the game start.

Create your aliases in bnwAliasesQuest, be sure you check "optional", then find matching ref, check in loaded area too. Then set the conditions. Start easy with the conditions to be sure you get something.

Forget this quest, you are done with it.

 

Now in bnwMainQuest, create a quest script, in case there is not yet one.

Add a couple of properties:

 

Quest Property bnwAliasesQuest Auto

ReferenceAlias[] Property bnwAliases Auto

 

Be sure to fill these properties. The quest should autofill if the name is right, the aliases almost never auto fill so you have to pick them manually.

 

Then use a script function:

 

 

Function getTheActors()
  bnwAliasesQuest.start()
  Utility.wait(0.1)
  int i = bnwAliases.length
  while i
    i -= 1
    Actor a = bnwAliases[i].getActorRef()
    if a
      Debug.Trace("Found: " + a.getDisplayName())
    endIf
  endWhile
  bnwAliasesQuest.stop()
  bnwAliasesQuest.reset()
EndFunction
 

 

Link to comment

Hi! I was testing this "find matching reference in loaded area" fill type for an alias. But I can't get it to fill in game for some reason. All other aliases get filled on game load but this one doesn't want to. Please help. Thank you in advance!

 

Hm - during game load - I think it is not a good idea to refer to a loaded area in a start game enabled quest.

 

If you want this you need a bootstrap quest that starts the real quest when you enter a cell for the first time (eg. Player Alias OnLoad).

 

Another option would be to place this quest in story manger and use a cell change trigger.

Link to comment

 

OK.

Let's give some names to the quests (or it will be difficult to understand each other.)

 

Your main controller quest: bnwMainQuest

The quest to fill aliases: bnwAliasesQuest

 

bnwMain quest can start as you wish.

bnwAliasesQuest should NOT start when the game start.

Create your aliases in bnwAliasesQuest, be sure you check "optional", then find matching ref, check in loaded area too. Then set the conditions. Start easy with the conditions to be sure you get something.

Forget this quest, you are done with it.

 

Now in bnwMainQuest, create a quest script, in case there is not yet one.

Add a couple of properties:

 

Quest Property bnwAliasesQuest Auto

ReferenceAlias[] Property bnwAliases Auto

 

Be sure to fill these properties. The quest should autofill if the name is right, the aliases almost never auto fill so you have to pick them manually.

 

Then use a script function:

Function getTheActors()
  bnwAliasesQuest.start()
  Utility.wait(0.1)
  int i = bnwAliases.length
  while i
    i -= 1
    Actor a = bnwAliases[i].getActorRef()
    if a
      Debug.Trace("Found: " + a.getDisplayName())
    endIf
  endWhile
  bnwAliasesQuest.stop()
  bnwAliasesQuest.reset()
EndFunction
 

Got it, thanks! Now what do I do with the function? Should I run it inside onupdate event?

Link to comment

That is up to you.

I have no idea on how often you wanna check the actors.

 

@zaira advise is good if you wanna re-check the actors every time you change the location.

An event OnUpdate() is OK if you wanna do it continuously (but remember that the game will suffer if you do it constantly.)

 

Link to comment

That is up to you.

I have no idea on how often you wanna check the actors.

 

@zaira advise is good if you wanna re-check the actors every time you change the location.

An event OnUpdate() is OK if you wanna do it continuously (but remember that the game will suffer if you do it constantly.)

Oh for God sake... it still doesn't work. The aliases besides player's still do not get filled.

That is up to you.

I have no idea on how often you wanna check the actors.

 

@zaira advise is good if you wanna re-check the actors every time you change the location.

An event OnUpdate() is OK if you wanna do it continuously (but remember that the game will suffer if you do it constantly.)

Got it, thank you!

Link to comment

OK.

Can you post your code?

 

(You quoted me, so probably he didn't get your "thank you")

 

Oh right, hahah

 

Here is MainQuest's attached script:

Scriptname MyScript extends Quest  

Event onUpdate()
	getTheActors()
EndEvent

Function getTheActors()
	debug.notification("getTheActors function fired")
	AliasQuest.start()
	Utility.wait(0.1)
	actor player = thePlayer.getActorRef()
	actor player2 =theNPC.getActorRef()

	debug.notification("thePlayer: " + player.getDisplayName())
	debug.notification("theNPC: " + player2.getDisplayName())

	AliasQuest.stop()
	AliasQuest.reset()
EndFunction

ReferenceAlias Property thePlayer  Auto  
ReferenceAlias Property theNPC  Auto  
Quest Property AliasQuest  Auto 

Here's the code attached to start up stage for MainQuest:

 

;BEGIN ALIAS PROPERTY thePlayer
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_thePlayer Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
registerForUpdate(10)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Quest Property thequest  Auto  
Myscript Property script Auto
Link to comment

OK.

 

Don't do this way.

 

Remove and NEVER call "RegisterForUpdate".

 

Somewhere (Usually in the "OnInit" event, but this does not really matter, add a RegisterForSINGLEUpdate(10.0)

 

And in your "OnUpdate" change it to

 

Event OnUpdate()

   getTheActors()

   RegisterForSingleUpdate(10.0)

EndEvent

 

 

And be sure you check the actors in the RefAliases, they may be empty.

Link to comment

OK.

 

Don't do this way.

 

Remove and NEVER call "RegisterForUpdate".

 

Somewhere (Usually in the "OnInit" event, but this does not really matter, add a RegisterForSINGLEUpdate(10.0)

 

And in your "OnUpdate" change it to

 

Event OnUpdate()

   getTheActors()

   RegisterForSingleUpdate(10.0)

EndEvent

 

 

And be sure you check the actors in the RefAliases, they may be empty.

Ok. Thanks! But it still doesn't work. I checked all reference aliases, everything is filled in CK. I think I'll just move on to something else... In any other case the aliases get filled without problem, for ex if I set change location event for the quest. But with this configuration it just doesn't want to work.

 

Speaking of change location event, could I ask you, do you know how could I exclude the player from being filled into the alias, and in general preventing two aliases from being filled with the same actor? Because I mean all my aliases just get filled with the player. Can I use conditions or something?

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use