Jump to content

Recommended Posts

Posted

Hello everyone.
I'm learning to work on this kind of quests and I need to understand how a certain thing works...
I'm working on a system parallel to the one already existing in the game, to manage adopted children and the spouse inside the fortress I created.
I have my own quest, with the Aliases for the children, MyChild1 and MyChild2.
The Reference Alias is set as Optional and Stores Text (I copied the settings from other quests that should do the same thing I want to do and flagging Stores Text I don't know what exactly it implies), and the Fill Type is set as External Alias Reference on BYOHRelationshipAdoption alias Child1 (for the reference alias MyChild1 obviously. For the other reference I put Child2).
Now, what I don't understand is how and when, in game, MyChild1 takes the value of Child1 of BYOHRelationshipAdoption.
NOT WANTING TO TOUCH ANYTHING of the basic adoption dialogues, therefore without making any changes to the quests that concern adoption, how can I make sure that, at the same time that a child is adopted, therefore that the Child1 value takes the child's ID, the value of MyChild1 also takes the same value?
I imagine that it must be done via script with a ForceRefTo somewhere, but I don't understand where and how to set this script . . . if this operation should be done via script . . .
I could also do it via a trigger in the fortress that when you enter it goes to set the value of MyChild1 and 2, but I would like these values to be set at the same time that they "enter" the BYOHRelationshipAdoption.
I specify that I need MyChild1 and 2 to check in my quest if these aliases already have a value or not, for the dialogues in my quest, therefore if Child1 and/or Child2 have already been adopted.
Thanks in advance to whoever answers.

Posted

OMG I knew how to do this, or I did it once, hehehee, I remember that, you mean this Alias A is empty and then get's filled and your Alias B Automatically gets filled too copying it, it was years ago and I forget, LOL, But I will add this, it does not need code)) or you having to touch Alias A

Hopefully some one who knows will answer, but there a solution, that matches all your needs.. and is even code free, To override the other Alias your quest needs a higher priority too, nothing crazy try + 5 or +10, not +30 or +40, keep it small.

Hope some one better than me answers, but it can be done!! have hope

  • Like 1
Posted

LOL I booted up the kit and had a look, this is untested but

  • open your Alias
  • select "External Alias Reference"
  • select the Quest from the drop down
  • on the right of this with "Alias"
  • Select an Alias in that Quest from the drop down

The Just me being Random, and I told you it had no code)) and test it with + 1 priority on your overriding quest, it should work, forget what wrote above except for do not go crazy with your overriding quest priority 

 

Edit a quick update, which ever quest has priority, the Alias will use that AI stack in that Quest Alias, if this is non-issue for you? Forget the what I wrote above) but its important, if you require your AI stack to run. Only you know the nitty gritty nuts and bolts,  all we can do is generalised 

 

  • Like 1
Posted

There is not any method by which an alias automatically gets filled when the external situation changes.   Aliases only get filled when the quest starts, or when forceRefTo/forceLocationTo is used.  In either case, you need a trigger.

In you case, you want that trigger to be when some other quest's alias gets filled.  I don't think there is any easy way to do this without making changes to that quest.

However, I'm seeing that there is a property called BYOHRelationshipAdoption.numChildrenAdopted.  This property can be monitored continuously using a scene, so that you can run a script when it's value changes.  In that script, you can inspect the Child1 and Child2 aliases and take proper action to fill your own aliases correspondingly.

For all this to work robustly, you will likely need to also research mods that expand the number of children you can adopt, so that you can handle these additional children as well.

If you are interested in this approach, I can provide more detailed instructions on how to set up the scene that detects changes in the numChildrenAdopted property.

  • Like 1
Posted
7 hours ago, PeterMartyr said:

LOL I booted up the kit and had a look, this is untested but

  • open your Alias
  • select "External Alias Reference"
  • select the Quest from the drop down
  • on the right of this with "Alias"
  • Select an Alias in that Quest from the drop down

The Just me being Random, and I told you it had no code)) and test it with + 1 priority on your overriding quest, it should work, forget what wrote above except for do not go crazy with your overriding quest priority 

 

Edit a quick update, which ever quest has priority, the Alias will use that AI stack in that Quest Alias, if this is non-issue for you? Forget the what I wrote above) but its important, if you require your AI stack to run. Only you know the nitty gritty nuts and bolts,  all we can do is generalised 

 

I tried.
The quest byohrelationshipadoption has priority 50, so I gave my quest priority 51.
I adopted 1 child and the dialogue went well, with SQV byohrelationshipadoption the Alias Child1 takes the ID of the adopted child, but with SQV MyQuest, the Alias MyChild1, set to take the value Child1 from the quest byohrelationshipadoption, remains None.
I did an additional test from the console, Stopquest MyQuest and then Startquest MyQuest, and at this point MyChild1 takes the value of Child1, so the problem is that the MyQuest is set to Star Game Enabled, and takes the values of the Aliases only at the beginning of the game, so it does not take the values that are modified later.

Posted
6 hours ago, xkkmEl said:

There is not any method by which an alias automatically gets filled when the external situation changes.   Aliases only get filled when the quest starts, or when forceRefTo/forceLocationTo is used.  In either case, you need a trigger.

In you case, you want that trigger to be when some other quest's alias gets filled.  I don't think there is any easy way to do this without making changes to that quest.

However, I'm seeing that there is a property called BYOHRelationshipAdoption.numChildrenAdopted.  This property can be monitored continuously using a scene, so that you can run a script when it's value changes.  In that script, you can inspect the Child1 and Child2 aliases and take proper action to fill your own aliases correspondingly.

For all this to work robustly, you will likely need to also research mods that expand the number of children you can adopt, so that you can handle these additional children as well.

If you are interested in this approach, I can provide more detailed instructions on how to set up the scene that detects changes in the numChildrenAdopted property.

Thanks!
I would appreciate it if you could explain how to set up this scene

Posted

You need:

  1. A new global variable (int) to store the last seen numChildrenAdopted value; start it at zero.  I'll assume it's called YourAdoptedChildCount.
  2. A quest ready to receive the scene; any quest that is running by the time you want to start counting children, or a new SEQ quest if you don't have one already.
  3. A new scene in that quest with a single phase and no actors.  You'll want to start the scene, perhaps simply by marking it "begin on quest start".
  4. Make the scene "repeat while true" without conditions.
  5. Add a condition to the phase's "end on conditions": "getVmQuestVariable BYOHRelationshipAdoption,numChildrenAdopted != global.YourAdoptedChildCount"
  6. Add a semicolon (;) in the script box for the end conditions.

Now, you need to exit the scene tab and return to it so that the script fragment file gets created.

You can now finish setting up the script.  Starting where you inserted the semicolon:

  1. Add a property to access the global variable: type GlobalVariable, name YourAdoptedChildCount; it should autofill.
  2. Add a property to access BYOHRelationshipAdoption: type quest, name BYOHRelationshipAdoption; it should autofill.
  3. In the scene's "Scene Data" tab, right click the script filename, "Edit source" and change the type of the property from quest to BYOHRelationshipAdoptionScript; save and close the file.
  4. Go back to the script fragment box and replace the semicolon with the following:
YourAdoptedChildCount.setValueInt( BYOHRelationshipAdoption.numChildrenAdopted)

; do whatever else you want to do when children are added or removed.

Report any difficulties you encounter.

Good luck.

  • Thanks 1
Posted (edited)

Hi @xkkmEl
I did everything step by step, I tested in game, but the value of the Global does not change as numChildrenAdopted increases.
My doubt is about the Quest Data tab setting... how should I set this quest? At the moment I have only entered the ID and set it to Start Game Enabled . . . (I have also already regenerated a new SEQ file for the mod)

image.png.81a97c8b55542ecac21be8d1d49d9c14.png

image.png.ce8e4872b6706624903c1a8694e54411.png

image.png.cdf488a546150c0fa1b024662a115480.png

image.png.4686292437fdaf79893babb143d2b3cd.png

image.png.3270125653fa1822f4d559cd0673e419.png

image.png.b3f638bae76f33bd564b866cdfd79bbc.png

image.thumb.png.db32404593d2f0099b1659afd6052a28.png

Edited by Tiziano74
Posted (edited)

SOLVED!
Now it works perfectly!
I found the error . . .
Reviewing the screenshots I posted, I noticed that in the script there was a space after SetValueInt(....
I removed the space and now it works like a charm!
Thank you so much @xkkmEl, you solved a big problem!

Edited by Tiziano74
  • Like 1
Posted

I am not seeing how removing a space in a script can fix anything.

Still, tout est bien qui finit bien.

Felice di essere utile.

  • Recently Browsing   0 members

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