Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
ScreamingCommie said:
For some reason the spawn item cheat wont work for my debugging purposes, menus after about time 650 are just blank. The only error it gives me is an invalid value error at line 2 in the spawn item menu in module_game_menus.

Can you post the exact error?
 
Nameless Warrior said:
Thanks dragon. Is a party considered inactive if they are in a battle or siege? The chances are small the trigger may go when the King is in combat but it may happen.
Use
Code:
party_get_battle_opponent
or slot_party_last_in_combat (which is a cached value) to check if it's in a battle.
 
Somebody said:
Nameless Warrior said:
Thanks dragon. Is a party considered inactive if they are in a battle or siege? The chances are small the trigger may go when the King is in combat but it may happen.
Use
Code:
party_get_battle_opponent
or slot_party_last_in_combat (which is a cached value) to check if it's in a battle.

Thanks. Will (neq, ":party_id", party_get_battle_opponent), do the job?


 
ScreamingCommie said:

The image is no longer available or does not exist...


Can i find the percentage of the amount of troops in a party rather than a constant?

Edit

would it be something like

    (try_begin),
        (store_party_size_wo_prisoners, ":party_size", "p_main_party"),
        (val_div, ":party_size", 100),
        (val_mul, ":party_size", "percentage i need to find"),     
    (try_end),

    (assign, reg0, ":party_size"),

Then check the troops i need against the party size. Or their a more eloquent way of doing this?


Cheers.
 
produno said:
Can i find the percentage of the amount of troops in a party rather than a constant?
Always scale up before doing integer division. Depending on if you'll need more than one party composition, for multiple members do a stack loop, for only one specific troop type you can do party_count_companions_of_type and store_party_size_wo_prisoners.
 
koteko said:
Apparently we can't neg or put this_or_next in a call_script line. Good to know.
Correct. In case it wasn't obvious,  I use the alternative of try_begin, call_script, else_try, failure operations, try_end for neg; for this_or_next you would have to use a script return value.
 
I'm having an issue with the item list for the inventory of my troops :

Code:
Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "E:\Dev suite new\Floris Dev Suite 2.55\process_operations.py", line 14,
in <module>
    from module_troops import *
  File "E:\Dev suite new\Floris Dev Suite 2.55\module_troops.py", line 912, in <
module>
    [itm_nomad_vest,itm_nomad_armor,itm_Nomad_Armor,itm_leather_jerkin,itm_Nomad
_Armor,itm_Nomad_Armor,itm_h_skull_cap_helmet_02,itm_Skullcap,itm_h_skull_cap_he
lmet_03,itm_h_skull_cap_helmet_04,itm_leather_gloves,itm_ga_vae_a2_leather,itm_n
omad_boots,itm_leather_boots,itm_Leather_Boots,itm_arrows,itm_nomad_bow,itm_sh_s
ar_rou_plain,itm_Long_Falchion,itm_Long_Falchion,itm_sword_khergit_1,itm_Long_Fa
lchion,itm_Long_Falchion,itm_91nh,itm_92nh,itm_09nh,itm_93nh,itm_94nh],
NameError: name 'itm_nomad_vest' is not defined

These items do exist in module_items.py, and it seems to work if I put them between inverted commas. However, I've got hundreds of troops like this, and it would be a nightmare to insert thousands of "" everywhere...

Is there another way to fix that?
 
Somebody said:
Deathwhisper said:
I'm having an issue with the item list for the inventory of my troops
Why would you need inverted commas? Just lowercase them and everything should be fine.

I don't know, it just doesn't work without inverted commas.

Here's the troop entry (the same issue occurs for all the other troops as well) :

Code:
 ["Horse_Archer", "Horse Archer", "Horse Archers", tf_guarantee_all|tf_mounted, 0, 0, fac_kingdom_2,
  [itm_nomad_vest,itm_nomad_armor,itm_Nomad_Armor,itm_leather_jerkin,itm_Nomad_Armor,itm_Nomad_Armor,itm_h_skull_cap_helmet_02,itm_Skullcap,itm_h_skull_cap_helmet_03,itm_h_skull_cap_helmet_04,itm_leather_gloves,itm_ga_vae_a2_leather,itm_nomad_boots,itm_leather_boots,itm_Leather_Boots,itm_arrows,itm_nomad_bow,itm_sh_sar_rou_plain,itm_Long_Falchion,itm_Long_Falchion,itm_sword_khergit_1,itm_Long_Falchion,itm_Long_Falchion,itm_91nh,itm_92nh,itm_09nh,itm_93nh,itm_94nh],
  str_21|agi_17|int_4|cha_4|level(15),wpex(110,75,65,155,25,40),knows_trade_2|knows_leadership_1|knows_prisoner_management_1|knows_persuasion_9|knows_engineer_9|knows_inventory_management_2|knows_horse_archery_3|knows_riding_1|knows_athletics_6|knows_shield_1|knows_power_draw_3|knows_power_strike_2|knows_ironflesh_1,0x0000000beb0020082ab3b296cd68b8d200000000001f38c70000000000000000, 0x0000000ffa0025492a82b254e0594d3700000000001f07a90000000000000000],

Thanks.
 
Seek n Destroy said:
Use lowercase letters in the items ID, instead of Long_Falchion use long_falchion.

It still doesn't work. It still gives me an error regarding the "itm_nomad_vest" item (the first of the list), which has always been in lowercase letters.
 
Maybe because you have two of them in the items file ?You had nomad_vest and Nomad_Vest for some reason.
Also, troop ID needs to be lowercase too, I used uppercase first time I used the module system and nothing worked so I figured the IDs need to be lowercase to work, see the native codes.
 
I've finally found the issue...

All my item IDs would start with "itm_", while it isn't needed. Therefore, the real ID would always start with "itm_itm_", which means the item could never be found.

Thanks for the help anyway !
 
hey again all, I keep getting an unexpected indent error in this snippet of code. It's somewhere in this mess, and I have been unable to fix it after shifting things around for 45 minutes. Someone see something I'm missing?

[party_tpl|pt_refugees,"start", [(eq,"$talk_context",tc_party_encounter), (check_quest_active, "qst_escort_refugees")], "What is it?", "playerRefugeeOrders", []],
[party_tpl|pt_refugees|plyr,"playerRefugeeOrders", [], "Nothing, lets keep moving.", "close_window", [(assign, "$g_leave_encounter",1),(party_set_ai_behavior, "$g_encountered_party", ai_bhvr_escort_party),
    (party_set_ai_object, "$g_encountered_party", "p_main_party"),
    (party_set_flags, "$g_encountered_party", pf_default_behavior, 0)]],
[party_tpl|pt_refugees|plyr,"playerRefugeeOrders", [], "Wait here, I will check that the path is safe", "waitRefugeeResponse", []],
[party_tpl|pt_refugees,"waitRefugeeResponse", [], "Right then, we will wait here for your instructions",[(set_ai_behavr, "$g_encountered_party", ai_bhvr_hold)]],
  [party_tpl|pt_refugees, "start", [(quest_get_slot, ":quest_target_party", "qst_escort_merchant_caravan", slot_quest_target_party),
                                          (eq,"$g_encountered_party",":quest_target_party"),
                                          (quest_get_slot, ":quest_target_center", "qst_escort_merchant_caravan", slot_quest_target_center),
                                          (store_distance_to_party_from_party, ":dist", "$refugeeLocation",":quest_target_party"),
                                          (lt,":dist",4)]], "Thank you so much for your help, here is what little we can pay. We are sorry but as you could imagine we do not have much left.", "refugeeQuestDecison",
[(call_script, "script_end_quest","qst_escort_refugees")]],
# [party_tpl|pt_refugees|plyr,"refugeeQuestDecison", [], "No, I can't take your money, not after what you've been through, best of luck in your new lives" , "refugeeQuestDecisionThankYouNeutral", []],

[party_tpl|pt_refugees|plyr,"refugeeTalk", [], "Very well, you best be on your way", "close_window", [(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_refugees|plyr,"refugeeTalk", [], "You'd move a lot faster if you weren't carrying all that weight i'll just take it off your hands(Attack!).", "refugeeIsAttacked", []],
[party_tpl|pt_refugees,"refugeeIsAttacked", [], "You bastard! We are defensless people, you will be punished for your actions one day!", "close_window",
  [(store_relation,":rel", "$g_encountered_party_faction","fac_player_supporters_faction"),
    (val_sub, ":rel", 20),
    (call_script, "script_set_player_relation_with_faction", "$g_encountered_party_faction", ":rel"),
(call_script, "script_diplomacy_party_attacks_neutral", "p_main_party", "$g_encountered_party"),
(encounter_attack)]], 

Log
Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 6, in <module>
    from module_dialogs import *
  File "C:\TEST\Module_system 1.158\module_dialogs.py", line 1485
    [party_tpl|pt_refugees|plyr,"refugeeQuestDecison", [], "No, I can't take you
r money, not after what you've been through, best of luck in your new lives" , "
refugeeQuestDecisionThankYouNeutral", []],
    ^
IndentationError: unexpected indent
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Error: Invalid object:{s1} refugees.Variables should start with $ sign and refer
ences should start with a tag
ERROR: Illegal Identifier:{s1} Refugees
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
Traceback (most recent call last):
  File "process_dialogs.py", line 6, in <module>
    from module_dialogs import *
  File "C:\TEST\Module_system 1.158\module_dialogs.py", line 1485
    [party_tpl|pt_refugees|plyr,"refugeeQuestDecison", [], "No, I can't take you
r money, not after what you've been through, best of luck in your new lives" , "
refugeeQuestDecisionThankYouNeutral", []],
    ^
IndentationError: unexpected indent
Checking global variable usages...
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
Turn on the special character (and whitespace) display on your IDE. You absolutely do not want tabs in the middle of your strings, especially as some IDEs auto-indent with them on a multiline. When you post code, do so in the
Code:
[code][∕code]
forum tags next time so as to preserve spacing. Also the real problem is here (lt,":dist",4)]], you have an extra closing bracket that bracket matching could have found for you more easily.
 
(lt,":dist",4)]], "Thank you so much for your help, here is what little we can pay. We are sorry but as you could imagine we do not have much left.",

Maybe because there are 2 of ']' instead of just one? I never worked with dialogs before and I am also too lazy to look into the syntax to tell you if i am right or not :grin:
 
Anybody have a clue what this means?
SSvWOSR.jpg
 
Status
Not open for further replies.
Back
Top Bottom