Jump to content

[LE] How to remove gold from player's inventory from dialogue option?


Recommended Posts

At first, read the notes from this article. It's an important step when adding fragment scripts and properties. It applies to topic info fragments too.

Once you've added the script, open the properties window and add a new property. Give it the name Gold001, and for the type choose MiscObject.
After that, click the 'Auto-fill' button. The property should now be filled with the actual gold object.

Remove all previous code and paste the following line of code to the code box, either 'On Begin' or 'On End', that's up to you. Compile the script again.

Game.GetPlayer().RemoveItem(Gold001, 5, false, akSpeaker)


If you haven't done already, you should also add a condition to the topic info, so it will only show up if the player has 5 or more gold.

Link to comment
Share on other sites

What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.
as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc.

That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you.

Link to comment
Share on other sites

At first, read the notes from this article. It's an important step when adding fragment scripts and properties. It applies to topic info fragments too.

 

Once you've added the script, open the properties window and add a new property. Give it the name Gold001, and for the type choose MiscObject.

After that, click the 'Auto-fill' button. The property should now be filled with the actual gold object.

 

Remove all previous code and paste the following line of code to the code box, either 'On Begin' or 'On End', that's up to you. Compile the script again.

Game.GetPlayer().RemoveItem(Gold001, 5, false, akSpeaker)

 

If you haven't done already, you should also add a condition to the topic info, so it will only show up if the player has 5 or more gold.

attachicon.gif Unbenannt-1.jpg

Thank you so f*#@ing much! I think all I needed to do was make gold a property in the the dialogue views tab and I would've been done with this days ago! Many, many thanks

Link to comment
Share on other sites

What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.

as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc.

That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you.

Cheers, you'd think it'd be easy to get all the resources to learn from but the creation kit wiki barely ever helps (maybe I'm just a bad reader?). I have no idea how modders do what they do and make these grand mods which are so well polished. Anyways I got that problem with the donating sorted out now so yay!

Link to comment
Share on other sites

What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.

as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc.

That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you.

Cheers, you'd think it'd be easy to get all the resources to learn from but the creation kit wiki barely ever helps (maybe I'm just a bad reader?). I have no idea how modders do what they do and make these grand mods which are so well polished. Anyways I got that problem with the donating sorted out now so yay!

Link to comment
Share on other sites

 

What you're asking is one of the hardest things to get down modding. Best thing I could suggest is looking at how others did it.

as far as the actual code part other than the dialog it would be a simple player remove item and add item to the npc.

That dialog stuff is a mess to work with .. good luck. Really wish I had a simple answer for you.

Cheers, you'd think it'd be easy to get all the resources to learn from but the creation kit wiki barely ever helps (maybe I'm just a bad reader?). I have no idea how modders do what they do and make these grand mods which are so well polished. Anyways I got that problem with the donating sorted out now so yay!

 

 

The CK resource is one of those things that's a lot easier to understand once you stop needing to understand it. The tutorials are okay, but the reference pages are very much written as reminders, not to teach.

 

 

I can do most anything with the kit and make anything i want. But I can't seem to get that dialog stuff to work right ... gave up on it years ago.

 

The dialogue UI is a nightmare and a half and the claim on the Wiki that you can write nearly as quickly in it as you can type dialogue in a textbox is a flat lie, and that's before you get into the horrorshow of dealing with voiced lines. The actual logical structure of dialogue isn't too bad though, and adding fragments is more or less the same as it is on quest stages or whatnot -- frequently it is used to manipulate quest stages, even.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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