sobisonator / imp19c

Imperator 19th century mod
11 stars 15 forks source link

International transfers are not subtracting from the seller stockpile correctly. #381

Open sobisonator opened 1 year ago

sobisonator commented 1 year ago

TODO: Add images of examples

Possible related errors from the latest error log:

[17:57:31][jomini_script_system.cpp:169]: Script system error! Error: Invalid left side during comparison 'var' Script location: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 2; PURCHASE_check_shopping_internal line: 16

[17:57:31][jomini_script_system.cpp:169]: Script system error! Error: Invalid left side during comparison 'var' Script location: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 2; PURCHASE_check_shopping_internal line: 26

[17:57:31][jomini_script_system.cpp:169]: Script system error! Error: Event target link 'var' returned an unset scope Script location: file: file: file: file: file: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 42; PURCHASE_check_shopping_internal line: 18; PURCHASE_generate_order_internal line: 229; PURCHASE_order_internal line: 51; PURCHASE_contact_supplier line: 246; PURCHASE_transfer_if_able line: 45; PURCHASE_transfer_goods_internally line: 53 [17:57:31][jomini_scriptvalue.cpp:939]: Value of wrong type in ' file: file: file: file: file: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 42; PURCHASE_check_shopping_internal line: 18; PURCHASE_generate_order_internal line: 229; PURCHASE_order_internal line: 51; PURCHASE_contact_supplier line: 246; PURCHASE_transfer_if_able line: 45; PURCHASE_transfer_goods_internally line: 51'. Got value of type 'none' [17:57:31][jomini_script_system.cpp:169]: Script system error! Error: Failed to fetch variable for 'l_order_size' due to not being set Script location: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 2; PURCHASE_check_shopping_internal line: 16

sobisonator commented 1 year ago

Further testing:

[10:51:11][jomini_scriptvalue.cpp:939]: Value of wrong type in ' file: file: file: file: file: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 42; PURCHASE_check_shopping_internal line: 18; PURCHASE_generate_order_internal line: 229; PURCHASE_order_internal line: 51; PURCHASE_contact_supplier line: 246; PURCHASE_transfer_if_able line: 45; PURCHASE_transfer_goods_internally line: 22'. Got value of type 'none' [10:51:11][jomini_script_system.cpp:169]: Script system error! Error: Failed to fetch variable for 'l_order_size' due to not being set Script location: file: file: file: file: file: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 42; PURCHASE_check_shopping_internal line: 18; PURCHASE_generate_order_internal line: 229; PURCHASE_order_internal line: 51; PURCHASE_contact_supplier line: 246; PURCHASE_transfer_if_able line: 45; PURCHASE_transfer_goods_internally line: 53 [10:51:11][jomini_script_system.cpp:169]: Script system error! Error: Event target link 'var' returned an unset scope Script location: file: file: file: file: file: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 42; PURCHASE_check_shopping_internal line: 18; PURCHASE_generate_order_internal line: 229; PURCHASE_order_internal line: 51; PURCHASE_contact_supplier line: 246; PURCHASE_transfer_if_able line: 45; PURCHASE_transfer_goods_internally line: 53 [10:51:11][jomini_scriptvalue.cpp:939]: Value of wrong type in ' file: file: file: file: file: file: file: file: events/DEBUG/debug_trade.txt line: 119; PURCHASE_make_internal_shopping_list line: 42; PURCHASE_check_shopping_internal line: 18; PURCHASE_generate_order_internal line: 229; PURCHASE_order_internal line: 51; PURCHASE_contact_supplier line: 246; PURCHASE_transfer_if_able line: 45; PURCHASE_transfer_goods_internally line: 51'. Got value of type 'none'

sobisonator commented 1 year ago

The issue seems to be in failing to get the l_order_size variable, although I suspect other factors are at play in governorships ordering seemingly random amounts of goods when they already have enough supply to meet demand.

sobisonator commented 1 year ago

l_order_size issue resolved

Now getting:

[13:57:03][jomini_script_system.cpp:169]: Script system error! Error: Failed to fetch variable for 'l_order_size' due to not being set Script location: file: file: file: file: file: file: file: file: events/DEBUG/debug_trade.txt line: 76; PURCHASE_make_internal_shopping_list line: 6; PURCHASE_check_shopping_internal line: 28; PURCHASE_generate_order_external line: 216; PURCHASE_order_external line: 51; PURCHASE_contact_supplier line: 232; PURCHASE_transfer_if_able line: 88; PURCHASE_transfer_goods_externally line: 14

sobisonator commented 1 year ago

Work goes on here https://github.com/sobisonator/imp19c/commit/ccc04dd73800106ab8d5f92a4550d3c8693c8c69