Hunting

Users who are viewing this thread

I'm attempting to implement hunting. I've made a deer-herd party template similar to the cattle herd that, when encountered, gives the player the option to hunt. My plan is as follows:

  • Spawn deer on the map with (spawn_horse).
  • Move the deer from entry point to entry point with (agent_set_scripted_destintation).
  • Have mission-template triggers check the map for any "horses". If there are none, quit the mission.
  • Check to see if the player has gotten too close. If he has, increase the prey's speed with (agent_set_speed_limit)

Will the plan outlined above work? I'm currently working on getting them on the map, but I can't determine why the following trigger in my hunting mission-template crashes the game:
Code:
	 # spawn prey
     (0,0, ti_once, [],
      [
        (entry_point_get_position,pos10,10),
        (set_spawn_position,pos10),
        (spawn_horse,"itm_courser")
      ]
     ),
I had placed an entry point in the random forest scene used for battles. Commenting out (spawn_horse,"itm_courser") makes the scene run fine. I had first assumed that it was because the spawn point was being covered underground by the random terrain, so I moved it into the sky, but it still didn't work.
 
You might want to check out Highlander's Native Expanded (I think it is..)

That has hunting in it and the source is released so you can see how he tackled the problem.

I'm note sure how the spawn_horse thing works so can't help you there
 
Ah, yes. Age of Machinery has hunting. I downloaded the source to version 2, since version 4 seems to have several corrupted files.

Very interesting. It seems I was not far off in my speculations about how hunting would be implemented. There is no use of entry points, the position of the prey is calculated from the boundaries of the map.

May I use the hunting source in my own mod (giving the creator his due credit, of course)? I would assume the source would not have been released if not for that purpose.
 
I just posted this in a different thread a few minutes ago, but seeing as the topic is hunting I'd love to see someone mod it even further...

I am relatively new here so pardon me if this has been done already, but seeing that someone has modded in the ability go hunting, could someone adapt this in order to expand the types of missions available from village and keep management?

For example, besides a village elder always sending you off after more cattle or seed grain, how about adding new missions like:
-the village is low on food and asks the Lord to go on a hunt for venison.
-the village farmers and their herds are being attacked by a wild boar, bear or pack of wolves that need to be tracked and hunted down to restore the village's productivity.
-a poacher has been taking game from the Lord's forests and needs to be found and dealt with (ends with a duel in woods or recruiting the poacher into your party, ignoring leads to declining productivity and an eventual bandit uprising - a la Robin Hood).
-to improve his relations with competing lords, the player invites them to a hunting contest on his lands (winning the hunt gets you more renown, but letting your guest win earns you more relationship gain).

That's just a few ideas, the goal is to add more mission types to overseeing your domain, which seem lacking to me.
 
I was also looking to implement game hunting (not for food, but for sport) in my mod.

Sir Henry Curtis,

If you get this working are you willing to share it here?  Would be greatly appriciated to have a starting point... Do the other mods have actual deer?
 
jik, I would have shared anything I discovered, but it seems that Highlander has already done so. Age of Machinery has hunting and the source is included with the download. Some of the files for version 4 seem to be corrupted, so you may have to look through the thread to find an older version. There's more information about the hunting features here.
 
ok found some out...

step1 = module_game_menus.py

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  ("deer_herd",mnf_scale_picture,
  "You encounter a herd of deers.",
  "none",
  [
  (try_begin),
      (gt, "$num_deers_killed",0),
      (troop_clear_inventory, "trp_temp_troop"),
      (troop_add_items, "trp_temp_troop", "itm_deer_meat", "$num_deers_killed"),

      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (ge, "$num_deers_killed", ":num_deers"),
        (remove_party, "$g_encountered_party"),
      (else_try),
        (party_remove_members, "$g_encountered_party", "trp_deer", "$num_deers_killed"),
      (try_end),
      (assign,"$num_deers_killed",0),
          (troop_sort_inventory, "trp_temp_troop"),
  (change_screen_loot,"trp_temp_troop"),
    (try_end),
    (set_background_mesh, "mesh_pic_cattle"),
  ],
    [
      ("deer_kill",
      [
      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (le,":num_deers",0),
(disable_menu_option),
      (try_end),
      ]
      ,"Hunt some of the animals.",
      [
      (set_jump_mission,"mt_deer_hunting"),
      (jump_to_scene,"scn_random_scene_plain_forest"),
      (change_screen_mission),
        ]
      ),
      ("leave",[],"Leave.",
      [(change_screen_return),
        ]
      ),
      ]
  ),
  ("deer_herd_kill_end",0,
  "You shouldn't be reading this.",
  "none",
  [(change_screen_return)],
    [
      ]
  ),
  ("boar_herd",mnf_scale_picture,
  "You encounter a herd of boars.",
  "none",
  [
  (try_begin),
      (gt, "$num_boars_killed",0),
      (troop_clear_inventory, "trp_temp_troop"),
      (troop_add_items, "trp_temp_troop", "itm_boar_meat", "$num_boars_killed"),

      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (ge, "$num_boars_killed", ":num_deers"),
        (remove_party, "$g_encountered_party"),
      (else_try),
        (party_remove_members, "$g_encountered_party", "trp_boar", "$num_boars_killed"),
      (try_end),
      (assign,"$num_boars_killed",0),
          (troop_sort_inventory, "trp_temp_troop"),
  (change_screen_loot,"trp_temp_troop"),
    (try_end),
    (set_background_mesh, "mesh_pic_cattle"),
  ],
    [
      ("boar_kill",[
      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (le,":num_deers",0),
(disable_menu_option),
      (try_end),     
      ],"Hunt some of the animals.",
      [
      (set_jump_mission,"mt_boar_hunting"),
      (jump_to_scene,"scn_random_scene_plain_forest"),
      (change_screen_mission),
        ]
      ),
      ("leave",[],"Leave.",
      [(change_screen_return),
        ]
      ),
      ]
  ),
  ("boar_herd_kill_end",0,
  "You shouldn't be reading this.",
  "none",
  [(change_screen_return)],
    [
      ]
  ),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

...WIP

STEP 2

module_items.py

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
["deer_meat","Deer Meat", [("raw_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 10,weight(30)|abundance(100)|food_quality(40)|max_ammo(30),imodbits_none],
["boar_meat","Boar Meat", [("raw_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 20,weight(30)|abundance(100)|food_quality(80)|max_ammo(50),imodbits_none],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

and this at last position:

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
["deer","Deer", [("deer",0)], itp_unique|itp_type_horse, 0, 1411,abundance(40)|hit_points(40)|body_armor(0)|difficulty(11)|horse_speed(40)|horse_maneuver(32)|horse_charge(20),imodbits_horse_basic],
["boar","Boar", [("boar",0)], itp_unique|itp_type_horse, 0, 1411,abundance(40)|hit_points(100)|body_armor(0)|difficulty(11)|horse_speed(40)|horse_maneuver(20)|horse_charge(100),imodbits_horse_basic],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#


STEP 3

module_mission_template.py

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

  (
    "deer_hunting",mtf_arena_fight,-1,
    "You lead your deers to battle.",
    [
    (1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
    (4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
    ],
    [
      (ti_tab_pressed, 0, 0, [
      (set_trigger_result,1)], []), #leaving area
      (0, 0, ti_once, [ #spawing deers
    (party_count_members_of_type,":num_deers","$g_encountered_party","trp_deer"),
    (val_sub,":num_deers",1),
    (ge,":num_deers",0),
                    (assign,"$num_deers_killed",0),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (set_spawn_position, pos1),
                    (spawn_horse, "itm_deer"),
    (assign,"$leading_deer",reg0),
    (try_for_range,":unused",0,":num_deers"),
                      (init_position, pos1),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos1,":mad:_pos_add"),
      (position_set_y,pos1,":y_pos_add"),
      (position_set_z,pos1,10000),
      (position_set_z_to_ground_level,pos1),
      (set_spawn_position, pos1),
                      (spawn_horse, "itm_deer"),
    (try_end),
                ], []),
      (1,0,0,[], #wounded deers move slower
      [(try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
      (eq,reg(2),"itm_deer"),
      (store_agent_hit_points,reg(2),reg(1)),
      (store_mul,reg(3),20,reg(2)),
      (val_div,reg(3),40),
      (agent_set_speed_limit,reg(1),reg(3)),
      (try_end),
      ]),
      (5,0,0,
      [
      (neg|agent_is_alive,"$leading_deer"),
      ],
      [
      (try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(assign,"$leading_deer",reg(1)),
      (try_end),
      ]),
      (1,0,0,[],
      [
              (assign,":num_kills",0),
      (try_for_agents,reg(1)),
        (agent_get_item_id,reg(2),reg(1)),
        (eq,reg(2),"itm_deer"),
                (store_agent_hit_points,reg(2),reg(1)),
(eq,reg(2),0),
(val_add,":num_kills",1),
      (try_end),   
      (gt,":num_kills","$num_deers_killed"),      
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_deer",pos1),
            (assign,"$num_deers_killed",":num_kills"),
      ]),
      (5,0,0,[],
      [
      (agent_get_position,pos1,"$leading_deer"),
      (position_get_x,":mad:_pos",pos1),
      (position_get_y,":y_pos",pos1),
      (this_or_next|le,":mad:_pos",5000),
      (this_or_next|le,":y_pos",5000),
      (this_or_next|ge,":mad:_pos",38000),
      (ge,":y_pos",38000),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_deer",pos1),
      ]),
      (1,0,0,[],
      [
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(store_agent_hit_points,":health",reg(1)),
(store_sub,":damage",100,":health"),
(agent_get_slot,":prev_damage",reg(1),1),
(neq,":prev_damage",":damage"),
(agent_set_slot,reg(1),1,":damage"),
        (agent_get_position,pos1,reg(1)),
        (position_get_x,":mad:_pos",pos1),
(position_get_y,":y_pos",pos1),
        (store_random_in_range,":mad:_pos_add",0,1000),
        (store_random_in_range,":y_pos_add",0,1000),
(val_add,":mad:_pos",":mad:_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
        (agent_set_scripted_destination,reg(1),pos1),
      (try_end),
      ]),
      (0.5,0,0, #deer travelling
      [],
      [
      (get_player_agent_no,reg(1)),
      (agent_get_position,pos1,reg(1)),
      (agent_get_position,pos4,"$leading_deer"),
      (position_get_x,":mad:_pos",pos4),
      (position_get_y,":y_pos",pos4),
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
        (agent_get_position,pos2,reg(1)),
(get_distance_between_positions,reg(3),pos1,pos2),
(try_begin),
        (position_get_x,":pos_x",pos2),
        (position_get_x,":pos_y",pos2),
    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
(this_or_next|gt,":pos_x",":scene_max_x"),
(this_or_next|lt,":pos_x",":scene_min_x"),
(this_or_next|gt,":pos_y",":scene_max_y"),
(lt,":pos_y",":scene_min_y"),
(store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                (init_position, pos1),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
                (agent_set_scripted_destination,reg(1),pos1),
(else_try),
(le,reg(3),2500),
(position_get_x,reg(4),pos1),
(position_get_x,reg(5),pos2),
(store_sub,":mad:_dist",reg(5),reg(4)),
(val_mul,":mad:_dist",10),
(position_get_y,reg(6),pos1),
(position_get_y,reg(7),pos2),
(store_sub,":y_dist",reg(7),reg(6)),
(val_mul,":y_dist",10),
(init_position,pos3),
(val_add,":mad:_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,":mad:_dist"),
(position_set_y,pos3,":y_dist"),
        (position_set_z,pos3,10000),
        (position_set_z_to_ground_level,pos3),
(agent_set_scripted_destination,reg(1),pos3),
(else_try),
(get_distance_between_positions,reg(3),pos4,pos2),
(ge,reg(3),2000),
                      (init_position, pos6),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos6,":mad:_pos_add"),
      (position_set_y,pos6,":y_pos_add"),
      (position_set_z,pos6,10000),
      (position_set_z_to_ground_level,pos6),
      (agent_set_scripted_destination,reg(1),pos6),
(try_end),
      (try_end),
      ]),
    ]),

   
  (
    "boar_hunting",mtf_arena_fight,-1,
    "You lead your boars to battle.",
    [
    (1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
    (4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
    ],
    [
      (ti_tab_pressed, 0, 0, [ (set_trigger_result,1)], []), #leaving area
      (0, 0, ti_once, [ #spawing boars
    (party_count_members_of_type,":num_boars","$g_encountered_party","trp_boar"),
    (val_sub,":num_boars",1),
    (ge,":num_boars",0),
                    (assign,"$num_boars_killed",0),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (set_spawn_position, pos1),
                    (spawn_horse, "itm_boar"),
    (assign,"$leading_boar",reg0),
    (try_for_range,":unused",0,":num_boars"),
                      (init_position, pos1),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos1,":mad:_pos_add"),
      (position_set_y,pos1,":y_pos_add"),
      (position_set_z,pos1,10000),
      (position_set_z_to_ground_level,pos1),
      (set_spawn_position, pos1),
                      (spawn_horse, "itm_boar"),
    (try_end),
                ], []),
      (1,0,0,[], #wounded boars move slower
      [(try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
      (eq,reg(2),"itm_boar"),
      (store_agent_hit_points,reg(2),reg(1)),
      (store_mul,reg(3),20,reg(2)),
      (val_div,reg(3),100),
      (agent_set_speed_limit,reg(1),reg(3)),
      (try_end),
      ]),
      (5,0,0,
      [
      (neg|agent_is_alive,"$leading_boar"),
      ],
      [
      (try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(assign,"$leading_boar",reg(1)),
      (try_end),
      ]),
      (1,0,0,[],
      [
              (assign,":num_kills",0),
      (try_for_agents,reg(1)),
        (agent_get_item_id,reg(2),reg(1)),
        (eq,reg(2),"itm_boar"),
                (store_agent_hit_points,reg(2),reg(1)),
(eq,reg(2),0),
(val_add,":num_kills",1),
      (try_end),   
      (gt,":num_kills","$num_boars_killed"),      
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_boar",pos1),
            (assign,"$num_boars_killed",":num_kills"),
      ]),
      (5,0,0,[],
      [
      (agent_get_position,pos1,"$leading_boar"),
      (position_get_x,":mad:_pos",pos1),
      (position_get_y,":y_pos",pos1),
      (this_or_next|le,":mad:_pos",5000),
      (this_or_next|le,":y_pos",5000),
      (this_or_next|ge,":mad:_pos",38000),
      (ge,":y_pos",38000),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_boar",pos1),
      ]),
      (1,0,0,[],
      [
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(store_agent_hit_points,":health",reg(1)),
(store_sub,":damage",100,":health"),
(agent_get_slot,":prev_damage",reg(1),1),
(neq,":prev_damage",":damage"),
(agent_set_slot,reg(1),1,":damage"),
        (agent_get_position,pos1,reg(1)),
        (position_get_x,":mad:_pos",pos1),
(position_get_y,":y_pos",pos1),
        (store_random_in_range,":mad:_pos_add",0,1000),
        (store_random_in_range,":y_pos_add",0,1000),
(val_add,":mad:_pos",":mad:_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
        (agent_set_scripted_destination,reg(1),pos1),
      (try_end),
      ]),
      (0.5,0,0, #boar travelling
      [],
      [
      (get_player_agent_no,reg(1)),
      (agent_get_position,pos1,reg(1)),
      (agent_get_position,pos4,"$leading_boar"),
      (position_get_x,":mad:_pos",pos4),
      (position_get_y,":y_pos",pos4),
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
        (agent_get_position,pos2,reg(1)),
(get_distance_between_positions,reg(3),pos1,pos2),
(try_begin),
        (position_get_x,":pos_x",pos2),
        (position_get_x,":pos_y",pos2),
    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
(this_or_next|gt,":pos_x",":scene_max_x"),
(this_or_next|lt,":pos_x",":scene_min_x"),
(this_or_next|gt,":pos_y",":scene_max_y"),
(lt,":pos_y",":scene_min_y"),
(store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                (init_position, pos1),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
                (agent_set_scripted_destination,reg(1),pos1),
(else_try),
(le,reg(3),2500),
(position_get_x,reg(4),pos1),
(position_get_x,reg(5),pos2),
(store_sub,":mad:_dist",reg(5),reg(4)),
(val_mul,":mad:_dist",10),
(position_get_y,reg(6),pos1),
(position_get_y,reg(7),pos2),
(store_sub,":y_dist",reg(7),reg(6)),
(val_mul,":y_dist",10),
(init_position,pos3),
(val_add,":mad:_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,":mad:_dist"),
(position_set_y,pos3,":y_dist"),
        (position_set_z,pos3,10000),
        (position_set_z_to_ground_level,pos3),
(agent_set_scripted_destination,reg(1),pos3),
(else_try),
(get_distance_between_positions,reg(3),pos4,pos2),
(ge,reg(3),2000),
                      (init_position, pos6),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos6,":mad:_pos_add"),
      (position_set_y,pos6,":y_pos_add"),
      (position_set_z,pos6,10000),
      (position_set_z_to_ground_level,pos6),
      (agent_set_scripted_destination,reg(1),pos6),
(try_end),
      (try_end),
      ]),
    ]),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

]
(at the last position)


STEP 4 - module_party_templates.py

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

  ("deer_herd","Deer Herd",icon_cattle|carries_goods(10),0,fac_wild_animals,merchant_personality,[(trp_deer,8,15)]),
  ("boar_herd","Boar Herd",icon_cattle|carries_goods(10),0,fac_wild_animals,merchant_personality,[(trp_boar,2,4)]),
#  ("village_hunters","Village Hunters",icon_peasant,0,fac_innocents,soldier_personality,[(trp_hunter,8,16)]),

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

STEP 5 - module_scripts.py

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
      (item_set_slot, "itm_deer_meat", slot_item_food_bonus, 2),
      (item_set_slot, "itm_deer_meat", slot_item_food_bonus, 5),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

than search for: " #script_spawn_bandits"
you have to put this bracket there, also like this:

  #script_spawn_bandits
  # INPUT: none
  # OUTPUT: none
  ("spawn_bandits",
    [(set_spawn_radius,1),
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_mountain_bandits"),
      (lt,":num_parties",14),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_mountain_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_mountain_bandits"),
    (try_end),
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_forest_bandits"),
      (lt,":num_parties",14),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_forest_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_forest_bandits"),
    (try_end),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_deer_herd"),
      (lt,":num_parties",5),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_forest_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_deer_herd"),
    (try_end),
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_boar_herd"),
      (lt,":num_parties",2),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_forest_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_boar_herd"),
    (try_end),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_sea_raiders"),
      (lt,":num_parties",14),
      (store_random,":spawn_point",num_sea_raider_spawn_points),
      (val_add,":spawn_point","p_sea_raider_spawn_point_1"),
      (spawn_around_party,":spawn_point","pt_sea_raiders"),
    (try_end),
................
...........
.......


STEP 6 - module_troops.py

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  ["deer","Deer","Deer",0,no_scene,reserved,fac_neutral, [], def_attrib|level(0),wp(60),0,swadian_face_younger_1, swadian_face_younger_1],
  ["boar","Boar","Boar",0,no_scene,reserved,fac_neutral, [], def_attrib|level(0),wp(60),0,swadian_face_younger_1, swadian_face_younger_1],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
]
(at the last place if the collumn...)

next... module_factions.py

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  ("wild_animals","Wild Animals",0, 0.1,[("player_faction",-0.15)], [],0xFFFFFF),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#



so last STEP is... - in modul.ini you have to change "scan_module_textures = 1"
so you need these 2 files: "boar.dds" + "deer.dds"

READY!



 
 
timedanze said:
ok found some out...

step1 = module_game_menus.py



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  ("deer_herd",mnf_scale_picture,
  "You encounter a herd of deers.",
  "none",
  [
  (try_begin),
      (gt, "$num_deers_killed",0),
      (troop_clear_inventory, "trp_temp_troop"),
      (troop_add_items, "trp_temp_troop", "itm_deer_meat", "$num_deers_killed"),

      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (ge, "$num_deers_killed", ":num_deers"),
        (remove_party, "$g_encountered_party"),
      (else_try),
        (party_remove_members, "$g_encountered_party", "trp_deer", "$num_deers_killed"),
      (try_end),
      (assign,"$num_deers_killed",0),
          (troop_sort_inventory, "trp_temp_troop"),
  (change_screen_loot,"trp_temp_troop"),
    (try_end),
    (set_background_mesh, "mesh_pic_cattle"),
  ],
    [
      ("deer_kill",
      [
      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (le,":num_deers",0),
(disable_menu_option),
      (try_end),
      ]
      ,"Hunt some of the animals.",
      [
      (set_jump_mission,"mt_deer_hunting"),
      (jump_to_scene,"scn_random_scene_plain_forest"),
      (change_screen_mission),
        ]
      ),
      ("leave",[],"Leave.",
      [(change_screen_return),
        ]
      ),
      ]
  ),
  ("deer_herd_kill_end",0,
  "You shouldn't be reading this.",
  "none",
  [(change_screen_return)],
    [
      ]
  ),
  ("boar_herd",mnf_scale_picture,
  "You encounter a herd of boars.",
  "none",
  [
  (try_begin),
      (gt, "$num_boars_killed",0),
      (troop_clear_inventory, "trp_temp_troop"),
      (troop_add_items, "trp_temp_troop", "itm_boar_meat", "$num_boars_killed"),

      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (ge, "$num_boars_killed", ":num_deers"),
        (remove_party, "$g_encountered_party"),
      (else_try),
        (party_remove_members, "$g_encountered_party", "trp_boar", "$num_boars_killed"),
      (try_end),
      (assign,"$num_boars_killed",0),
          (troop_sort_inventory, "trp_temp_troop"),
  (change_screen_loot,"trp_temp_troop"),
    (try_end),
    (set_background_mesh, "mesh_pic_cattle"),
  ],
    [
      ("boar_kill",[
      (party_get_num_companions, ":num_deers", "$g_encountered_party"),
      (try_begin),
        (le,":num_deers",0),
(disable_menu_option),
      (try_end),     
      ],"Hunt some of the animals.",
      [
      (set_jump_mission,"mt_boar_hunting"),
      (jump_to_scene,"scn_random_scene_plain_forest"),
      (change_screen_mission),
        ]
      ),
      ("leave",[],"Leave.",
      [(change_screen_return),
        ]
      ),
      ]
  ),
  ("boar_herd_kill_end",0,
  "You shouldn't be reading this.",
  "none",
  [(change_screen_return)],
    [
      ]
  ),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#



...WIP

STEP 2

module_items.py



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
["deer_meat","Deer Meat", [("raw_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 10,weight(30)|abundance(100)|food_quality(40)|max_ammo(30),imodbits_none],
["boar_meat","Boar Meat", [("raw_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 20,weight(30)|abundance(100)|food_quality(80)|max_ammo(50),imodbits_none],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

and this at last position:



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
["deer","Deer", [("deer",0)], itp_unique|itp_type_horse, 0, 1411,abundance(40)|hit_points(40)|body_armor(0)|difficulty(11)|horse_speed(40)|horse_maneuver(32)|horse_charge(20),imodbits_horse_basic],
["boar","Boar", [("boar",0)], itp_unique|itp_type_horse, 0, 1411,abundance(40)|hit_points(100)|body_armor(0)|difficulty(11)|horse_speed(40)|horse_maneuver(20)|horse_charge(100),imodbits_horse_basic],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#




STEP 3

module_mission_template.py



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

  (
    "deer_hunting",mtf_arena_fight,-1,
    "You lead your deers to battle.",
    [
    (1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
    (4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
    ],
    [
      (ti_tab_pressed, 0, 0, [
      (set_trigger_result,1)], []), #leaving area
      (0, 0, ti_once, [ #spawing deers
    (party_count_members_of_type,":num_deers","$g_encountered_party","trp_deer"),
    (val_sub,":num_deers",1),
    (ge,":num_deers",0),
                    (assign,"$num_deers_killed",0),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (set_spawn_position, pos1),
                    (spawn_horse, "itm_deer"),
    (assign,"$leading_deer",reg0),
    (try_for_range,":unused",0,":num_deers"),
                      (init_position, pos1),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos1,":mad:_pos_add"),
      (position_set_y,pos1,":y_pos_add"),
      (position_set_z,pos1,10000),
      (position_set_z_to_ground_level,pos1),
      (set_spawn_position, pos1),
                      (spawn_horse, "itm_deer"),
    (try_end),
                ], []),
      (1,0,0,[], #wounded deers move slower
      [(try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
      (eq,reg(2),"itm_deer"),
      (store_agent_hit_points,reg(2),reg(1)),
      (store_mul,reg(3),20,reg(2)),
      (val_div,reg(3),40),
      (agent_set_speed_limit,reg(1),reg(3)),
      (try_end),
      ]),
      (5,0,0,
      [
      (neg|agent_is_alive,"$leading_deer"),
      ],
      [
      (try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(assign,"$leading_deer",reg(1)),
      (try_end),
      ]),
      (1,0,0,[],
      [
              (assign,":num_kills",0),
      (try_for_agents,reg(1)),
        (agent_get_item_id,reg(2),reg(1)),
        (eq,reg(2),"itm_deer"),
                (store_agent_hit_points,reg(2),reg(1)),
(eq,reg(2),0),
(val_add,":num_kills",1),
      (try_end),   
      (gt,":num_kills","$num_deers_killed"),      
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_deer",pos1),
            (assign,"$num_deers_killed",":num_kills"),
      ]),
      (5,0,0,[],
      [
      (agent_get_position,pos1,"$leading_deer"),
      (position_get_x,":mad:_pos",pos1),
      (position_get_y,":y_pos",pos1),
      (this_or_next|le,":mad:_pos",5000),
      (this_or_next|le,":y_pos",5000),
      (this_or_next|ge,":mad:_pos",38000),
      (ge,":y_pos",38000),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_deer",pos1),
      ]),
      (1,0,0,[],
      [
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
(store_agent_hit_points,":health",reg(1)),
(store_sub,":damage",100,":health"),
(agent_get_slot,":prev_damage",reg(1),1),
(neq,":prev_damage",":damage"),
(agent_set_slot,reg(1),1,":damage"),
        (agent_get_position,pos1,reg(1)),
        (position_get_x,":mad:_pos",pos1),
(position_get_y,":y_pos",pos1),
        (store_random_in_range,":mad:_pos_add",0,1000),
        (store_random_in_range,":y_pos_add",0,1000),
(val_add,":mad:_pos",":mad:_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
        (agent_set_scripted_destination,reg(1),pos1),
      (try_end),
      ]),
      (0.5,0,0, #deer travelling
      [],
      [
      (get_player_agent_no,reg(1)),
      (agent_get_position,pos1,reg(1)),
      (agent_get_position,pos4,"$leading_deer"),
      (position_get_x,":mad:_pos",pos4),
      (position_get_y,":y_pos",pos4),
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_deer"),
        (agent_get_position,pos2,reg(1)),
(get_distance_between_positions,reg(3),pos1,pos2),
(try_begin),
        (position_get_x,":pos_x",pos2),
        (position_get_x,":pos_y",pos2),
    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
(this_or_next|gt,":pos_x",":scene_max_x"),
(this_or_next|lt,":pos_x",":scene_min_x"),
(this_or_next|gt,":pos_y",":scene_max_y"),
(lt,":pos_y",":scene_min_y"),
(store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                (init_position, pos1),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
                (agent_set_scripted_destination,reg(1),pos1),
(else_try),
(le,reg(3),2500),
(position_get_x,reg(4),pos1),
(position_get_x,reg(5),pos2),
(store_sub,":mad:_dist",reg(5),reg(4)),
(val_mul,":mad:_dist",10),
(position_get_y,reg(6),pos1),
(position_get_y,reg(7),pos2),
(store_sub,":y_dist",reg(7),reg(6)),
(val_mul,":y_dist",10),
(init_position,pos3),
(val_add,":mad:_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,":mad:_dist"),
(position_set_y,pos3,":y_dist"),
        (position_set_z,pos3,10000),
        (position_set_z_to_ground_level,pos3),
(agent_set_scripted_destination,reg(1),pos3),
(else_try),
(get_distance_between_positions,reg(3),pos4,pos2),
(ge,reg(3),2000),
                      (init_position, pos6),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos6,":mad:_pos_add"),
      (position_set_y,pos6,":y_pos_add"),
      (position_set_z,pos6,10000),
      (position_set_z_to_ground_level,pos6),
      (agent_set_scripted_destination,reg(1),pos6),
(try_end),
      (try_end),
      ]),
    ]),

   
  (
    "boar_hunting",mtf_arena_fight,-1,
    "You lead your boars to battle.",
    [
    (1,mtef_team_0|mtef_leader_only,0,aif_start_alarmed,12,[]),
    (4,mtef_visitor_source,0,aif_start_alarmed,0,[]),
    ],
    [
      (ti_tab_pressed, 0, 0, [ (set_trigger_result,1)], []), #leaving area
      (0, 0, ti_once, [ #spawing boars
    (party_count_members_of_type,":num_boars","$g_encountered_party","trp_boar"),
    (val_sub,":num_boars",1),
    (ge,":num_boars",0),
                    (assign,"$num_boars_killed",0),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (set_spawn_position, pos1),
                    (spawn_horse, "itm_boar"),
    (assign,"$leading_boar",reg0),
    (try_for_range,":unused",0,":num_boars"),
                      (init_position, pos1),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos1,":mad:_pos_add"),
      (position_set_y,pos1,":y_pos_add"),
      (position_set_z,pos1,10000),
      (position_set_z_to_ground_level,pos1),
      (set_spawn_position, pos1),
                      (spawn_horse, "itm_boar"),
    (try_end),
                ], []),
      (1,0,0,[], #wounded boars move slower
      [(try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
      (eq,reg(2),"itm_boar"),
      (store_agent_hit_points,reg(2),reg(1)),
      (store_mul,reg(3),20,reg(2)),
      (val_div,reg(3),100),
      (agent_set_speed_limit,reg(1),reg(3)),
      (try_end),
      ]),
      (5,0,0,
      [
      (neg|agent_is_alive,"$leading_boar"),
      ],
      [
      (try_for_agents,reg(1)),
      (agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(assign,"$leading_boar",reg(1)),
      (try_end),
      ]),
      (1,0,0,[],
      [
              (assign,":num_kills",0),
      (try_for_agents,reg(1)),
        (agent_get_item_id,reg(2),reg(1)),
        (eq,reg(2),"itm_boar"),
                (store_agent_hit_points,reg(2),reg(1)),
(eq,reg(2),0),
(val_add,":num_kills",1),
      (try_end),   
      (gt,":num_kills","$num_boars_killed"),      
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_boar",pos1),
            (assign,"$num_boars_killed",":num_kills"),
      ]),
      (5,0,0,[],
      [
      (agent_get_position,pos1,"$leading_boar"),
      (position_get_x,":mad:_pos",pos1),
      (position_get_y,":y_pos",pos1),
      (this_or_next|le,":mad:_pos",5000),
      (this_or_next|le,":y_pos",5000),
      (this_or_next|ge,":mad:_pos",38000),
      (ge,":y_pos",38000),
                    (get_scene_boundaries, pos10,pos11),
                    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
    (store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
    (store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                    (init_position, pos1),
    (position_set_x,pos1,":mad:_pos"),
    (position_set_y,pos1,":y_pos"),
    (position_set_z,pos1,10000),
    (position_set_z_to_ground_level,pos1),
                    (agent_set_scripted_destination,"$leading_boar",pos1),
      ]),
      (1,0,0,[],
      [
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
(store_agent_hit_points,":health",reg(1)),
(store_sub,":damage",100,":health"),
(agent_get_slot,":prev_damage",reg(1),1),
(neq,":prev_damage",":damage"),
(agent_set_slot,reg(1),1,":damage"),
        (agent_get_position,pos1,reg(1)),
        (position_get_x,":mad:_pos",pos1),
(position_get_y,":y_pos",pos1),
        (store_random_in_range,":mad:_pos_add",0,1000),
        (store_random_in_range,":y_pos_add",0,1000),
(val_add,":mad:_pos",":mad:_pos_add"),
(val_add,":y_pos",":y_pos_add"),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
        (agent_set_scripted_destination,reg(1),pos1),
      (try_end),
      ]),
      (0.5,0,0, #boar travelling
      [],
      [
      (get_player_agent_no,reg(1)),
      (agent_get_position,pos1,reg(1)),
      (agent_get_position,pos4,"$leading_boar"),
      (position_get_x,":mad:_pos",pos4),
      (position_get_y,":y_pos",pos4),
      (try_for_agents,reg(1)),
(agent_get_item_id,reg(2),reg(1)),
(eq,reg(2),"itm_boar"),
        (agent_get_position,pos2,reg(1)),
(get_distance_between_positions,reg(3),pos1,pos2),
(try_begin),
        (position_get_x,":pos_x",pos2),
        (position_get_x,":pos_y",pos2),
    (position_get_x, ":scene_min_x", pos10),
                    (position_get_x, ":scene_max_x", pos11),
                    (position_get_y, ":scene_min_y", pos10),
                    (position_get_y, ":scene_max_y", pos11),
    (store_div,":border_x",":scene_max_x",10),
    (val_add,":scene_min_x",":border_x"),
    (val_sub,":scene_max_x",":border_x"),
    (store_div,":border_y",":scene_max_y",10),
    (val_add,":scene_min_y",":border_y"),
    (val_sub,":scene_max_y",":border_y"),
(this_or_next|gt,":pos_x",":scene_max_x"),
(this_or_next|lt,":pos_x",":scene_min_x"),
(this_or_next|gt,":pos_y",":scene_max_y"),
(lt,":pos_y",":scene_min_y"),
(store_random_in_range,":mad:_pos",":scene_min_x",":scene_max_x"),
(store_random_in_range,":y_pos",":scene_min_y",":scene_max_y"),
                (init_position, pos1),
(position_set_x,pos1,":mad:_pos"),
(position_set_y,pos1,":y_pos"),
(position_set_z,pos1,10000),
(position_set_z_to_ground_level,pos1),
                (agent_set_scripted_destination,reg(1),pos1),
(else_try),
(le,reg(3),2500),
(position_get_x,reg(4),pos1),
(position_get_x,reg(5),pos2),
(store_sub,":mad:_dist",reg(5),reg(4)),
(val_mul,":mad:_dist",10),
(position_get_y,reg(6),pos1),
(position_get_y,reg(7),pos2),
(store_sub,":y_dist",reg(7),reg(6)),
(val_mul,":y_dist",10),
(init_position,pos3),
(val_add,":mad:_dist",reg(5)),
(val_add,":y_dist",reg(7)),
(position_set_x,pos3,":mad:_dist"),
(position_set_y,pos3,":y_dist"),
        (position_set_z,pos3,10000),
        (position_set_z_to_ground_level,pos3),
(agent_set_scripted_destination,reg(1),pos3),
(else_try),
(get_distance_between_positions,reg(3),pos4,pos2),
(ge,reg(3),2000),
                      (init_position, pos6),
      (store_random_in_range,":mad:_pos_add",0,1000),
      (store_random_in_range,":y_pos_add",0,1000),
      (val_add,":mad:_pos_add",":mad:_pos"),
      (val_add,":y_pos_add",":y_pos"),
      (position_set_x,pos6,":mad:_pos_add"),
      (position_set_y,pos6,":y_pos_add"),
      (position_set_z,pos6,10000),
      (position_set_z_to_ground_level,pos6),
      (agent_set_scripted_destination,reg(1),pos6),
(try_end),
      (try_end),
      ]),
    ]),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

]


(at the last position)


STEP 4 - module_party_templates.py



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

  ("deer_herd","Deer Herd",icon_cattle|carries_goods(10),0,fac_wild_animals,merchant_personality,[(trp_deer,8,15)]),
  ("boar_herd","Boar Herd",icon_cattle|carries_goods(10),0,fac_wild_animals,merchant_personality,[(trp_boar,2,4)]),
#  ("village_hunters","Village Hunters",icon_peasant,0,fac_innocents,soldier_personality,[(trp_hunter,8,16)]),

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#



STEP 5 - module_scripts.py



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
      (item_set_slot, "itm_deer_meat", slot_item_food_bonus, 2),
      (item_set_slot, "itm_deer_meat", slot_item_food_bonus, 5),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#


than search for: " #script_spawn_bandits"
you have to put this bracket there, also like this:



  #script_spawn_bandits
  # INPUT: none
  # OUTPUT: none
  ("spawn_bandits",
    [(set_spawn_radius,1),
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_mountain_bandits"),
      (lt,":num_parties",14),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_mountain_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_mountain_bandits"),
    (try_end),
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_forest_bandits"),
      (lt,":num_parties",14),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_forest_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_forest_bandits"),
    (try_end),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_deer_herd"),
      (lt,":num_parties",5),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_forest_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_deer_herd"),
    (try_end),
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_boar_herd"),
      (lt,":num_parties",2),
      (store_random,":spawn_point",num_mountain_bandit_spawn_points),
      (val_add,":spawn_point","p_forest_bandit_spawn_point"),
      (spawn_around_party,":spawn_point","pt_boar_herd"),
    (try_end),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    (try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_sea_raiders"),
      (lt,":num_parties",14),
      (store_random,":spawn_point",num_sea_raider_spawn_points),
      (val_add,":spawn_point","p_sea_raider_spawn_point_1"),
      (spawn_around_party,":spawn_point","pt_sea_raiders"),
    (try_end),
................
...........
.......



STEP 6 - module_troops.py



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  ["deer","Deer","Deer",0,no_scene,reserved,fac_neutral, [], def_attrib|level(0),wp(60),0,swadian_face_younger_1, swadian_face_younger_1],
  ["boar","Boar","Boar",0,no_scene,reserved,fac_neutral, [], def_attrib|level(0),wp(60),0,swadian_face_younger_1, swadian_face_younger_1],
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
]

(at the last place if the collumn...)

next... module_factions.py



#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod begin#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  ("wild_animals","Wild Animals",0, 0.1,[("player_faction",-0.15)], [],0xFFFFFF),
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#Hunting Mod end#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#





so last STEP is... - in modul.ini you have to change "scan_module_textures = 1"
so you need these 2 files: "boar.dds" + "deer.dds"

READY!

so i followed everything in the spoiler and what was in the final post, however some how i messed something up and not sure how to correct

could someone give me advice?

this was my results, instead of animals i got naked looters
mb7h.jpg

mb8o.jpg

mb9pq.jpg

mb11jr.jpg
 
I'm not familiar with hunting script. Anyway, here is one thing you can try: in module_script, search for script "game_event_party_encounter". Scroll down near the end. It will look like:
(else_try),
          (eq, "$g_encountered_party", "p_camp_bandits"),         
          (jump_to_menu, "mnu_camp"),
        (else_try),
          (jump_to_menu, "mnu_simple_encounter"),
        (try_end),
      (else_try), #Battle or siege
Try to add a couple else_try for deer_herd and boar_herd. Those two then should jump to menu "mnu_deer_herd" and mnu_boar_herd". You can copy the code for encounter lair a little bit up and try to match with the deer_herd and boar_herd template IDs. For example:
(else_try), 
  (party_get_template_id, ":template", "$g_encountered_party"),
  (eq, ":template", "pt_deer_herd"),
  (assign, "$loot_screen_shown", 0),
  (jump_to_menu, "mnu_deer_herd"),
 
once again Phoenix you have helped me greatly

that is what i was missing when i was looking at other sources
 
Back
Top Bottom