worik Posted April 10, 2020 Posted April 10, 2020 I am working on a faction that will trade or not trade with the player, depending on certain conditions. To test it, I created a simple xmarker and test it with the getdisabled condition in the faction->vendor tab. Test 1: I start the game with the xmarker in disabled state and the merchant is not trading ✅ I enable the marker and the merchant is trading ✅ I disabled the marker and the merchant is still trading ❌ I can't toggle it OFF again ? Test 2: I start the game with the xmarker in enabled state and the merchant is trading ✅ I disable the marker and the merchant is still trading ❌ Again, I can't toggle it OFF ? Is this condition only checked once in life-time? Is the trading mood only one way and can't be disabled again? My little scenario is just a test for a more complex one, so I am primarily interested into this ON/OFF thing and how I can use the conditions in the faction. Thank you!
RohZima Posted April 11, 2020 Posted April 11, 2020 10 hours ago, worik said: I am working on a faction that will trade or not trade with the player, depending on certain conditions. To test it, I created a simple xmarker and test it with the getdisabled condition in the faction->vendor tab. Test 1: I start the game with the xmarker in disabled state and the merchant is not trading ✅ I enable the marker and the merchant is trading ✅ I disabled the marker and the merchant is still trading ❌ I can't toggle it OFF again ? Test 2: I start the game with the xmarker in enabled state and the merchant is trading ✅ I disable the marker and the merchant is still trading ❌ Again, I can't toggle it OFF ? Is this condition only checked once in life-time? Is the trading mood only one way and can't be disabled again? My little scenario is just a test for a more complex one, so I am primarily interested into this ON/OFF thing and how I can use the conditions in the faction. Thank you! Is there a script on the X Marker object? Because if you set a variable on the script the first time you enabled the marker then I think that will persist even if you disable the reference. What I don't get is how the marker triggers the vendor to trade? Is that part of his ai package to trade at the location of the X Marker? And you are expecting that by disabling the reference he will no longer run that particular package? I've never actually set that up so I'm not speaking here from experience but from the sounds of it, the info in the save game seems to not care that you disabled the reference. I don't think thats the way to do it anyway, I think you would set a condition on the ai package then trigger that on or off via the quest script, using a boolean probably.. I'm a newbie to all this side of things though...
worik Posted April 11, 2020 Author Posted April 11, 2020 3 hours ago, RohZima said: Is there a script on the X Marker object? no, just a plain and simple xmarker. It just a test how-to-do-it. 3 hours ago, RohZima said: What I don't get is how the marker triggers the vendor to trade? Faction => vendor tab => check mark at vendor condition Condition function "getDisabled" Run on "Reference to the xmarker" Comparison "==" Value "0" It works the same way when I test for "!=" and "1" Until now, I can only toggle the trading ON, but I found no way to switch it OFF again. It would boil down to the question, how I could create such a condition that stops the merchant from trading with the PC. But then again, I don't need one-way constructions, I would need to use the toggle many times. on-off-on-off-on-off as the tide goes
RohZima Posted April 11, 2020 Posted April 11, 2020 6 minutes ago, worik said: no, just a plain and simple xmarker. It just a test how-to-do-it. Faction => vendor tab => check mark at vendor condition Condition function "getDisabled" Run on "Reference to the xmarker" Comparison "==" Value "0" It works the same way when I test for "!=" and "1" Until now, I can only toggle the trading ON, but I found no way to switch it OFF again. It would boil down to the question, how I could create such a condition that stops the merchant from trading with the PC. But then again, I don't need one-way constructions, I would need to use the toggle many times. on-off-on-off-on-off as the tide goes Yeah with a boolean in your quest script. I don't know enough but if you can set the variable in your script as a global variable, then you can use it in your conditions... i think.. Sorry I can't really help
worik Posted April 11, 2020 Author Posted April 11, 2020 28 minutes ago, RohZima said: I don't know enough but if you can set the variable in your script as a global variable, then you can use it in your conditions... i think.. Sorry I can't really help That's another idea ... will try that later today Thank you. Ideas are always welcome. The other thing with the NPCs AI package would the fall-back that I still hope I can avoid.
worik Posted April 11, 2020 Author Posted April 11, 2020 2 hours ago, RohZima said: but if you can set the variable in your script as a global variable And another test result, this time with a global variable. Result: I can switch trading ON ✅ But I can't switch it OFF again ❌ It really boils down to the question how I would switch the trading OFF again?
RohZima Posted April 11, 2020 Posted April 11, 2020 2 minutes ago, worik said: And another test result, this time with a global variable. Result: I can switch trading ON ✅ But I can't switch it OFF again ❌ It really boils down to the question how I would switch the trading OFF again? Did you do showquestvars to make certain that the variable had flipped back to false when you wanted it to? You could try reading about "States" in papyrus, that might be another way, though tbh I would think the true/false flag should work
worik Posted April 11, 2020 Author Posted April 11, 2020 14 minutes ago, RohZima said: Did you do showquestvars to make certain that the variable had flipped back to false when you wanted it to? The variable is perfect, same as the marker before. It's just that it appears this damn trading/conditon thing with the factions is only designed to be one-way from OFF to ON. Back to the drawing board. Because in consequence, I would have to dump the idea to use the faction mechanism and would probably need to recreate the trading menu in my own dialogue branch and bind that to my own conditions. (At least:: triggering the trading menu from a completely different dialogue works! I already did that ) Bah! Bugthesda!
RohZima Posted April 11, 2020 Posted April 11, 2020 1 minute ago, worik said: The variable is perfect, same as the marker before. It's just that it appears this damn trading/conditon thing with the factions is only designed to be one-way from OFF to ON. Back to the drawing board. Because in consequence I would have to dump the idea to use the faction mechanism and would probably need to recreate the trading menu in my own dialogue branch and bind that to my own conditions. Bah! Bugthesda! Yeah... There may be a reason why Bethesda quests are so simplistic...
worik Posted May 30, 2020 Author Posted May 30, 2020 Ok, after putting that issue a few weeks aside and brooding a bit over it can can think of a few workarounds: [most simple] Instead of setting the conditions in the vendor faction, I could try to disable/enable the vendor chest (update: fail ❌ ) [a bit more scripting] I could add/remove the NPC from the JobMerchant faction (update: success ✅ ) [a bit more scripting + logic] I could try to use the interfaction relationship rank [most work] I could completely create my own trading dialogues and dump that whole vendorfaction/conditions thing in the trashbin Unless somebody comes up with an even better idea, I will experiment with the first 2 this weekend and report back here
worik Posted May 30, 2020 Author Posted May 30, 2020 Update: [most simple] Instead of setting the conditions in the vendor faction, I could try to disable/enable the vendor chest Partial sucess It worked for the vendor chest, but the dialogue option was still there and offered to trade the stuff from the NPCs personal inventory. Overall, I'd call that unsucessful ❌
Heroine HoneyCrotch Posted May 30, 2020 Posted May 30, 2020 How does it work with vanilla vendors? Riverwood trader doesn't trade when in sleeping giant inn. Khajit caravan traders trade anywhere. Can't look in CK for clues,at work.
worik Posted May 30, 2020 Author Posted May 30, 2020 2 hours ago, Heroine of the Night said: Riverwood trader doesn't trade when in sleeping giant inn. Khajit caravan traders trade anywhere. That's the location thing. I can control the trading, depending on their position, when they are near their chest or in their shop. But that's not what I'm looking for. If RL permits I have my dynamic "add/remove from vendor faction" script ready and tested later today and can tell you if that works as intended Edit: my test script Scriptname WMAE_Tst_faction_addremove_script extends ObjectReference Actor Property myActor auto Faction Property myFaction auto Event OnActivate (ObjectReference akActionRef) IF myActor.IsInFaction (myFaction) debug.Notification ( "removing " + myActor.getDisplayName() + " from " + myFaction.getName() ) myActor.removeFromfaction (myFaction) Else debug.Notification ("adding " + myActor.getDisplayName() + " from " + myFaction.getName() ) myActor.AddToFaction (myFaction) EndIf EndEvent Attached to an activator for testing purposes, the actor is my testing merchant and the faction filled with the JobMerchantFaction
worik Posted May 30, 2020 Author Posted May 30, 2020 Result: ✅ It works perfectly. Lesson learned: To switch dynamically between trading/no trading - use the add/remove from JobMerchantFaction
Recommended Posts
Archived
This topic is now archived and is closed to further replies.