cwr
There is nothing of value here... The pre_join menu code works but its the simplest thing in the world to do. Don't use the sea travel or the village... They are very bad results of when I just started modding.
Original post:
Original post:
You can use them without contacting me first, but if you could credit me, that would be great.
These are mainly practices for me to get better at modding; so yeah, the quality may not be the best.
Thanks to Guspav for a fix to my code.
These are mainly practices for me to get better at modding; so yeah, the quality may not be the best.
Thanks to Guspav for a fix to my code.
Replace the old "pre_join" menu with this one.
Thanks to Guspav for the fix.
For those who are using .txt files for editing:
Paste this:
Over this:
Note that editing .txt files is a really bad idea, this is just for if you can't set up the module system, which you really should be able to set up.
Thanks to Guspav for the fix.
Code:
(
"pre_join",0,
"You come across a battle between {s2} and {s1}. You decide to...",
"none",
[
(str_store_party_name, 1,"$g_encountered_party"),
(str_store_party_name, 2,"$g_encountered_party_2"),
],
[
("pre_join_help_attackers",[
# (store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
# (store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
# (store_faction_of_party, ":defender_faction", "$g_encountered_party"),
# (store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
# (ge, ":attacker_relation", 0),
# (lt, ":defender_relation", 0),
],
"Move in to help the {s2}.",[
(try_begin),
(eq,"$players_kingdom","$g_encountered_party_faction"),
(assign, "$player_has_homage", 0),
(call_script, "script_player_leave_faction", 0),
(assign, "$g_recalculate_ais", 1),
(try_end),
(store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
(store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
(store_faction_of_party, ":defender_faction", "$g_encountered_party"),
(store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
(val_add, ":attacker_relation", 2),
(val_add, ":defender_relation", -2),
(call_script, "script_set_player_relation_with_faction",":defender_faction", ":defender_relation"),
(call_script, "script_set_player_relation_with_faction",":attacker_faction", ":attacker_relation"),
(select_enemy,0),
(assign,"$g_enemy_party","$g_encountered_party"),
(assign,"$g_ally_party","$g_encountered_party_2"),
(jump_to_menu,"mnu_join_battle")]),
("pre_join_help_defenders",[
# (store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
# (store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
# (store_faction_of_party, ":defender_faction", "$g_encountered_party"),
# (store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
# (ge, ":defender_relation", 0),
# (lt, ":attacker_relation", 0),
],
"Rush to the aid of the {s1}.",[
(try_begin),
(eq,"$players_kingdom","$g_encountered_party_faction"),
(assign, "$player_has_homage", 0),
(call_script, "script_player_leave_faction", 0),
(assign, "$g_recalculate_ais", 1),
(try_end),
(store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
(store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
(store_faction_of_party, ":defender_faction", "$g_encountered_party"),
(store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
(val_add, ":attacker_relation", -2),
(val_add, ":defender_relation", 2),
(call_script, "script_set_player_relation_with_faction",":defender_faction", ":defender_relation"),
(call_script, "script_set_player_relation_with_faction",":attacker_faction", ":attacker_relation"),
(select_enemy,1),
(assign,"$g_enemy_party","$g_encountered_party_2"),
(assign,"$g_ally_party","$g_encountered_party"),
(jump_to_menu,"mnu_join_battle")]),
("pre_join_leave",[],"Don't get involved.",[(leave_encounter),(change_screen_return)]),
]
),
For those who are using .txt files for editing:
Paste this:
Code:
menu_pre_join 0 You_come_across_a_battle_between_{s2}_and_{s1}._You_decide_to... none 2 2330 2 1 144115188075856273 2330 2 2 144115188075856786 3
mno_pre_join_help_attackers 0 Move_in_to_help_the_{s2}. 18 4 0 31 2 144115188075856287 144115188075856787 2133 2 144115188075856066 0 1 2 936748722493063548 0 2133 2 144115188075856069 1 3 0 2204 2 1224979098644774912 144115188075856786 2190 3 1224979098644774913 1224979098644774912 432345564227567637 2204 2 1224979098644774914 144115188075856273 2190 3 1224979098644774915 1224979098644774914 432345564227567637 2110 2 1224979098644774913 -5 2105 2 1224979098644774915 5 1 3 936748722493063444 1224979098644774914 1224979098644774915 1 3 936748722493063444 1224979098644774912 1224979098644774913 1303 1 0 2133 2 144115188075856188 144115188075856273 2133 2 144115188075856189 144115188075856786 2060 1 864691128455135286 . mno_pre_join_help_defenders 0 Rush_to_the_aid_of_the_{s1}. 18 4 0 31 2 144115188075856287 144115188075856787 2133 2 144115188075856066 0 1 2 936748722493063548 0 2133 2 144115188075856069 1 3 0 2204 2 1224979098644774912 144115188075856786 2190 3 1224979098644774913 1224979098644774912 432345564227567637 2204 2 1224979098644774914 144115188075856273 2190 3 1224979098644774915 1224979098644774914 432345564227567637 2110 2 1224979098644774913 -5 2105 2 1224979098644774915 5 1 3 936748722493063444 1224979098644774914 1224979098644774915 1 3 936748722493063444 1224979098644774912 1224979098644774913 1303 1 1 2133 2 144115188075856188 144115188075856786 2133 2 144115188075856189 144115188075856273 2060 1 864691128455135286 . mno_pre_join_leave 0 Don't_get_involved. 2 1301 0 2040 0 .
Code:
menu_pre_join 0 You_come_across_a_battle_between_{s2}_and_{s1}._You_decide_to... none 2 2330 2 1 144115188075856273 2330 2 2 144115188075856786 3
mno_pre_join_help_attackers 6 2204 2 1224979098644774912 144115188075856786 2190 3 1224979098644774913 1224979098644774912 432345564227567630 2204 2 1224979098644774914 144115188075856273 2190 3 1224979098644774915 1224979098644774914 432345564227567630 30 2 1224979098644774913 0 2147483678 2 1224979098644774915 0 Move_in_to_help_the_{s2}. 4 1303 1 0 2133 2 144115188075856188 144115188075856273 2133 2 144115188075856189 144115188075856786 2060 1 864691128455135282 . mno_pre_join_help_defenders 6 2204 2 1224979098644774912 144115188075856786 2190 3 1224979098644774913 1224979098644774912 432345564227567630 2204 2 1224979098644774914 144115188075856273 2190 3 1224979098644774915 1224979098644774914 432345564227567630 30 2 1224979098644774915 0 2147483678 2 1224979098644774913 0 Rush_to_the_aid_of_the_{s1}. 4 1303 1 1 2133 2 144115188075856188 144115188075856786 2133 2 144115188075856189 144115188075856273 2060 1 864691128455135282 . mno_pre_join_leave 0 Don't_get_involved. 2 1301 0 2040 0 .
Note that editing .txt files is a really bad idea, this is just for if you can't set up the module system, which you really should be able to set up.
I have made a new map in Thorgrim's Map Editor which allows the player to travel by sea.
I have made two changes:
1) The first is to change terrain under bridge map icons, so if you want map icons to change during sea travel, it won't effect bridges. It won't harm gameplay in any way, its just a bug fix for if you want your map icon to change during sea travel.
2) Second, and more importantly, you can now travel by sea by using this map. I have tried to make the routes as efficient as possible, so hopefully the AI will use all routes of sea travel.
Download - 1.9 Mb
To install: Simply replace your old map.txt with this one.
To make map icons change during sea travel, paste this code into module_simple_triggers, over the original "# Updating player icon in every frame" code:
The original code for this was made by GoldEagleMNE, here.
This code causes map lag! Use at your own risk! I will make a better code soon!
That code assumes you are using this. (Made by CBWarDog)
To use that, do not use CBWarDog's code, instead, add this to the end of module_map_icons:
You also need to move the .brf made by CBWarDog into your resource folder.
To get rid of the problem of the bridge terrain showing on the map, follow swyter's fix:
I have made two changes:
1) The first is to change terrain under bridge map icons, so if you want map icons to change during sea travel, it won't effect bridges. It won't harm gameplay in any way, its just a bug fix for if you want your map icon to change during sea travel.
2) Second, and more importantly, you can now travel by sea by using this map. I have tried to make the routes as efficient as possible, so hopefully the AI will use all routes of sea travel.
Download - 1.9 Mb
To install: Simply replace your old map.txt with this one.
To make map icons change during sea travel, paste this code into module_simple_triggers, over the original "# Updating player icon in every frame" code:
The original code for this was made by GoldEagleMNE, here.
Code:
# Updating player icon in every frame
(0, [
(try_for_range, ":kingdom_hero", active_npcs_begin, active_npcs_end),
(troop_get_slot, ":party", ":kingdom_hero", slot_troop_leaded_party),
(troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero),
(party_get_current_terrain, ":terrain", ":party"),
(try_begin),
(eq, ":terrain", rt_bridge),
(party_set_icon, ":party", "icon_ship"),
(else_try),
(party_get_icon, ":icon", ":party"),
(eq, ":icon", "icon_ship"),
(party_set_icon, ":party", "icon_flagbearer_a"),
(try_end),
(try_end),
(troop_get_inventory_slot, ":cur_horse", "trp_player", 8), #horse slot
(party_get_current_terrain, ":terrain", "p_main_party"),
(assign, ":new_icon", "icon_player"),
(try_begin),
(eq, "$g_player_icon_state", pis_normal),
(try_begin),
(eq, ":terrain", rt_bridge),
(assign, ":new_icon", "icon_ship"),
(else_try),
(ge, ":cur_horse", 0),
(assign, ":new_icon", "icon_player_horseman"),
(else_try),
(party_get_num_companion_stacks, ":num_stacks","p_main_party"),
(assign, ":num_men", 0),
(try_for_range, ":i_stack", 1, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop","p_main_party",":i_stack"),
(try_begin),
(troop_is_hero, ":stack_troop"),
(val_add, ":num_men", 1), #it was 3 in "Mount&Blade", now it is 1 in Warband
(else_try),
(party_stack_get_size, ":stack_size","p_main_party",":i_stack"),
(val_add, ":num_men", ":stack_size"),
(try_end),
(gt, ":num_men", 8),
(assign, ":new_icon", "icon_player_with_party"),
(try_end),
(else_try),
(eq, "$g_player_icon_state", pis_camping),
(assign, ":new_icon", "icon_camp"),
(else_try),
(eq, "$g_player_icon_state", pis_ship),
(assign, ":new_icon", "icon_ship"),
(try_end),
(neq, ":new_icon", "$g_player_party_icon"),
(assign, "$g_player_party_icon", ":new_icon"),
(party_set_icon, "p_main_party", ":new_icon"),
]),
This code causes map lag! Use at your own risk! I will make a better code soon!
That code assumes you are using this. (Made by CBWarDog)
To use that, do not use CBWarDog's code, instead, add this to the end of module_map_icons:
Code:
("player_with_party",0,"uwplayer", avatar_scale, snd_footstep_grass, 0.15, 0.173, 0),
You also need to move the .brf made by CBWarDog into your resource folder.
To get rid of the problem of the bridge terrain showing on the map, follow swyter's fix:
Swyter said:Copy the materialand duplicate it, call itCode:map_ocean
and delete or rename the original. That should work.Code:map_bridge
In the module system, the material number 7;, is calledCode:rt_ford
. Proof here, from my map editor, cartographer.Code:rt_bridge
Here's the complete list of hardcoded map materials called by the engine as of now, in case any of you need them for some reason:
Code:map_reverse_foam map_foam map_shore map_bridge map_mountain_forest map_river map_desert map_snow map_steppe map_plain map_mountain map_ocean
I have made a scene for a village. Its nothing special, it's basically for me to practice with making AI meshes.
It is ready to be put into a game, just code in an extra village.
Download - 66 Kb
Terrain code: 0x00000001300389800003a4ea000058340000637a0000399b
Screenshots of the village: (my screenshots are inside of multiplayer, so you can't see any villagers, but it has all the necessary entry points, and an ai mesh )
I am using Doma_'s cinematic compilation for those screenshots, if you aren't using that mod, it will look different.
Thank you to Hiner for your awesome video tutorial that got me started scening.
It is ready to be put into a game, just code in an extra village.
Download - 66 Kb
Terrain code: 0x00000001300389800003a4ea000058340000637a0000399b
Screenshots of the village: (my screenshots are inside of multiplayer, so you can't see any villagers, but it has all the necessary entry points, and an ai mesh )
I am using Doma_'s cinematic compilation for those screenshots, if you aren't using that mod, it will look different.
Thank you to Hiner for your awesome video tutorial that got me started scening.