Native LSP World Map Map Icons Pack

Habsburg

Regular
Best answers
0
mauromagno said:
Following the instructions
Am I stupid or are there no instructions in this threat?
I mean, maybe ist obvious to most People, but I have no idea what to do.
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Best answers
33
Habsburg said:
I have no idea what to do.
you can read the entire thread (posts), that should take you to some discussions and code examples on how to use the art assets from the OP (original post). The OP was more about sharing the resources (icons), each modder can use them in different ways.

you can also check the tutorial section or ask on the Q&A thread to learn more about modding and coding Warband.
 

Habsburg

Regular
Best answers
0
kalarhan said:
Habsburg said:
I have no idea what to do.
you can read the entire thread (posts), that should take you to some discussions and code examples on how to use the art assets from the OP (original post). The OP was more about sharing the resources (icons), each modder can use them in different ways.

you can also check the tutorial section or ask on the Q&A thread to learn more about modding and coding Warband.
Thanks!

So there is no way to just, you know, replace some files and code lines to implement those amazing map Icons?  :grin:
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Best answers
33
Habsburg said:
So there is no way to just, you know, replace some files and code lines to implement those amazing map Icons?  :grin:
that is the gist (short version), you just need to read a few posts as there is no step-by-step instruction in the OP.

@Janycz seems to have posted enough instructions, check all his posts, as a starting point.
 

Corbul

Sergeant at Arms
WBWF&SVC
Best answers
1
Sorry to necro the thread, but I can't figure out squat of what we're supposed to do to install these  :cry:
 

NPC99

Baron
M&BWBWF&SVC
Best answers
13
Corbul said:
Sorry to necro the thread, but I can't figure out squat of what we're supposed to do to install these  :cry:
They’re replacement meshes for the native ones in map_icons.py. Read the module system documentation:
The module system uses Python lists to represent collections of game objects. ( A python lists starts with a '[', includes a list of objects seperated by commas, and ends with a  ']'  ) If you open and view any of the module files you'll see that it contains such a list. For example module_map_icons.py contains:

map_icons = [
  ("player",0,"player", 0.2, snd_footstep_grass),
  ("player_horseman",0,"player_horseman", 0.2, snd_gallop),
  ("gray_knight",0,"knight_a", 0.2, snd_gallop),
  ("vaegir_knight",0,"knight_b", 0.2, snd_gallop),
  ("peasant",0,"peasant_a", 0.2,snd_footstep_grass),
  ("khergit",0,"khergit_horseman", 0.2,snd_gallop),
  ("axeman",0,"bandit_a", 0.2,snd_footstep_grass),
  ("woman",0,"woman_a", 0.2,snd_footstep_grass),
  ("town",mcn_no_shadow,"City", 0.9,snd_footstep_grass),
]

Here map_icons is declared as a Python list and every element in the list is the declaration for a specific map icon object. In this example, ("player",0,"player", 0.2, snd_footstep_grass) is such an object. We call such objects tuples. Tuples, like lists, contain elements seperated by commas (but they start and end with parentheses). The structure of each tuple object is documented at the beginning of the module file. For map icons, each tuple object contains:

1 ) name of the icon,
2 ) icon flags,
3 ) Mesh name,
4 ) Mesh scale,
5 ) sound id.

So, for the first tuple ("player",0,"player", 0.2, snd_footstep_grass)
1 ) name of the icon = "player"
2 ) icon flags = 0
3 ) Mesh name = "player"
4 ) Mesh scale = 0.2
5 ) sound id = snd_footstep_grass

You can work out the structure of game objects for each module system file in this way, by reading the documentation at the beginning and matching that with the contents of the list.

Extracted from https://forums.taleworlds.com/index.php/topic,11422.0.html
 

Corbul

Sergeant at Arms
WBWF&SVC
Best answers
1
Eh, I tried adding the codes from page 2, and got some errors during compilation. It would seem those "tutorials" are incomplete: apparently there's also need to add some lines to module_constants, and do something else, otherwise it just won't compile. Strangely enough, when I did some stuff intuitively, it did compile, but when I launched the game, the my map icon would spawn several parties of one unit (myself) running in all directions, and these would, for whatever reason, cause me to get xp and I levelled to 11 after just a few steps! :shock: Lord parties wouldn't even spawn. :???:
 

Eärendil the Mariner

Subforum Moderator
WBWF&SM&B
Best answers
58
Slawomir of Aaarrghh said:
This pack contains only resources - BRF's + textures. No scripts included.
NPC99 said:
Corbul said:
Sorry to necro the thread, but I can't figure out squat of what we're supposed to do to install these  :cry:
They’re replacement meshes for the native ones in map_icons.py. Read the module system documentation:
The module system uses Python lists to represent collections of game objects. ( A python lists starts with a '[', includes a list of objects seperated by commas, and ends with a  ']'  ) If you open and view any of the module files you'll see that it contains such a list. For example module_map_icons.py contains:

map_icons = [
  ("player",0,"player", 0.2, snd_footstep_grass),
  ("player_horseman",0,"player_horseman", 0.2, snd_gallop),
  ("gray_knight",0,"knight_a", 0.2, snd_gallop),
  ("vaegir_knight",0,"knight_b", 0.2, snd_gallop),
  ("peasant",0,"peasant_a", 0.2,snd_footstep_grass),
  ("khergit",0,"khergit_horseman", 0.2,snd_gallop),
  ("axeman",0,"bandit_a", 0.2,snd_footstep_grass),
  ("woman",0,"woman_a", 0.2,snd_footstep_grass),
  ("town",mcn_no_shadow,"City", 0.9,snd_footstep_grass),
]

Here map_icons is declared as a Python list and every element in the list is the declaration for a specific map icon object. In this example, ("player",0,"player", 0.2, snd_footstep_grass) is such an object. We call such objects tuples. Tuples, like lists, contain elements seperated by commas (but they start and end with parentheses). The structure of each tuple object is documented at the beginning of the module file. For map icons, each tuple object contains:

1 ) name of the icon,
2 ) icon flags,
3 ) Mesh name,
4 ) Mesh scale,
5 ) sound id.

So, for the first tuple ("player",0,"player", 0.2, snd_footstep_grass)
1 ) name of the icon = "player"
2 ) icon flags = 0
3 ) Mesh name = "player"
4 ) Mesh scale = 0.2
5 ) sound id = snd_footstep_grass

You can work out the structure of game objects for each module system file in this way, by reading the documentation at the beginning and matching that with the contents of the list.

Extracted from https://forums.taleworlds.com/index.php/topic,11422.0.html
Read again :wink:
And for the code snippets at page 2, you cannot always relay on something like this, you never know for which purpose other modders are using the map icons and thus what they are coding...
 

-R0B0-

Regular
WB
Best answers
0
Janycz said:
Many scripts for this osp(battlefields):

Code:
  ("dedal_battlefield_a",mcn_no_shadow,"dedal_battlefield_a", 0.15, 0),
  ("dedal_battlefield_b",mcn_no_shadow,"dedal_battlefield_b", 0.15, 0),
  ("dedal_battlefield_c",mcn_no_shadow,"dedal_battlefield_c", 0.15, 0),
  ("dedal_battlefield_d",mcn_no_shadow,"dedal_battlefield_d", 0.15, 0),
Code:
  (1,
  [
    (try_for_parties, ":party"),
      (party_slot_eq, ":party", slot_party_type, spt_battlefield_icon_on_map),
      (party_get_slot, ":hours", ":party", slot_num_hours_battle_icon_on_map),
      (val_add, ":hours", 1),
      (try_begin),
        (ge, ":hours", 24), #24 - how many hours will be visible icon
        (party_clear, ":party"),
        (remove_party, ":party"),
      (else_try),
        (party_set_slot, ":party", slot_num_hours_battle_icon_on_map, ":hours"),
      (try_end),
    (try_end),
  ]),

Code:
  ("draw_battle_icon",
  [
    (store_script_param, ":party_no", 1),
  
    (set_spawn_radius, 0),
    (spawn_around_party, ":party_no", "pt_battlefield"),
    (assign, ":battlefield", reg0),
	
	(assign, ":icon", "icon_dedal_battlefield_a"),
    (store_random_in_range, ":rand", 0, 3),
	
	(try_begin),
      # (eq, ":rand", 0),
	  # (assign, ":icon", "icon_dedal_battlefield_a"),
	# (else_try),  
      (eq, ":rand", 1),
	  (assign, ":icon", "icon_dedal_battlefield_b"),
	(else_try),  
      (eq, ":rand", 2),
	  (assign, ":icon", "icon_dedal_battlefield_c"),
	(else_try),  
      (eq, ":rand", 3),
	  (assign, ":icon", "icon_dedal_battlefield_d"),
	(try_end),
	
    (party_set_icon, ":battlefield", ":icon"),
	
    (party_set_slot, ":battlefield", slot_num_hours_battle_icon_on_map, 0),
    (party_set_slot, ":battlefield", slot_party_type, spt_battlefield_icon_on_map),
    (party_set_flags, ":battlefield", pf_is_static|pf_always_visible|pf_no_label, 1),
  ]),

insert into the begin of the script 'game_event_battle_end':
Code:
(store_script_param_1, ":root_defender_party"),
(store_script_param_2, ":root_attacker_party"),
(call_script, "script_draw_battle_icon", ":root_attacker_party"),
for example:
Code:
 ("game_event_battle_end",
    [
      (store_script_param_1, ":root_defender_party"),
      (store_script_param_2, ":root_attacker_party"),
	  
      (call_script, "script_draw_battle_icon", ":root_attacker_party"),

      #other operations ...
      ...
 ]),

I've added these exactly as you did and i get this error
  File "D:\Program Files\Steam\steamapps\common\MountBlade Warband\Modules\Calradian Civil War\Module_system 1.166\module_simple_triggers.py", line 3990, in <module>
    (party_slot_eq, ":party", slot_party_type, spt_battlefield_icon_on_map),
NameError: name 'spt_battlefield_icon_on_map' is not defined
  File "D:\Program Files\Steam\steamapps\common\MountBlade Warband\Modules\Calradian Civil War\Module_system 1.166\module_scripts.py", line 47618, in <module>
    (party_set_slot, ":battlefield", slot_num_hours_battle_icon_on_map, 0),
NameError: name 'slot_num_hours_battle_icon_on_map' is not defined
 

Janycz

Knight at Arms
WB
Best answers
0
@ᚱᛟᛒᛟ you have to define the slot 'slot_num_hours_battle_icon_on_map' and the constant 'spt_battlefield_icon_on_map'.
 

-R0B0-

Regular
WB
Best answers
0
Janycz said:
@ᚱᛟᛒᛟ you have to define the slot 'slot_num_hours_battle_icon_on_map' and the constant 'spt_battlefield_icon_on_map'.
I know that but where is the question really, i took a peek at module_constants and don't understand where to place it and i have no idea where to define 'slot_num_hours_battle_icon_on_map'!
 

-R0B0-

Regular
WB
Best answers
0
kalarhan said:
ᚱᛟᛒᛟ said:
i took a peek at module_constants and don't understand where
anywhere, altho for readability sake you should keep things together (party slots on the party section, etc). Not like it matters to the game, just to you (the coder).

see this https://forums.taleworlds.com/index.php/topic,12620.0.html
I know where to define it but i cant figure out what to define it "correctly" so i dont get a bunch of errors and it wont work
 

Antonis

Marquis
WBWF&SVCNW
Best answers
0
Well, I haven't installed the battlefield icons to any of my mods, but as for the icons oer faction, I did this:
slot_kingdom_party_leader = 380(any unused number, really)
Put this anywhere you want in the constants. I put it to the party slots, it makes more sense to me. But the placing is of no importance. Write something like slot_num_hours_battle_icon_on_map = 452 or sth(I don't know if that is unused at your module system) and the same for the other constant.
 

-R0B0-

Regular
WB
Best answers
0
I´ve implemented it all and i get these errors when build the module and i got no idea what to do.


WARNING: Local variable never used: root_defender_party, at: game_event_battle_end
Error: Unable to find object:pt_battlefield
ERROR: Illegal Identifier:pt_battlefield

Traceback (most recent call last):
  File "process_simple_triggers.py", line 30, in <module>
    save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_strings)
  File "process_simple_triggers.py", line 20, in save_simple_triggers
    save_statement_block(file,0, 1, simple_trigger[1]  , variable_list,variable_uses,tag_uses,quick_strings)
  File "D:\Program Files\Steam\steamapps\common\MountBlade Warband\Modules\Calradian Civil War\Module_system 1.166\process_operations.py", line 459, in save_statement_block
    save_statement(ofile,opcode,no_variables,statement,variable_list,variable_uses,local_vars, local_var_uses,tag_uses,quick_strings)
  File "D:\Program Files\Steam\steamapps\common\MountBlade Warband\Modules\Calradian Civil War\Module_system 1.166\process_operations.py", line 408, in save_statement
    ofile.write("%d "%operand)
TypeError: %d format: a number is required, not list

Checking global variable usages...
WARNING: Global variable never used: auto_menu
WARNING: Global variable never used: g_player_banner_granted
WARNING: Global variable never used: g_force_peace_faction_1
WARNING: Global variable never used: g_force_peace_faction_2
WARNING: Global variable never used: g_presentation_lines_to_display_begin
WARNING: Global variable never used: g_presentation_lines_to_display_end
WARNING: Global variable never used: g_player_icon_state
WARNING: Global variable never used: g_camp_mode
WARNING: Global variable never used: g_player_raiding_village
WARNING: Global variable never used: g_last_rest_payment_until
WARNING: Global variable never used: qst_collect_taxes_menu_counter
WARNING: Global variable never used: qst_collect_taxes_unrest_counter
WARNING: Global variable never used: g_player_party_icon
WARNING: Global variable never used: g_check_autos_at_hour
WARNING: Global variable never used: g_last_half_payment_check_day
WARNING: Global variable never used: qst_train_peasants_against_bandits_num_hours_trained
WARNING: Global variable never used: g_last_report_control_day
WARNING: Global variable never used: total_no_fief_changes
WARNING: Global variable never used: g_dont_give_fief_to_player_days
WARNING: Global variable never used: g_dont_give_marshalship_to_player_days
WARNING: Global variable never used: training_ground_position_changed
WARNING: Global variable never used: bug_fix_version
WARNING: Global variable never used: g_one_faction_left_notification_shown
 

Antonis

Marquis
WBWF&SVCNW
Best answers
0
By their own, "variables not used" warning isn't anything to worry about. In some of my mods I have a lot of those lying around, mostly of experiments half-implemented or failed. It is a bit of lazy programming not to erase them and I know kalarhan would frown at this shoddy work.  :razz:
But it just means that you assign a variable and you don't really use it anywhere.

Now, as for the "Error: Unable to find object:pt_battlefield", that means that you forgot to add a party template named battlefield or miss-typed something. Check what you edited in party templates. As for the other errors, again probably a miss-type, you seem to reference the wrong type of variable.