Jump to content

Recycle-Bot Idea


DanTheManForth

Recommended Posts

Hello all!

 

I had an idea this morning: the wasteland is full of useless clutter that won't even sell for a dime a dozen ... why not find a way to make use of all the junk? So, I created an NPC/Companion robot, adjusted textures and meshes as necessary, generated a dialogue/quest sequence which is fully functional, recorded voice, ... now all I need to do is figure out how to create and launch an interface that takes junk from my inventory, turns 10 burned/scorched/ruined books into 1 Blank Book, takes 25 cans and turns them into 1 scrap metal, and other similarly helpful conversions. Unfortunately, scripting isn't my strong suit, so I have no idea where to go from here. Any ideas?

Link to comment
Share on other sites

Is this an NVSE mod or pure vanilla?

 

If it's NVSE, you can iterate through a form list of 'junk' and check it against your player's inventory - if you find x amount of item y, do the conversion.

 

Alternatively, a method which would not require NVSE, is to launch a message box from your dialogue topic. Set the conditions in the message box to look for various conversion recipes and have each button trigger a conversion. That's more cumbersome for the player, though.

Link to comment
Share on other sites

I have NVSE, so I suppose it would be an NVSE mod? And I understand the idea behind your suggestion, but don't really know how the script should be written or where I should put it in the dialogue. :-/ I apologize again for my ignorance ... I tend to have a thousand ideas a day, and most of them I lack the knowledge to complete.
Link to comment
Share on other sites

That's okay, we all start somewhere.

 

If you're using NVSE, to start with, you need to launch the GECK via the NVSE_loader.exe. The best way to do this is to create a shortcut (Copy NVSE_Loader.exe, then select 'paste shortcut'). Edit the shortcut properties to append the -editor flag to the launch command, thus:

 

 

 

That will let you use NVSE functions when making your mod.

 

The next thing to do is create a form list in the GECK with all the base items you want to be able to convert.

 

Then you iterate through the formlist. See this page for good examples. Get the current FormList entry as a ref variable (I think), run getitemcount on the player checking for more than one. If the player has some, you'll need to jump out of the loop to another section that processes the actual transaction...

 

And this is getting rather clumsy and I think I can figure out a better way. Let me think on it a few. As structured above you'd end up with a huge spaghetti code mess which would work but be a pain in the tail.

 

I hate Fallout Scripting. :)

Link to comment
Share on other sites

I hate this scripting language SOOOOOO much.

 

This would actually be exceedingly easy with a two-dimensional array and a forEach loop. :wallbash: But we don't have those, so let me read and think some more.

Link to comment
Share on other sites

Alternatively, a method which would not require NVSE, is to launch a message box from your dialogue topic. Set the conditions in the message box to look for various conversion recipes and have each button trigger a conversion. That's more cumbersome for the player, though.

That's the way I would do it.

 

Basically, the way you could make it work is like this:

1. When the player chooses the appropriate dialogue option, the dialogue is terminated and the player is added a token (a dummy item, whose only purpose is to run a script the moment it is added to the inventory).

2. The script will pop up a message box, allowing the player to select from the various recipes. Of course, you will need to create a new 'Message' (found under 'Miscellaneous' in the object window) and format it accordingly, adding conditions to each menu option to check if the player is carrying all the required items.

 

You should check out this in-depth tutorial. It will show you how can make the script/message you require.

Link to comment
Share on other sites

 

Basically, the way you could make it work is like this:

1. When the player chooses the appropriate dialogue option, the dialogue is terminated and the player is added a token (a dummy item, whose only purpose is to run a script the moment it is added to the inventory).

2. The script will pop up a message box, allowing the player to select from the various recipes. Of course, you will need to create a new 'Message' (found under 'Miscellaneous' in the object window) and format it accordingly, adding conditions to each menu option to check if the player is carrying all the required items.

 

You should check out this in-depth tutorial. It will show you how can make the script/message you require.

 

This is actually exactly what I had in mind! I don't suppose there is a video-version of this tutorial anywhere? I am not familiar with most of the terms used, and it makes it very confusing without being able to see what is being done ...

Link to comment
Share on other sites

Ok, so I have dug up the script for the "book chute," which does largely the things I want my bot to do ... but it has a lot of specific quest and story-related stuff added on to it that I don't want, like required quest-items to use it and that annoying anti-communist voice. It also doesn't do anything with cans, coffee-pots, metal pans, and tin plates ... which I DO want it to do. I have carved great swaths of script out because I didn't want it, simplified the now unnecessarily complicated commands, and substituted some of my mod's information. The trouble I am facing now is how to add the things I actually want, because I cannot say I understand how the script is doing what it does. Could anyone just scan my script and point out which blocks I should copy and how I should adjust them to add the option of recycling "pots, pans, plates & cans" and "all of the above." ?? Please? :ermm:

 

[EDIT] The idea is to turn a specific number of cans/pots/etc. into one srap-metal, btw.

Edited by DanTheManForth
Link to comment
Share on other sites

  • Recently Browsing   0 members

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