Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
kalarhan said:
maater66241 said:
do they state which script and string is creating warnings/errors?

yeap, just read the error message line by line  :mrgreen:

used in script.game_get_troop_wage  -> script "game_get_troop_wage"
Hmmm, does it say what file they are in? If not I guess, I'll just use the "Find" option.

Anyways, I have another problem. Recently, I want to mod on my new laptop and when finished setting up everything:
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
'python' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Users\Ming\Desktop\source redwars 1.90\Red Wars Modsys Original\*.pyc

______________________________

Script processing has ended.
Press any key to exit. . .

I searched for some help on this forum, but I'm afraid I did those wrong.

I think what I did might be wrong too: I went to Environment Variables and scrolled to "Path" on the bottom half. I then added ";C:\Python27"
Please help. Thanks in advance :grin:
 
maater66241 said:
Hmmm, does it say what file they are in?

script on module_SCRIPTS.py, troops on module_TROOPS.py, and so on  :mrgreen:

and yeap, use the find function. Any decent editor has a "find in all files" option so you can search in the entire folder (all files together), and use " " like in "game_get_note"
 
Leonion said:
I might be wrong and this rule might not apply to regular triggers, but, for example, simple triggers don't count from zero, but rather from a certain random point.

I don't think that's the case for Triggers. Otherwise it would take even longer for the trigger to fire. 700 + random point.

Leonion said:
You can always just re-write the trigger to check for the current day.
Like
(store_current_day, ":cur_day"),
(ge, ":cur_day", 700),


Yeah that is what I have resorted to but I was interested as to why triggers are not working as they are meant to and if anyone else has experienced issues with them?

Using the above means I have to check the trigger every day, or possibly every week for a time span so long. The correct way should only check it once every 700 days.


Cheers.


 
produno said:
I don't think that's the case for Triggers. Otherwise it would take even longer for the trigger to fire. 700 + random point.
It is.
By random point I meant "between 0 and trigger frequency". So 24-hour trigger can start counting not from 0, but from, for example, 7, so for the first time it will fire at hour 17, not 24 since the start of the game.

I just tested this to be sure.
Code:
  (24.0, 0, ti_once, [],
  [
    (store_current_hours, reg7),
	(display_message, "@{reg7}"),
                     ]),
First time I got the message at hour 23, second time it happened at hour 7, third time it happened at hour 28 (wow, it seems like it can start counting from a negative number, so the range is probably (-frequency;+frequency)), forth time - at hour 13, fifth time - at hour 23, sixth time - at hour 20.

produno said:
Using the above means I have to check the trigger every day, or possibly every week for a time span so long. The correct way should only check it once every 700 days.
But why not? A simple 2-operation check is not that big of a deal performance-wise.
 
Leonion said:
produno said:
I don't think that's the case for Triggers. Otherwise it would take even longer for the trigger to fire. 700 + random point.
It is.
By random point I meant "between 0 and trigger frequency". So 24-hour trigger can start counting not from 0, but from, for example, 7, so for the first time it will fire at hour 17, not 24 since the start of the game.

I just tested this to be sure.
Code:
  (24.0, 0, ti_once, [],
  [
    (store_current_hours, reg7),
	(display_message, "@{reg7}"),
                     ]),
First time I got the message at hour 23, second time it happened at hour 7, third time it happened at hour 28 (wow, it seems like it can start counting from a negative number, so the range is probably (-frequency;+frequency)), forth time - at hour 13, fifth time - at hour 23, sixth time - at hour 20.

produno said:
Using the above means I have to check the trigger every day, or possibly every week for a time span so long. The correct way should only check it once every 700 days.
But why not? A simple 2-operation check is not that big of a deal performance-wise.

Ah ok, gotcha.

So my 24 * 700 could be fired anywhere from 0 - 1400 days. Wow, no wonder I have had so many conflicting reports.

Performance wise, its not a great deal, but I have quite a few of these types of triggers and I'm a bit of an optimisation freak :smile:.
 
kalarhan said:
maater66241 said:
Hmmm, does it say what file they are in?

script on module_SCRIPTS.py, troops on module_TROOPS.py, and so on  :mrgreen:

and yeap, use the find function. Any decent editor has a "find in all files" option so you can search in the entire folder (all files together), and use " " like in "game_get_note"
:mrgreen: lol, kinda forgot about that. Thanks. But anyways,

is "itm" module_items?
is "icon" module_icons?
is "s" module_script (the 2 above are pretty obvious, but I actually don't know this one is...)?
And What's "spr" (the only one that I have no clue of)?

How does one solve this issue?:
The following errors were generated during compilation:
  try/end operations do not match in script.copy_troop: 1 try_end(s) missing

And this issue:
The following notifications were generated during compilation:
  local l.unused declared but never used in script.game_get_troop_wage
  local l.unused declared but never used in script.debug_variables
  local l.unused_2 declared but never used in script.debug_variables

Please help me.....thanks  :smile:
 
maater66241 said:
  try/end operations do not match in script.copy_troop: 1 try_end(s) missing

  local l.unused declared but never used in script.game_get_troop_wage

check tutorials and WRECK description to learn about prefix for each type, as the tool has a few diferences from Native compiler. You can also open each ID_xxx.py file to see them (for Native).

first error is a issue with closing logic blocks. Each START needs a END, each (try_begin) needs a (try_end), the same applies to (try_for_range, ...) and all variations.

the second message (once you learn what the "l." stands for) is about a variable that is created, but never used. Sounds simple. You can usually ignore this if it is for a "unused", as the name implies and tutorials should explain (it is a stub), any other situation is a probably bug caused by mistyping the variable names.
 
Hello guys. I've been doing a quest for the last two days and after solving a lot of problems I'm finally stuck.

To start the quest there is a troop that is supposed to spawn in a tavern. However it doesn't. I tried to change the spawn point to no prevail.
(Free spawnpoints in the given tavern scene are: 16-23)

It might have something to do with the position of the troop in module_troops. I put it at the end before the last bracket. However I got into trouble when I had it
at different places. Troops got swapped over, taverns were filled with transvestite visitors (I have the tavern visitor mod installed) and so on.

Here is my code:
Code:
# recruiter kit begin 
  ["dplmc_recruiter","Recruiter","Recruiter",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_horse|tf_guarantee_ranged,0,0,fac_neutral,
   [itm_sword_medieval_a,itm_leather_jerkin,itm_leather_boots,itm_courser,itm_leather_gloves,itm_light_crossbow,itm_bolts],
   def_attrib|agi_21|int_30|cha_21|level(25),wp(130),knows_common|knows_riding_7|knows_horse_archery_5|knows_leadership_7,swadian_face_young_1, swadian_face_old_2],
# recruiter kit end
  ##diplomacy end
  
  ["andersen","Andersen","Andersen",tf_hero|scn_town_4_tavern|entry(17),0, reserved, fac_commoners,[itm_my_ankle_boots,itm_my_nobleman_outfit_b_new,itm_my_khyber_knife],
   str_9|agi_9|int_9|cha_6|level(3),wp(60),knows_tracker_npc|
   knows_ironflesh_1|knows_power_strike_2|knows_pathfinding_3|knows_athletics_2|knows_tracking_2|knows_riding_3, #skills 2/3 player at that level
   0x00000004bf086143259d061a9046e23500000000001db52c0000000000000000],
  ["vargo","Vargo","Vargo",tf_hero|no_scene,0, reserved, fac_commoners,[itm_rus_cav_boots,itm_my_leather_vest_a,itm_le_disk_sword_a,itm_my_courser],
   str_12|agi_12|int_9|cha_6|level(25),wp(160),knows_tracker_npc|
   knows_ironflesh_3|knows_power_strike_5|knows_pathfinding_3|knows_athletics_2|knows_tracking_2|knows_riding_3, #skills 2/3 player at that level
   0x00000004bf086143259d061a9046e23500000000001db52c0000000000000000],
  ["vargosmen","Guard","Guards",tf_guarantee_boots|tf_guarantee_armor|tf_mounted, 0, 0, fac_neutral,
   [itm_rus_cav_boots,itm_my_ankle_boots, itm_woolen_hose_black, itm_my_wrapping_boots, itm_peasant_man_a, itm_my_nomad_vest_new, itm_my_fur_coat, 
   itm_my_hood_new, itm_simple_phrygian_helmet, itm_simple_nasal_helmet, itm_my_spiked_club, itm_vaegir_ulight_mace, itm_my_rusty_pick, itm_my_sword_norman_rusty, 
   itm_bb_mongol_light_lance, itm_my_sumpter_horse, itm_my_sumpter_horse01, itm_my_sumpter_horse02],
   def_attrib|level(15),wp(120),knows_common, swadian_face_young_1, swadian_face_old_2],   
]


#Troop upgrade declarations

"Andersen" is the troop that is supposed to spawn.

And here is my module_dialogues (if the problem lies there):
Code:
[trp_andersen,"start", [(check_quest_succeeded,"qst_antique")], "Hello {playername} nice to see you again!", "close_window",[]],
[trp_andersen,"start", [(check_quest_active,"qst_antique")], "Where you successfull? Have you defeated Vargo?", "andersen_talk_postquest",[]],
[trp_andersen,"start", [], "Hey,{sir/wench} you look like just the person who could save me! Sit down and listen, if you want to become a wealthy man.", "andersen_talk",[]],
[trp_andersen|plyr,"andersen_talk", [], "Sorry, I have not time for old mans stories.", "close_window",[]],
[trp_andersen|plyr,"andersen_talk", [], "Wealthy you say? Go on.", "andersen_talk2",[]],
[trp_andersen,"andersen_talk2", [], "Well, how to start, the last days weren't very fortunate for me. I am a merchant of antiques you must know. I travel from town to town to sell old and rare items to lords and ladies. However three days ago I got robbed by a band of brigands. They took all my cargo and even worse 5000 denars of mine.", "andersen_talk3",[]],
[trp_andersen,"andersen_talk3", [], "These 5000 denars were almost all I got with me. And now I'm sitting in this tavern spending my last denar on a drink. Could you help me get my money back? If you bring me my 5000 denars back you can keep all the loot you find with the brigands and I will teach you how to get better at trading.", "andersen_talk4",[]],
[trp_andersen|plyr,"andersen_talk4", [], "I'm sorry for your situation, but I have no time for that.", "close_window",[]],
[trp_andersen|plyr,"andersen_talk4", [], "I'm interested. Where can I find those brigands?", "andersen_talk5",[]],
[trp_andersen,"andersen_talk5", [], "Thank god! Finally somebody who has the guts to help me! They should be near Veidar.", "close_window",[
      (setup_quest_text, "qst_antique"),
      (str_store_string, s2, "@Andersen told me how his caravan got robbed by bandits. His wealth of 5000 denars and his cargo of antiques is gone. If I bring him his denars back I can keep whatever I find in the rest of his cargo. The Brigands should be near Veidar."),
      (call_script,"script_start_quest","qst_antique","trp_andersen"), (set_spawn_radius,1),(spawn_around_party,"p_village_48","pt_vargo")]],
[trp_andersen|plyr,"andersen_talk_postquest", [], "I am still working on it.", "andersen_talk_postquest2",[]],	 
[trp_andersen|plyr,"andersen_talk_postquest", [(store_troop_gold,":total_money","trp_player"),(ge, ":total_money",5000)], "Yes I was. Here you go. Your 5000 denars.", "andersen_talk_postquest2",[(troop_remove_gold, "trp_player", 5000),(add_xp_as_reward,1000),(troop_get_slot, ":renown", "trp_player", slot_troop_renown),(val_add, ":renown", 25),(troop_set_slot, "trp_player", slot_troop_renown, ":renown")]],	
[trp_andersen,"andersen_talk_postquest2", [], "Please hurry up. I think the tavernkeeper stops believing that I do have the money to pay his bills. The muscles in his arms and the glare in his eyes tell me that I should better pay my bills soon. Please! I need my money as soon as possible!", "close_window",[]],
[trp_andersen,"andersen_talk_postquest2", [], "Thank the Gods! I think one day longer in this tavern with the tavern keepers glaring eyes at my neck and I would have gone insane. Thank you dear friend. Your bravery will not be forgotten. I will tell every merchant in calradia the story of the brave {playername}!", "close_window",[(succeed_quest,"qst_antique")]],


[party_tpl|pt_vargo,"start", [(eq,"$talk_context",tc_party_encounter)], "Hey, you there! What are you looking for?", "vargostart",[]],
[party_tpl|pt_vargo|plyr,"vargostart", [], "Nothing. Farewell.", "close_window",[(assign, "$g_leave_encounter",1)]],
[party_tpl|pt_vargo|plyr,"vargostart", [], "Give back the 5000 denars and the goods you stole from Andersen!", "vargostart2",[]],
[party_tpl|pt_vargo,"vargostart2", [], "Haha! I knew that fool Andersen sent you. Now that he is too old and weak to protect his own goods he needs to order wet nosed simpletons like you to do his bidding.", "vargostart3",[]],
[party_tpl|pt_vargo|plyr,"vargostart3", [], "That wet nosed simpleton will soon have you shoved up his sword.", "close_window",[[encounter_attack]]],

[party_tpl|pt_vargo,"start", [(eq,"$talk_context",tc_hero_defeated)], "I yield! Please, don't kill me!","vargowon",[]],
[party_tpl|pt_vargo|plyr,"vargowon", [], "Give me 5000 Denars and the antiqes you stole from Andersen and I might consider not slicing you up from nose to navel.", "vargowon2",[]],
[party_tpl|pt_vargo,"vargowon2", [], "Here you are. But, please! Don't kill me!", "vargowon3",[(troop_add_item, "trp_player","itm_le_oldsword_1",),(troop_add_gold, "trp_player", 5000)]],
[party_tpl|pt_vargo|plyr,"vargowon3", [], "Well then. Seems like I beat some reason into you.", "close_window",[(assign, "$g_leave_encounter",1)]],

Has anybody and idea?
 
JuJu70 said:
where is the code spawning this Andersen dude?

Code:
tf_hero|scn_town_4_tavern|entry(17)

which is also in the wrong spot

Code:
####################################################################################################################
#  Each troop contains the following fields:
#  1) Troop id (string): used for referencing troops in other files. The prefix trp_ is automatically added before each troop-id .
#  2) Toop name (string).
#  3) Plural troop name (string).
#  4) Troop flags (int). See header_troops.py for a list of available flags
#  5) Scene (int) (only applicable to heroes) For example: scn_reyvadin_castle|entry(1) puts troop in reyvadin castle's first entry point

so @Life_Erikson you need to review your troop code, you are using entry 4 (troop flag) for the scene, which should be on entry 5

Code:
#Arena Masters
  ["town_1_arena_master", "Competition Master","{!}Competition Master",tf_hero|tf_randomize_face, scn_town_1_arena|entry(52),
 
tf_hero|scn_town_4_tavern|entry(17)

which is also in the wrong spot

ha-ha, missed it, should read the whole thing  :oops:

i would still suggest spawning him with code, unless you want him there all the time
 
Like this?

Code:
  ["andersen","Andersen","{!}Andersen",tf_hero|tf_male|tf_guarantee_boots|tf_guarantee_armor,scn_town_4_tavern|entry(17),reserved, fac_commoners,[itm_my_ankle_boots,itm_my_nobleman_outfit_b_new,itm_my_khyber_knife],
   str_9|agi_9|int_9|cha_6|level(3),wp(60),knows_tracker_npc|
   knows_ironflesh_1|knows_power_strike_2|knows_pathfinding_3|knows_athletics_2|knows_tracking_2|knows_riding_3, #skills 2/3 player at that level
   0x00000004bf086143259d061a9046e23500000000001db52c0000000000000000],

I tried it out. But no success.


The quest dialoge is right below the beginning merchant quest.
So below:
Code:
[anyone|auto_proceed, "start",
[
(is_between, "$g_talk_troop", "trp_swadian_merchant", "trp_startup_merchants_end"),
(check_quest_finished, "qst_save_town_from_bandits"),
(eq, "$g_do_one_more_meeting_with_merchant", 2),
],
"{!}.", "merchant_quests_last_word",
[]],

[anyone,"merchant_quests_last_word",
[
],
"I am preparing to leave town in a short while. It's been an honor to know you. Good luck.", "close_window",
[
]],
 
Life_Erikson said:
scn_town_4_tavern|entry(17)

I tried it out. But no success.

did you edit the scene to include that entry point manually  (EP 17)? So it is on a place you can see the npc (and not behind a wall). Also make sure you are using the correct one.
 
Life_Erikson said:
kalarhan said:
Life_Erikson said:
scn_town_4_tavern|entry(17)

I tried it out. But no success.

did you edit the scene to include that entry point manually  (EP 17)? So it is on a place you can see the npc (and not behind a wall). Also make sure you are using the correct one.

Yes.

post your code for the scene. Also, is SP actually added to the scene?
 
kalarhan said:
maater66241 said:
  try/end operations do not match in script.copy_troop: 1 try_end(s) missing

  local l.unused declared but never used in script.game_get_troop_wage

check tutorials and WRECK description to learn about prefix for each type, as the tool has a few diferences from Native compiler. You can also open each ID_xxx.py file to see them (for Native).

first error is a issue with closing logic blocks. Each START needs a END, each (try_begin) needs a (try_end), the same applies to (try_for_range, ...) and all variations.

the second message (once you learn what the "l." stands for) is about a variable that is created, but never used. Sounds simple. You can usually ignore this if it is for a "unused", as the name implies and tutorials should explain (it is a stub), any other situation is a probably bug caused by mistyping the variable names.
Could the one below be the one missing its try_end?
#script_game_get_party_companion_limit:
  # This script is called from the game engine when the companion limit is needed for a party.
  # INPUT: arg1 = none
  # OUTPUT: reg0 = companion_limit
  ("game_get_party_companion_limit",
    [
      (assign, ":troop_no", "trp_player"),

      (assign, ":limit", 30),
      (store_skill_level, ":skill", "skl_leadership", ":troop_no"),
      (store_attribute_level, ":charisma", ":troop_no", ca_charisma),
      (val_mul, ":skill", 5),
      (val_add, ":limit", ":skill"),
      (val_add, ":limit", ":charisma"),

      (troop_get_slot, ":troop_renown", ":troop_no", slot_troop_renown),
      (store_div, ":renown_bonus", ":troop_renown", 25),
      (val_add, ":limit", ":renown_bonus"),

      (assign, reg0, ":limit"),
      (set_trigger_result, reg0),


And for the local l.unused declared but never used in script., apparently none was incorrectly spelled. So, I should be fine, right?
  local l.unused declared but never used in script.game_get_troop_wage (found 1 in only module_scripts)
Line 4665:  ("game_get_troop_wage",

local l.unused declared but never used in script.debug_variables
  local l.unused_2 declared but never used in script.debug_variables (since both of the local l.unused declared but never used in script. are the same)
In ID_scripts....
Line 492: script_debug_variables = 491
In module_scripts....
Line 39264:  # script_debug_variables
Line 39267:  ("debug_variables",

And just to make sure, for duplicate entities, you just delete one of them, right (sorry, I'm really worried I might break something)?
 
Bumping 2 problems I still have:

cwr said:
I just scaled my world map down using Blender. (exported obj using Swyter's Cartographer, pressed S in Blender and scaled it down, then export obj and import again through Swyter)

It worked well- the map looks much better and more detailed now that its scaled down. But the textures no longer blend correctly in game, how do I fix this?

gKorDqP.jpg
cwr said:
[trp_rodrigo|plyr, "rodrigo1", [
], "I wish to trade with you. Are you willing?", "rodrigotrade",[]],
[trp_rodrigo, "rodrigotrade", [
], "Oh, thank the Trading Winds! You had me worried, traveller. Very well, here is what I have.", "rodrigotrade2",[(change_screen_trade, "trp_rodrigotrader"),]],
[trp_rodrigo, "rodrigotrade2", [
], "Pleasure doing business with you, friend.", "close_window",[(assign, "$g_leave_encounter", 1),]],

The trading happens with trp_rodrigo, not trp_rodrigotrader. Whats up with that?
 
Does anyone have an insight into changing particle colour using the rgb keys?

This is green

    (0.0, 0.2), (1, 0.2),      #red keys
    (0.0, 0.7),(1, 0.7),      #green keys
    (0.0, 0.4), (1, 0.4),      #blue keys

white is all (1, 1), (1, 1),s and black is all (0.0, 0.0), (1, 0.0),s.

There are many hex/rgb websites out there but non of them give me colour codes which match those decimal numbers.
 
Status
Not open for further replies.
Back
Top Bottom