Roots of Yggdrassil version 0.25 RELEASED

Users who are viewing this thread

Status
Not open for further replies.
Patch: (Requires version 0.2)
https://www.mbrepository.com/file.php?cid=1&id=1292
Full download:
https://www.mbrepository.com/file.php?cid=7&id=1167


Okay, only one week after the last release and I've got another one. If you already have version 0.2 installed, you can just get the patch and copy all the included files over the ones in your Roots of Yggdrassil folder.

At day 200, a full-scale Rus faction (with 30 "Lord" type characters and a King) will appear near Heithr Clan territory. The codes are courtesy of vonmistont from his mod, Sword of Damocles.

Also, you can now set up your own custom battles, by choosing the "Quick Battle" option on the main menu.

This version shouldn't break savegames, but I don't think the Rus Invasion will start on an old save.


When it's done uploading, the full version of 0.25 does include RoY's source codes, in case you want to make your own little modification of my mod. However, be sure you credit all the people I have if you do release your own spinoff, but you don't need any permission from me. I will gladly give you your own space in this board to have your own thread or two, and if I see fit, perhaps you can acquire a Moderator position.

If you're stealing some of the codes, however, for use in your own completely seperate mods, I would ask that you send me a PM so I can tell you who to ask permission to use them. If they're mine... Well, I don't think they will be.
 
Ruthwen, I have a question. How to drive my ship in the course of sea battle? I really don't know that.  :???:
 
So, how  can I fight with enemy at sea when both ships are quite distant?  :razz:

Varric, so steer my ships if it will please you.  :wink:
 
I tried it somehow but it lasted endlessly long. What about put these ships more closely each other or implement some steering through dirrectional arrows.  :???:
 
It's not really a ship :razz:.
I was thinking if you could add mini steps on the interior sides of the boats and instead of crashing into each other they line up beside each other and then they can kinda board the other boat.
 
Varric said:
It's not really a ship :razz:.
I was thinking if you could add mini steps on the interior sides of the boats and instead of crashing into each other they line up beside each other and then they can kinda board the other boat.
I'm too inexperienced to fiddle around with the maneuvering of the ship. Also, there are two parts of the collision mesh "missing", so AI should board the other ship most of the time.


And since people keep asking me to change stuff about the ships moving, tell me which part of this looks simple to you:

Code:
################################################################

#                          SEA BATTLES BEGIN

################################################################
 


     ("cf_close_and_board",
      [(assign,":boardedd",0),
       (prop_instance_get_position,1,"$ship"),
       (prop_instance_get_position,2,"$eship"),
       (get_distance_between_positions,":dist",1,2),
       (assign,":firstship","$ship"),
       (assign,":secship","$eship"),
       (copy_position,3,1),
       (copy_position,4,2),
       (position_move_y,3,-1600),
       (position_move_y,4,-1600),
                       (try_for_range,reg5,0,16),
                         (try_for_range,reg10,0,16),
                           (get_distance_between_positions,":distance",3,4),
                              (try_begin),
                                 (lt,":distance",400),
                                 (prop_instance_get_position,5,":firstship"),
                                 (prop_instance_animate_to_position,":firstship",5,1),
                                 (prop_instance_get_position,6,":secship"),
                                 (prop_instance_animate_to_position,":secship",6,1),
                                 (party_set_slot,"p_ship_colisions",":firstship",1),
                                 (party_set_slot,"p_ship_colisions",":secship",1),
                                 (assign,":boardedd",1),
                               (end_try),
                             (position_move_y,4,200),
                           (end_try),
                         (position_move_y,3,200),
                         (copy_position,4,2),
                         (position_move_y,4,-1600),
                       (end_try),
       (eq,":boardedd",0),
       (try_begin),
          (position_is_behind_position,2,1),
             (try_begin),
                (position_move_x,1,100),
                (get_distance_between_positions,":distance",1,2),
                (position_move_x,1,-100),
                (lt,":distance",":dist"),
                (assign,":angle",10),
             (else_try),
                (assign,":angle",-10),
             (end_try),
          (position_rotate_z,1,":angle"),
          (prop_instance_animate_to_position,"$ship",1,400),
       (else_try),
          (position_is_behind_position,1,2),
             (try_begin),
                (position_move_x,1,100),
                (get_distance_between_positions,":distance",1,2),
                (position_move_x,1,-100),
                (lt,":distance",":dist"),
                (position_move_x,0.5,-250),
             (else_try),
                (position_move_x,0.5,250),
             (end_try),
          (prop_instance_animate_to_position,"$ship",2,":dist"),
       (else_try),
          (try_begin),
             (position_move_x,1,100),
             (get_distance_between_positions,":distance",1,2),
             (position_move_x,1,-100),
             (lt,":distance",":dist"),
             (position_move_x,0.5,250),
          (else_try),
             (position_move_x,0.5,-250),
          (end_try),
          (position_rotate_z,2,180),
          (prop_instance_animate_to_position,"$ship",2,":dist"),
       (end_try),]),

     ("skirmish",
      [(prop_instance_get_position,1,"$ship"),
       (prop_instance_get_position,2,"$eship"),
       (get_distance_between_positions,":dist",1,2),
       (try_begin),
          (gt,":dist",7500),
          (try_begin),
             (position_is_behind_position,2,1),
             (position_move_y,1,400),
             (try_begin),
                (position_move_x,0.5,100),
                (get_distance_between_positions,":distance",1,2),
                (position_move_x,1,-100),
                (lt,":distance",":dist"),
                (assign,":angle",-10),
             (else_try),
                (assign,":angle",10),
             (end_try),
             (position_rotate_z,1,":angle"),
             (prop_instance_animate_to_position,"$ship",1,400),
          (else_try),
             (position_move_y,1,400),
             (prop_instance_animate_to_position,"$ship",1,400),
          (end_try),
       (else_try),
          (try_begin),
             (position_is_behind_position,2,1),
             (position_move_y,1,400),
             (prop_instance_animate_to_position,"$ship",1,400),
          (else_try),
             (position_move_y,1,400),
             (try_begin),
                (position_move_x,1,100),
                (get_distance_between_positions,":distance",1,2),
                (position_move_x,1,-100),
                (lt,":distance",":dist"),
                (assign,":angle",10),
             (else_try),
                (assign,":angle",-10),
             (end_try),
             (position_rotate_z,1,":angle"),
             (prop_instance_animate_to_position,"$ship",1,400),
          (end_try),
       (end_try),]),

      ("select_enemy_ship",
       [(prop_instance_get_position,1,"$ship"),
        (assign,":dist",999999999),
           (scene_prop_get_num_instances,reg50,"spr_enemy_ship"),
           (val_add,reg50,1),
           (try_for_range,":instance",0,reg50),
              (scene_prop_get_instance,":thechosenship", "spr_enemy_ship", ":instance"),
              (prop_instance_get_position,2,":thechosenship"),
              (get_distance_between_positions,":distance",1,2),
              (lt,":distance",":dist"),
              (assign,":dist",":distance"),
              (assign,"$eship",":thechosenship"),
            (end_try),]),

      ("select_friendly_ship",
       [(prop_instance_get_position,1,"$ship"),
        (assign,":dist",999999999),
           (scene_prop_get_num_instances,reg50,"spr_ship"),
           (val_add,reg50,1),
           (try_for_range,":instance",0,reg50),
              (scene_prop_get_instance,":thechosenship", "spr_ship", ":instance"),              
              (prop_instance_get_position,2,":thechosenship"),
              (get_distance_between_positions,":distance",1,2),
              (lt,":distance",":dist"),
              (assign,":dist",":distance"),
              (assign,"$eship",":thechosenship"),
            (end_try),]),

      ("check_for_collisions",
       [(try_for_range,":shiptype","spr_ship","spr_enemy_ships_end"),
           (scene_prop_get_num_instances,":number",":shiptype"),
           (try_for_range,":firstshipno",0,":number"),
               (scene_prop_get_instance,":firstship", ":shiptype", ":firstshipno"),
               (prop_instance_get_position,1,":firstship"),
               (try_for_range,":shiptypetwo","spr_ship","spr_enemy_ships_end"),
                    (scene_prop_get_num_instances,":numbertwo",":shiptypetwo"),
                    (try_for_range,":secshipno",-1,":numbertwo"),
                       (scene_prop_get_instance,":secship", ":shiptypetwo", ":secshipno"),
                       (neq,":firstship",":secship"),
                       (prop_instance_get_position,2,":secship"),
                       (copy_position,3,1),
                       (copy_position,4,2),
                       (position_move_y,3,-1600),
                       (position_move_y,4,-1600),
                       (try_for_range,reg5,0,16),
                         (try_for_range,reg10,0,16),
                           (get_distance_between_positions,":distance",3,4),
                              (try_begin),
                                 (lt,":distance",325),
                                 (prop_instance_get_position,5,":firstship"),
                                 (prop_instance_animate_to_position,":firstship",5,1),
                                 (prop_instance_get_position,6,":secship"),
                                 (prop_instance_animate_to_position,":secship",6,1),
                                 (party_set_slot,"p_ship_colisions",":firstship",1),
                                 (party_set_slot,"p_ship_colisions",":secship",1),
                               (end_try),
                             (position_move_y,4,200),
                           (end_try),
                         (position_move_y,3,200),
                         (copy_position,4,2),
                         (position_move_y,4,-1600),
                       (end_try),
                    (end_try),
                 (end_try),
             (end_try),
            (end_try),]),


  ("calculate_battle_morale",
    [(try_for_agents,":agent"),
        (agent_get_slot,":routed",":agent",3),
        (neq,":routed",1),
        (agent_is_alive,":agent"),
        (agent_is_human,":agent"),
        (agent_get_slot,":morale",":agent",1),
        (val_mul,":morale",10),
        (agent_get_slot,":pmorale",":agent",2),
        (val_add,":morale",":pmorale"),
        (store_agent_hit_points,":health",":agent",0),
        (val_sub,":health",5),
        (val_mul,":health",10),
        (val_add,":morale",":health"),
        (agent_get_troop_id,":troop", ":agent"),
        (store_character_level,":level",":troop"),
        (val_mul,":level",10),
        (val_add,":morale",":level"),
        (try_begin),
           (agent_is_ally,":agent"),
           (agent_get_position,1,":agent"),
           (try_for_agents,":friend"),
             (agent_is_ally,":friend"),
             (agent_is_human,":friend"),
             (agent_get_position,2,":friend"),
             (get_distance_between_positions,":dist",1,2),
             (val_add,":dist",100),
             (val_div,":dist",100),
             (lt,":dist",75),
             (try_begin),
                (agent_is_alive,":friend"),
                (assign,":effect",30),
                (val_div,":effect",":dist"),
                (val_add,":morale",":effect"),
             (else_try),
                (assign,":effect",50),
                (val_div,":effect",":dist"),
                (val_sub,":morale",":dist"),
             (end_try),
           (end_try),
           (try_for_agents,":enemy"),
             (neg|agent_is_ally,":enemy"),
             (agent_is_human,":enemy"),
             (agent_get_position,2,":enemy"),
             (get_distance_between_positions,":dist",1,2),
             (val_add,":dist",100),
             (val_div,":dist",100),
             (lt,":dist",75),
             (try_begin),
                (agent_is_alive,":enemy"),
                (assign,":effect",10),
                (val_div,":effect",":dist"),
                (val_sub,":morale",":effect"),
             (end_try),
           (end_try),
        (else_try),
           (agent_get_position,1,":agent"),
           (try_for_agents,":friend"),
             (neg|agent_is_ally,":friend"),
             (agent_is_human,":friend"),
             (agent_get_position,2,":friend"),
             (get_distance_between_positions,":dist",1,2),
             (val_add,":dist",100),
             (val_div,":dist",100),
             (lt,":dist",75),
             (try_begin),
                (agent_is_alive,":friend"),
                (assign,":effect",30),
                (val_div,":effect",":dist"),
                (val_add,":morale",":effect"),
             (else_try),
                (assign,":effect",50),
                (val_div,":effect",":dist"),
                (val_sub,":morale",":dist"),
             (end_try),
           (end_try),
           (try_for_agents,":enemy"),
             (agent_is_ally,":enemy"),
             (agent_is_human,":enemy"),
             (agent_get_position,2,":enemy"),
             (get_distance_between_positions,":dist",1,2),
             (val_add,":dist",100),
             (val_div,":dist",100),
             (lt,":dist",75),
             (try_begin),
                (agent_is_alive,":enemy"),
                (assign,":effect",10),
                (val_div,":effect",":dist"),
                (val_sub,":morale",":effect"),
             (end_try),
           (end_try),
        (end_try),
        (agent_set_slot,":agent",1,":morale"),
        (try_begin),
           (lt,":morale",0),
           (agent_set_slot,":agent",3,1),
        (else_try),
           (gt,":morale",250),
           (agent_set_slot,":agent",3,0),
        (end_try),
        (val_div,":morale",100),
        (agent_get_slot,":pmorale",":agent",2),
        (val_add,":pmorale",":morale"),
        (agent_set_slot,":agent",2,":pmorale"),        
      (end_try),]),

    ("set_rout_position",
     [(try_for_agents,":agent"),
        (agent_is_human,":agent"),
        (agent_is_alive,":agent"),
        (agent_get_slot,":routed",":agent",3),
        (eq,":routed",1),
        (try_begin),
           (agent_is_ally,":agent"),
           (assign,":dist",9999999999999999999),
           (assign,":chosen",-1),
           (try_for_agents,":enemy"),
              (neg|agent_is_ally,":enemy"),
              (agent_is_alive,":enemy"),
              (agent_is_human,":enemy"),
              (agent_get_position,1,":enemy"),
              (agent_get_position,2,":chosen"),
              (agent_get_position,1,":agent"),
              (get_distance_between_positions,":distance",1,2),
              (lt,":distance",":dist"),
              (assign,":dist",":distance"),
              (assign,":chosen",":enemy"),
            (end_try),
              (gt,":chosen",-1),
              (agent_get_position,2,":chosen"),
              (agent_get_position,1,":agent"),
              (position_get_x,":value",1),
              (position_get_x,":othervalue",2),
              (val_sub,":value",":othervalue"),
              (position_set_x,1,":value"),
              (position_get_y,":value",1),
              (position_get_y,":othervalue",2),
              (val_sub,":value",":othervalue"),
              (position_set_y,1,":value"),
              (position_set_z_to_ground_level,1),
              (agent_set_scripted_destination,":agent",1),
         (else_try),
           (assign,":dist",9999999999999999999),
           (assign,":chosen",-1),
           (try_for_agents,":enemy"),
              (agent_is_ally,":enemy"),
              (agent_is_alive,":enemy"),
              (agent_is_human,":enemy"),
              (agent_get_position,1,":enemy"),
              (agent_get_position,2,":chosen"),
              (agent_get_position,1,":agent"),
              (get_distance_between_positions,":distance",1,2),
              (lt,":distance",":dist"),
              (assign,":dist",":distance"),
              (assign,":chosen",":enemy"),
            (end_try),
              (gt,":chosen",-1),
              (agent_get_position,2,":chosen"),
              (agent_get_position,1,":agent"),
              (position_get_x,":value",1),
              (position_get_x,":othervalue",2),
              (val_sub,":value",":othervalue"),
              (position_set_x,1,":value"),
              (position_get_y,":value",1),
              (position_get_y,":othervalue",2),
              (val_sub,":value",":othervalue"),
              (position_set_y,1,":value"),
              (position_set_z_to_ground_level,1),
              (agent_set_scripted_destination,":agent",1),
         (end_try),
       (end_try),]),

    ("set_morale_slots",
      [(try_for_agents,":agent"),
           (agent_set_slot,":agent",1,0),
           (agent_set_slot,":agent",2,0),
           (agent_set_slot,":agent",3,0),
       (end_try),]),

    ("spread_fire",
      [(try_for_range,":prop_type","spr_town_house_a","spr_earth_wall_a"),
          (scene_prop_get_num_instances,":number", ":prop_type"),
          (try_for_range,":prop",0,":number"),
              (scene_prop_get_instance,":instance", ":prop_type", ":prop"),
              (agent_get_position,pos2,reg55),
              (prop_instance_get_position,pos1,":instance"),
              (get_distance_between_positions,":dist",pos1,pos2),
              (try_begin),
                 (lt,":dist",1000),
                 (party_set_slot,"p_burning_buildings",":instance",50),
              (end_try),
              (party_get_slot,":burn","p_burning_buildings",":instance"),
              (gt,":burn",40),
              (particle_system_burst,"psys_massive_fire",pos1,100),
              (try_for_agents,":agent"),
                 (agent_get_position,pos2,":agent"),
                 (get_distance_between_positions,":dist",pos1,pos2),
                 (lt,":dist",1000),
                 (agent_set_hit_points,":agent",0,0),
                 (agent_deliver_damage_to_agent,":agent",":agent"),    
              (end_try),        
              (try_for_range,":prop_type2","spr_town_house_a","spr_snowy_castle_tower_a"),
                 (scene_prop_get_num_instances,":number2",":prop_type2"),
                 (try_for_range,":prop2",0,":number2"),
                   (scene_prop_get_instance,":instance2",":prop_type2",":prop2"),
                   (prop_instance_get_position,pos2,":instance2"),
                   (get_distance_between_positions,":dist",pos1,pos2),
                   (lt,":dist",1700),
                   (party_get_slot,":burn","p_burning_buildings",":instance2"),
                   (val_add,":burn",1),
                   (party_set_slot,"p_burning_buildings",":instance2",":burn"),
                 (end_try),
              (end_try),
          (end_try),
        (end_try),]),

  ("kill_overboard",
      [(try_for_agents,":agent"),
           (agent_get_position,pos1,":agent"),
           (agent_get_position,pos2,":agent"),
           (position_set_z_to_ground_level, pos2),
           (get_distance_between_positions,":dist",pos1,pos2),
           (gt,":dist",500),
           (agent_set_hit_points,":agent",0,0),
           (agent_deliver_damage_to_agent,":agent",":agent"),    
       (end_try),]),


 ("protect_ships",
       [(try_for_range,":shiptype","spr_ship","spr_enemy_ships_end"),
           (scene_prop_get_num_instances,":number",":shiptype"),
           (try_for_range,":firstshipno",0,":number"),
               (lt,":shiptype","spr_ships_end"),
               (scene_prop_get_instance,":firstship", ":shiptype", ":firstshipno"),
               (prop_instance_get_position,1,":firstship"),
               (scene_prop_get_instance,":protection", "spr_ship_protect", ":firstshipno"),
               (prop_instance_set_position,pos1,":protection"),
           (else_try),
               (scene_prop_get_instance,":firstship", ":shiptype", ":firstshipno"),
               (prop_instance_get_position,1,":firstship"),
               (scene_prop_get_instance,":protection", "spr_enemy_ship_protect", ":firstshipno"),
               (prop_instance_set_position,pos1,":protection"),
           (end_try),
         (end_try),
]),

      ("cf_keep_troops_on_ships",
       [(try_for_agents,":agent"),
           (agent_is_alive,":agent"),
           (agent_is_human,":agent"),
           (agent_get_position,pos1,":agent"),
          (try_begin),
           (agent_is_ally,":agent"),
           (assign,":dist",999999999),
           (scene_prop_get_num_instances,reg50,"spr_ship"),
           (val_add,reg50,1),
           (try_for_range,":instance",0,reg50),
              (scene_prop_get_instance,":thechosenship", "spr_ship", ":instance"),              
              (prop_instance_get_position,2,":thechosenship"),
              (get_distance_between_positions,":distance",1,2),
              (lt,":distance",":dist"),
              (assign,":dist",":distance"),
              (prop_instance_get_position,pos3,":thechosenship"),
              (assign,":checked_ship",":thechosenship"),
           (end_try),
           (try_begin),
             (party_slot_eq,"p_ship_colisions",":checked_ship",1),
             (agent_clear_scripted_mode,":agent"),
           (else_try),
             (agent_set_scripted_destination,":agent",pos3,0),
           (end_try),
          (else_try),
           (assign,":dist",999999999),
           (scene_prop_get_num_instances,reg50,"spr_ship"),
           (val_add,reg50,1),
           (try_for_range,":instance",0,reg50),
              (scene_prop_get_instance,":thechosenship", "spr_enemy_ship", ":instance"),              
              (prop_instance_get_position,2,":thechosenship"),
              (get_distance_between_positions,":distance",1,2),
              (lt,":distance",":dist"),
              (assign,":dist",":distance"),
              (prop_instance_get_position,pos3,":thechosenship"),
              (assign,":checked_ship",":thechosenship"),
           (end_try),
           (try_begin),
             (party_slot_eq,"p_ship_colisions",":checked_ship",1),
             (agent_clear_scripted_mode,":agent"),
           (else_try),
             (agent_set_scripted_destination,":agent",pos3,0),
           (end_try),
           (end_try),
          (end_try),]),
###############################################################


#                                 SEA BATTLES END


###############################################################
 
Don't the ships move in like a siege tower way? you should ask anyone who knows about that if they can do the same to the ships.
 
Status
Not open for further replies.
Back
Top Bottom