Jump to content

KyoParadox

Premium Member
  • Posts

    5
  • Joined

  • Last visited

Nexus Mods Profile

About KyoParadox

Profile Fields

  • Country
    None

Recent Profile Visitors

16543 profile views

KyoParadox's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. No they both return an int value, in fact, using a float only results in an error at compiling due to mismatched types.
  2. As the title says, I'm having some difficulties with GetStoreMarkUp/Down. For some reason they always return -1. I tried calling it during dialogue, during the store GUI and right after calling SetStoreMarkUp/Down (which does work). Here's the script, as you can see I'm calling GetStoreMarkUp/Down in several places in case it only works during a certain point. Not that it matters. :( void main() { //Storage_HandleModuleEvents(); event ev = GetCurrentEvent(); int nEventType = GetEventType(ev); switch(nEventType) { case EVENT_TYPE_MODULE_LOAD: { //PrintToLog("STORE_INVESTMENT - STARTED"); break; } case EVENT_TYPE_GUI_OPENED: { int nGUI = GetEventInteger(ev, 0); // ID number of the GUI that was opened if(nGUI == GUI_STORE) { object oStoreX = GetObjectByTag(GetLocalString(GetModule(), "STORE_INVEST_MERCHANT")); int nStoreBuyX = GetStoreMarkDown(oStoreX); int nStoreSellX = GetStoreMarkUp(oStoreX); PrintToLog("STORE_INVESTMENT - Merchant Values (STORE GUI): " + IntToString(nStoreBuyX) + " vs " + IntToString(nStoreSellX)); } break; } case EVENT_TYPE_CREATURE_ENTERS_DIALOGUE: { object oCreature = GetEventCreator(ev); // object oStoreX = GetObjectByTag("store_" + GetTag(oCreature)); object oStoreXOld = GetObjectByTag(GetLocalString(GetModule(), "STORE_INVEST_MERCHANT")); if(IsObjectValid(oStoreX)) { PrintToLog("STORE_INVESTMENT - Merchant Opened: " + GetTag(oStoreX) + ". Last Merchant: " + GetTag(oStoreXOld)); int nStoreBuyX = GetStoreMarkDown(oStoreX); int nStoreSellX = GetStoreMarkUp(oStoreX); PrintToLog("STORE_INVESTMENT - Merchant Values (DIALOGUE): " + IntToString(nStoreBuyX) + " vs " + IntToString(nStoreSellX)); if(oStoreX != oStoreXOld) { SetLocalString(GetModule(), "STORE_INVEST_MERCHANT", GetTag(oStoreX)); SetLocalInt(GetModule(), "STORE_INVEST_BUY_MAX", nStoreBuyX); SetLocalInt(GetModule(), "STORE_INVEST_SELL_MIN", nStoreSellX); SetStoreMarkDown(oStoreX, 100); SetStoreMarkUp(oStoreX, 100); int nStoreBuyX = GetStoreMarkDown(oStoreX); int nStoreSellX = GetStoreMarkUp(oStoreX); PrintToLog("STORE_INVESTMENT - Merchant Values (STATIC): " + IntToString(nStoreBuyX) + " vs " + IntToString(nStoreSellX)); } } break; } case EVENT_TYPE_GAMEMODE_CHANGE: { if (GetEventInteger(ev,0) == GM_EXPLORE && GetEventInteger(ev,1) == GM_GUI) { object oStoreX = GetObjectByTag(GetLocalString(GetModule(), "STORE_INVEST_MERCHANT")); if(IsObjectValid(oStoreX)) { int nStoreBuyX = GetLocalInt(GetModule(), "STORE_INVEST_BUY_MAX"); int nStoreSellX = GetLocalInt(GetModule(), "STORE_INVEST_SELL_MIN"); SetStoreMarkDown(oStoreX, nStoreBuyX); SetStoreMarkUp(oStoreX, nStoreSellX); PrintToLog("STORE_INVESTMENT - Merchant Closed: " + GetTag(oStoreX) + ". Store Values: " + IntToString(nStoreBuyX) + " vs " + IntToString(nStoreSellX)); } } break; } } }And the output to the log Script STORE_INVESTMENT - Merchant Opened: store_camp_bodahn. Last Merchant: Script STORE_INVESTMENT - Merchant Values (DIALOGUE): -1 vs -1 Script STORE_INVESTMENT - Merchant Values (STATIC): -1 vs -1 Script STORE_INVESTMENT - Merchant Values (STORE GUI): -1 vs -1 Script STORE_INVESTMENT - Merchant Closed: store_camp_bodahn. Store Values: -1 vs -1I am positive the oStore object is valid cause when this script runs the merchant in question will sell and buy with 100% of the value. Am I using the functions wrong or are they simply bugged? -kyoma
  3. 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
×
×
  • Create New...