Jump to content

[solved][Creationkit] howto toggle the trading with a vendor ON and OFF again?


Recommended Posts

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 ? :classic_huh:

 

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 ? :classic_huh:

 

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! :classic_smile:

Link to comment
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 ? :classic_huh:

 

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 ? :classic_huh:

 

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! :classic_smile:

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

Link to comment
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.  :classic_smile:  on-off-on-off-on-off  as the tide goes

 

Link to comment
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.  :classic_smile:  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

Link to comment
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 :classic_smile: 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.

Link to comment
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  

:classic_sad:

It really boils down to the question how I would switch the trading OFF again?

Link to comment
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  

:classic_sad:

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

Link to comment
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. :classic_dodgy:

 

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 :classic_happy:)

Bah! Bugthesda!

Link to comment
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. :classic_dodgy:

 

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

Link to comment
  • 1 month later...

Ok, after putting that issue a few weeks aside and brooding a bit over it can can think of a few workarounds:

 

  1. [most simple] Instead of setting the conditions in the vendor faction, I could try to disable/enable the vendor chest (update: fail )
  2. [a bit more scripting] I could add/remove the NPC from the JobMerchant faction (update: success )
  3. [a bit more scripting + logic] I could try to use the interfaction relationship rank
  4. [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 :classic_smile:

Link to comment

Update:

  1. [most simple] Instead of setting the conditions in the vendor faction, I could try to disable/enable the vendor chest

Partial sucess :classic_unsure:

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

Link to comment
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 :classic_smile:

 

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

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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