Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Questbuilding help


Khettienna
 Share

Recommended Posts

Okay, I've been punching at this for three days, it's time to ask for help.

I have a very simple quest. No stages. Here is the current quest script:


ScriptName KhHMStableAnvilQuestScript

short Setup
short Stabled
short DropOffDate
short DayCount
short WeekCount
short Bill
short BillStage
short PayUpTime
short CantPay
short Paid
short Choosing
short Choice
short SayFlag
ref StableHand
ref StabledHorse
float fQuestDelayTime

Begin GameMode

If Setup == 0
Player.AddTopic KhHMStableAnvilIn
Set StableHand to ErnestRef
Set Setup to 1
EndIf

If Stabled == 0 && fQuestDelayTime < 5
Set fQuestDelayTime to 5
EndIf

If Stabled == 1
Set DropOffDate to GameDaysPassed
Set StabledHorse to GetPlayersLastRiddenHorse
ClearPlayersLastRiddenHorse
StabledHorse.AddScriptPackage KhHMHorseStabledAnvilPack
StabledHorse.SetOwnership Ernest
EndIf

If PayUpTime == 1
MessageBox "Pay Up Time, heard!"
EndIf

End

It has a lot more to it, as you can probably guess by the variable list; but I've stripped it down to this for troubleshooting purposes. That MessageBox is also just for troubleshooting, because that's where the quest poops out.

Anyway, here's what's going on. The topic that gets added works fine... I ask my NPC if I can stable my horse, and I can choose Yes or No, and both of those work fine, too. The "Yes" choice sets the variable Stabled to 1 in the dialog results script, and the code under that condition runs as expected. That "Yes" topic adds another topic "I'm ready to pick up my horse", and that shows as expected. The results script of that dialog then sets PayUpTime to 1. Then nothing happens.

However! I know PayUpTime is getting set to 1, because I tested for that with the console. I know the results script is running because I added a message to it. And I know there is nothing wrong with the last part of the script. And just in case I was just blind, I used the console to set PayUpTime to 1 myself without the dialog, and the MessageBox appeared like I expected.

So, how come when I set PayUpTime to 1 in the dialog results script, nothing happens? Where am I going wrong?

I also tried, just for troubleshooting, adding a quest stage, and using the stage for the condition in the quest script, and setting the stage in the dialog results. Similar to what I've explained, the stage got set properly, but the code depending on it as a condition never ran. I have removed that part, of course, since it was just for testing.

Please help, if you can, or at least join me in this hour of head-scratching and desk-banging. This isn't my first questbuilding experience, but it's starting to feel like it is. :ouch:

Link to comment
Share on other sites

It all works fine until PayUpTime gets set to 1 from the dialog results, then nothing happens after that.

Setting PayUpTime to 1 in the console, however, makes the MessageBox appear. :shrug:

Edit: Sorry, button-happy, there. Aye, Ernest is a base object, not a reference. I haven't tried setting Setup back to 0 and then trying, no, but I'm willing to try anything at this point. :lmao:

Edited by Khettienna
Link to comment
Share on other sites

TBH, I am not sure. I think even stuff in gamemode might run during barter for example. I am pretty sure it does.

What it does is that you are in no menu, even inventory, dialogue etc.

edit: If that won't help I am out of ideas. I usually revert back to "schattens radical bug hunting."

If PayUpTime == 1

MessageBox "Pay Up Time, heard!"

EndIf

Does this work multiple times alone in the script? If yes

Add:

If Stabled == 1

Set DropOffDate to GameDaysPassed

Set StabledHorse to GetPlayersLastRiddenHorse

ClearPlayersLastRiddenHorse

StabledHorse.AddScriptPackage KhHMHorseStabledAnvilPack

StabledHorse.SetOwnership Ernest

EndIf

Does now both work multiple times? (test with console)

If no check what part does not. If yes add more.

And so on.

Link to comment
Share on other sites

Why don't you make paying through dialogue?

"I'm ready to pick up my horse" ---> Response: Sure, I'll prepare it for you, but you need to pay the expenses. or Whatever you have.

  • Do it.[Pay xy gold] --> Response: Right away or You don't have enough money
  • Actually, leave it for now. --> Ok, it will stay in stable.

Link to comment
Share on other sites

Problem solved! My shiny new OBSE function was eating my script. :rolleyes:

For the record, I can't make the payment through dialog, because there's math that has to happen first, and it uses a few conditions, and it would just get ugly trying to feed all that into a results script or into topic conditions. :dizzy:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...