Jump to content

Removing/unlearning crafting recipes/plans


KyoParadox

Recommended Posts

Hi, I've been trying to make a script to remove or unlearn a crafting recipe but I cannot get it to work. From my limited knowledge they are just like any other item, yet at the same time they aren't.

 

Anyways, here's the code. I've add a few lines so I knew the script itself ran without problems. I can add a crafting recipe with

UT_AddItemToInventory but I cannot remove them with UT_RemoveItemFromInventory (I tried both 1 and -1 as the amount to remove).

#include "utility_h"

void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);

// We will watch for every event type and if the one we need
// appears we will handle it as a special case. We will ignore the rest
// of the events
switch ( nEventType )
{
	// This event happenes every time the module loads
	// This usually happenes when creating a new game
	// or loading a savegame
	case EVENT_TYPE_MODULE_LOAD:
	{			 

		UT_RemoveItemFromInventory(R"gen_im_wep_rng_lbw_wlf.uti", 1);
		UT_RemoveItemFromInventory(R"gen_im_cft_psn_102.uti", -1);	 

		UT_AddItemToInventory(R"gen_im_wep_rng_lbw_eye.uti", 1);  
		UT_AddItemToInventory(R"gen_im_cft_psn_205.uti", 1);
		// We have dealt with the event we were waiting for.
		// At this point we can stop looking for other events
		break;
	}
	default:
		break;
}
}

So my question is, I guess, how to remove a crafting recipe once it is learned? There must be a way to do it. :(

 

-kyoma

Link to comment
Share on other sites

  • Recently Browsing   0 members

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