That the AoFI cannon can damage destructible objects

Users who are viewing this thread

A long time ago I started modeling on the AoFI Module System, a musket mod that had cannons, but they only worked in multiplayer.
I would like someone to help me modify certain aspects of the cannon so that it can destroy destructible scenes props in battle, in single, as in multiplayer.
The cannon code is designed to be used only in multiplayer, but I used it in single and it also works, but it has certain errors that I think can be solved.
The cannonball, when hitting the ground, produces the explosion that kills bots and players, but if a wall existed, it does nothing, it only goes through it.
I would like the bullet to explode when hitting any object in a scene, for example a house, a tree, a wall etc.
I have several objects that explode with a bullet or a saber strike, but if the cannon did the same, it would be great ...
Here the AOFI code, the scripts and codes, you can find them in module mission_template, script, item and scene prop ... thanks in advance.
https://forums.taleworlds.com/index.php?threads/the-aofi-source-code.152698/
 
Perhaps the Age of Machinery project thread is giving you some clues:
 
Upvote 0
Perhaps the Age of Machinery project thread is giving you some clues:
thanks friend, ... I'll take a look at it
 
Upvote 0
I will make the cannon work in single player without errors, I even added the transfer cart that I had, but it caused an error in multiplayer that's why I had removed it .... the cannon works well for me in sieges to castles or cities, even in scenes visiting these places, but in normal battle and in battle against bandits in a village, everything works except the shot, the bullet stays stuck at the beginning .............. ....
What does the siege mission have that the other missions don't? (normal battle or village battles)
thanks
 
Upvote 0
If you're talking about your Indepence of Chile mod (which is what i concluded from the posts in the aofi source code thread), i checked your mod.
There is a faulty troop.
trp_dragon_chillan_multiplayer_ai Dragones_de_Chillan Dragones_de_Chillan 107839786675327149611988294282401302429624697383150174391175993098240 99615744 0 0 16 429779518619449574961991743399740668291840307270730468511885245284352 0
First one is the troop image which should be a string. Second one is the first upgrade path of the troop which should be a 32-bit integer. It looks like stuff i've seen here. Possibly wrongly pasted face code. It may have caused the multiplayer error.
Also there are 8 scene props which have weird flag values.
spr_estacas_destruct 40265418752 0 estacas1 bo_estacas1 3

spr_reja_mimbre 40265418752 0 reja_mimbre bo_reja_mimbre 3

spr_cerco_mad 53687191552 0 cercoB bo_cercoB 3

spr_trinchera_mimbre 53687191552 0 trinchera_mimbre bo_trinchera_mimbre 3

spr_sacos_destruct 67108964352 0 sacos_apilados3 bo_sacos_apilados3 3

spr_barricada_mad2 11811260416 0 trinchera_madera bo_trinchera_madera 3

spr_muro_sacos 25233033216 0 muro_sacos bo_muro_sacos 3

spr_barricada_mad1 38654806016 0 reducto2_centro bo_reducto2_centro 3
Scene prop flags look like they use 64-bit variables for but you can deduce from looking at the 'header_scene_props.py' file that only the first 32 bits are used. Those values are 36-bit which indicates you added some wrong stuff to the flags.
You should check those tuples.
If you're talking about some other mod you're working on currently, you should paste some code. It's hard to deduce stuff hypothetically.
 
Upvote 0
If you're talking about your Indepence of Chile mod (which is what i concluded from the posts in the aofi source code thread), i checked your mod.
There is a faulty troop.

First one is the troop image which should be a string. Second one is the first upgrade path of the troop which should be a 32-bit integer. It looks like stuff i've seen here. Possibly wrongly pasted face code. It may have caused the multiplayer error.
Also there are 8 scene props which have weird flag values.

Scene prop flags look like they use 64-bit variables for but you can deduce from looking at the 'header_scene_props.py' file that only the first 32 bits are used. Those values are 36-bit which indicates you added some wrong stuff to the flags.
You should check those tuples.
If you're talking about some other mod you're working on currently, you should paste some code. It's hard to deduce stuff hypothetically.
Hi, how are you...
I can tell you that it is for my Independencia de Chile mod, but in multiplayer that troop and those accessories work very well, there is no problem with that.
What I meant is that the AoFI cannon code is only for multiplayer, but I managed to make it work in single, I even added the cart that carries the cannon that crashed the game when played on a dedicated server. but i took it off and put the fixed cannons on multiplayer maps and all good.
The code of the cannon is very long, it includes codes in mission_template, script, scenes_prop and item and it works well for me in siege, but in lead_charge only half because the bullet stays stuck one meter ahead of the cannon, I will paste it here. .... I also tell you that my mod I did with this module system so it is very old hahaha
 
Upvote 0
this goes in mission template, putting the mp_cannon_triggers2 in the corresponding mission
Code:
mp_cannon_physics2 = (
    0.8, 0, 0, [],
    [
        (scene_prop_get_num_instances, ":num_instances", "spr_mp_cannonball_projectile"),
        (try_for_range, ":cur_instance", 0, ":num_instances"),
            (scene_prop_get_instance, ":instance", "spr_mp_cannonball_projectile", ":cur_instance"),
            (scene_prop_get_slot, ":decay", ":instance", mp_cannonball_decay),
            (scene_prop_get_slot, ":speed", ":instance", mp_cannonball_speed),
            (scene_prop_get_slot, ":cannon", ":instance", mp_cannonball_cannon),
            (prop_instance_get_scene_prop_kind, ":cannon_type", ":cannon"),

            (try_begin),
              (eq, ":cannon_type", "spr_sp_cannon_3lb"),
              (val_sub, ":decay", 16),#8
              (val_sub, ":speed", 2),#9
            (else_try),
              (eq, ":cannon_type", "spr_sp_cannon_bote"),
              (val_sub, ":decay", 16),
              (val_sub, ":speed", 2),
            (else_try),
              (eq, ":cannon_type", "spr_mp_cannon_12lb"),
              (val_sub, ":decay", 6),
              (val_sub, ":speed", 7),
            (try_end),

            (try_begin),
              (lt, ":speed", 10),#10
              (assign, ":speed", 0),
            (try_end),

            (scene_prop_set_slot, ":instance", mp_cannonball_decay, ":decay"),
            (scene_prop_set_slot, ":instance", mp_cannonball_speed, ":speed"),
        (try_end),
    ])
mp_cannon_projectile2 = (
    0.025, 0, 0, [],
    [
        #Handle cannonball props.
            (scene_prop_get_num_instances, ":num_instances", "spr_mp_cannonball_projectile"),
            (try_for_range, ":cur_instance", 0, ":num_instances"),
            (scene_prop_get_instance, ":instance", "spr_mp_cannonball_projectile", ":cur_instance"),
            (scene_prop_slot_eq, ":instance", mp_projectile_active, 1),
            (assign, ":collision", 0),

            (scene_prop_get_slot, ":cannonball_cannon", ":instance", mp_cannonball_cannon),
            (prop_instance_get_scene_prop_kind, ":cannon_type", ":cannonball_cannon"),

            #Remove previous animations.
            (try_begin),
                (prop_instance_is_animating, ":is_animating", ":instance"),
                (eq, ":is_animating", 1),
                (prop_instance_stop_animating, ":instance"),
            (try_end),

            #Move.
            (prop_instance_get_position, pos1, ":instance"),
            (scene_prop_get_slot, ":decay", ":instance", mp_cannonball_decay),
            (scene_prop_get_slot, ":speed", ":instance", mp_cannonball_speed),
            (position_move_y, pos1, ":speed"), #Travels (1/0.025)*125=4000 in one second.
            (position_move_z, pos1, ":decay"), #Decay
            (prop_instance_animate_to_position, ":instance", pos1, 3),


            #Agent collision.
            (scene_prop_get_slot, ":shooter", ":instance", mp_projectile_shooter),
            (try_for_agents, ":agent"),
                (agent_is_alive, ":agent"),
                (agent_get_position, pos2, ":agent"),
                (position_move_z, pos2, 60),
                (get_distance_between_positions, ":distance", pos1, pos2),
                (try_begin),
                  (eq, ":cannon_type", "spr_sp_cannon_3lb"),
                  (assign, ":min_dist", 160),#80
                (else_try),
                  (eq, ":cannon_type", "spr_sp_cannon_bote"),
                  (assign, ":min_dist", 120),
                (else_try),
                  (assign, ":min_dist", 120),
                (try_end),
                (try_begin),
                    (neg|agent_is_human, ":agent"), #Horse.
                    (val_add, ":min_dist", 75),
                (try_end),
                (le, ":distance", ":min_dist"),

                #Calculate & deliver damage.
                (try_begin),
                    (agent_is_active, ":shooter"),
                    (agent_deliver_damage_to_agent, ":shooter", ":agent", 250),#150
                (else_try),
                    (agent_deliver_damage_to_agent, ":agent", ":agent", 250),#150
                (try_end),
            (try_end),

            #Ground collision.
            (try_begin),
                (position_get_distance_to_ground_level, ":distance", pos1),
                (le, ":distance", 15),#15
                (assign, ":collision", 1),
                (position_set_z_to_ground_level, pos1),

            (try_begin),
             (play_sound_at_position, "snd_explosion",0),
             (particle_system_burst,"psys_explosion_flash",pos1,500),
             (particle_system_burst,"psys_war_smoke_tall",pos1,150),
             (particle_system_burst,"psys_explosion_smoke",pos1,100),
             (particle_system_burst,"psys_explosion_smoke2",pos1,100),

                    (try_for_agents, ":agent"),
                        (agent_is_alive, ":agent"),
                        (agent_get_position, pos2, ":agent"),
                        (get_distance_between_positions, ":distance", pos1, pos2),
                        (try_begin),
                          (eq, ":cannon_type", "spr_sp_cannon_3lb"),
                          (assign, ":dist_max", 185),#175
                          (assign, ":damage_min", 175),#125
                          (assign, ":damage_max", 250),#175
                        (else_try),
                          (eq, ":cannon_type", "spr_sp_cannon_bote"),
                          (assign, ":dist_max", 160),
                          (assign, ":damage_min", 125),
                          (assign, ":damage_max", 210),
                        (else_try),
                          (eq, ":cannon_type", "spr_mp_cannon_12lb"),
                          (assign, ":dist_max", 245),
                          (assign, ":damage_min", 125),
                          (assign, ":damage_max", 545),#245
                        (try_end),
                        (le, ":distance", ":dist_max"),

             #Play sound & particles.
             (position_move_z, pos2, 50),

             (particle_system_burst, "psys_game_blood", pos2, 100), #This plays at the agents chest.
             (play_sound_at_position, "snd_explosion",0),
             (particle_system_burst,"psys_explosion_flash",pos1,100),
             (particle_system_burst,"psys_war_smoke_tall",pos1,150),
             (particle_system_burst,"psys_explosion_smoke",pos1,100),
             (particle_system_burst,"psys_explosion_smoke2",pos1,100),

            #Calculate & deliver damage.
                (store_random_in_range, ":rand", ":damage_min", ":damage_max"), #Base damage
                (val_sub, ":rand", ":distance"), #The farther away the target is, the less damage it receives
                (try_begin),
                    (agent_is_active, ":shooter"),
                    (agent_deliver_damage_to_agent, ":shooter", ":agent", ":rand"),
                (else_try),
                    (agent_deliver_damage_to_agent, ":agent", ":agent", ":rand"),
                (try_end),
            (try_end),
        (try_end),
    (try_end),

            #Finalize.
            (try_begin),
                (eq, ":collision", 1),
                (scene_prop_set_slot, ":instance", mp_projectile_active, 0),
                (scene_prop_set_slot, ":instance", mp_projectile_shooter, -1),
            (try_end),
        (try_end),
    ])

mp_cannon_cart = (
    0.06, 0, 0, [],
    [
        (try_for_agents, ":horse"),
          (agent_get_slot, ":horse_cart_instance", ":horse", mp_cannon_horse_cart),
          (agent_get_position, pos1, ":horse"),
          (try_begin),
            (gt, ":horse_cart_instance", 0),

            (position_set_z_to_ground_level, pos1),

            (prop_instance_animate_to_position, ":horse_cart_instance", pos1, 40),
          (try_end),
        (try_end),
    ])

mp_cannon_cart_unpack = (
    ti_on_agent_dismount, 0, 0, [],
    [
        (store_trigger_param_2, ":horse"),

#        (multiplayer_is_server),

        (agent_get_slot, ":cart", ":horse", mp_cannon_horse_cart),

        (agent_get_position, pos1, ":horse"),
        (agent_get_item_id, ":horse_type", ":horse"),
        (copy_position, pos2, pos1),
        (try_begin),
            (gt, ":cart", 0),

            (scene_prop_get_slot, ":cannon", ":cart", mp_cannon_horse_cart_cannon),

            (position_rotate_z, pos1, 180),
            (position_move_y, pos1, 260),

            (try_begin),
              (gt, ":cannon", 0),
              (prop_instance_animate_to_position, ":cannon", pos1, 5),
            (else_try),
              (set_spawn_position, pos1),
              (try_begin),
                (eq, ":horse_type", "itm_artillery_horse_3lb"),
                (assign, ":cannon_prop", "spr_sp_cannon_3lb"),
                (spawn_scene_prop, ":cannon_prop"),
                (assign, ":cannon", reg0),
              (try_end),
            (try_end),

            (position_set_z, pos2, -1200),
            (prop_instance_animate_to_position, ":cart", pos2, 5),

            (agent_set_slot, ":horse", mp_cannon_horse_cart, -1),
            (scene_prop_set_slot, ":cart", mp_cannon_horse_cart_cannon, -1),
            (scene_prop_set_slot, ":cart", mp_cannon_horse_cart_active, 0),
            (prop_instance_enable_physics, ":cannon", 1),
        (try_end),
    ])

mp_cannon_rotate2 = (
    0, 0, 0.05,
    [],
    [
        (try_begin),
(key_is_down, key_up),
                  (scene_prop_get_instance,":ship_instance", "spr_sp_cannon_3lb", 0),
                    (prop_instance_get_position,pos1,":ship_instance"),
                    (position_rotate_x,pos1,2),
                    (prop_instance_animate_to_position,":ship_instance",pos1,25),
                (else_try),
(key_is_down, key_down),
                  (scene_prop_get_instance,":ship_instance", "spr_sp_cannon_3lb", 0),
                  (prop_instance_get_position,pos1,":ship_instance"),
                  (position_rotate_x,pos1,-2),
                  (prop_instance_animate_to_position,":ship_instance",pos1,25),
                  (else_try),
(key_is_down, key_right),
                  (scene_prop_get_instance,":ship_instance", "spr_sp_cannon_3lb", 0),
                    (prop_instance_get_position,pos1,":ship_instance"),
                    (position_rotate_z,pos1,-2),
                    (prop_instance_animate_to_position,":ship_instance",pos1,25),
                    (else_try),
(key_is_down, key_left),
                  (scene_prop_get_instance,":ship_instance", "spr_sp_cannon_3lb", 0),
                    (prop_instance_get_position,pos1,":ship_instance"),
                    (position_rotate_z,pos1,2),
                    (prop_instance_animate_to_position,":ship_instance",pos1,25),
                    (try_end),
    ])

mp_cannon_agent_spawn = (
    ti_on_agent_spawn, 0, 0,
    [],
    [
        (store_trigger_param_1, ":horse"), #Get the horse that just spawned
        (agent_get_item_id, ":horse_type", ":horse"), #Get the type of horse
        (agent_get_position, pos1, ":horse"), #Get the horses position

        (assign, ":cart_kind", -1), #So if the horse isn't any of these type, we won't do anything
        (try_begin),
            (eq, ":horse_type", "itm_artillery_horse_3lb"),
            (assign, ":cart_kind", "spr_sp_cannon_a_cart"),
        (try_end),

        (assign, ":cart_instance", -1), #So if there aren't any existing unused carts, we'll spawn a new one
        (try_begin),
            (gt, ":cart_kind", -1),
            (scene_prop_get_num_instances, ":num_instances", ":cart_kind"),
            (try_for_range, ":cur_instance", 0, ":num_instances"),
                (scene_prop_get_instance, ":cart_instance", ":cart_kind", ":cur_instance"),
                (neg|scene_prop_slot_eq, ":cart_instance", mp_cannon_horse_cart_active, 1),
                (assign, ":num_instances", 0), #End loop.
                (prop_instance_animate_to_position, ":cart_instance", pos1, 5),
            (try_end),
            (try_begin),
                (eq, ":cart_instance", -1),
                (set_spawn_position, pos1),
                (spawn_scene_prop, ":cart_kind"),
                (assign, ":cart_instance", reg0),
            (try_end),
        (try_end),

        (agent_set_slot, ":horse", mp_cannon_horse_cart, ":cart_instance"), #Tell the horse what cart is following it
    ])

mp_cannon_triggers2 = [
mp_cannon_physics2,
mp_cannon_projectile2,
mp_cannon_cart,
mp_cannon_cart_unpack,
mp_cannon_rotate2,
mp_cannon_agent_spawn,

Code:
sp_cannon_spawn = (
    ti_on_init_scene_prop,
    [
        (store_trigger_param_1, ":instance"),
        #Initialize rotation angles.
        (prop_instance_get_position, pos1, ":instance"),
        (position_get_rotation_around_z, ":rotation", pos1),
        (init_position, pos2),
        (position_copy_origin, pos2, pos1),
        (position_rotate_z, pos2, ":rotation"),
        (prop_instance_set_position, ":instance", pos2),

        #Handle data.
        (scene_prop_set_slot, ":instance", mp_prop_x, 0),
        (scene_prop_set_slot, ":instance", mp_prop_y, 0),
        (scene_prop_set_slot, ":instance", mp_prop_z_standard, ":rotation"),

        (scene_prop_set_hit_points, ":instance", 350),
    ])

sp_cannon = (
    ti_on_scene_prop_use,
    [
        (store_trigger_param_1, ":agent"),
        (store_trigger_param_2, ":instance"),

        (agent_get_wielded_item, ":wielded_item", ":agent"),
        (prop_instance_get_scene_prop_kind, ":instance_kind", ":instance"),

        (try_begin),
          (scene_prop_slot_eq, ":instance", mp_cannon_reload, 0),
          (try_begin),
            (eq, ":instance_kind", "spr_sp_cannon_3lb"),
            (eq, ":wielded_item", "itm_sp_cannonball_3lb"),
            (scene_prop_set_slot, ":instance", mp_cannon_reload, 1),
            (agent_get_ammo, ":3lb_ammo", ":agent", "itm_sp_cannonball_3lb"),
            (val_sub, ":3lb_ammo", 1),
            (agent_set_ammo, ":agent", "itm_sp_cannonball_3lb", ":3lb_ammo"),
            (else_try),
              (eq, ":instance_kind", "spr_sp_cannon_bote"),
              (eq, ":wielded_item", "itm_sp_cannonball_3lb"),
              (scene_prop_set_slot, ":instance", mp_cannon_reload, 1),
              (agent_get_ammo, ":3lb_ammo", ":agent", "itm_sp_cannonball_3lb"),
              (val_sub, ":3lb_ammo", 1),
              (agent_set_ammo, ":agent", "itm_sp_cannonball_3lb", ":3lb_ammo"),
          (try_end),

        (try_end),
        (try_begin),

          (scene_prop_slot_eq, ":instance", mp_cannon_reload, 1),
          (this_or_next|eq, ":wielded_item", "itm_ramrod"),
          (eq, ":wielded_item", "itm_linstock"),
          (scene_prop_set_slot, ":instance", mp_cannon_reload, 2),

        (try_end),
        (try_begin),

        #Packing cannon into a cart
            (scene_prop_slot_eq, ":instance", mp_cannon_reload, 0),
            (neq, ":wielded_item", "spr_sp_cannon_3lb"),
            (neq, ":wielded_item", "spr_sp_cannon_bote"),

            (agent_get_horse, ":agent_horse", ":agent"),
            (try_begin),
                (gt, ":agent_horse", -1),

                (prop_instance_get_position, pos1, ":instance"),

            #Try to get a prop.
                (try_begin),
                  (eq, ":instance_kind", "spr_sp_cannon_3lb"),
                  (assign, ":cart_kind", "spr_sp_cannon_a_cart"),

                (try_end),

                (assign, ":cart_instance", -1),
                (scene_prop_get_num_instances, ":num_instances", ":cart_kind"),
                (try_for_range, ":cur_instance", 0, ":num_instances"),
                    (scene_prop_get_instance, ":cart_instance", ":cart_kind", ":cur_instance"),
                    (assign, ":num_instances", 0), #End loop.
                (else_try),
                    (eq, ":cart_instance", -1),
                    (set_spawn_position, pos1),
                    (spawn_scene_prop, ":cart_kind"),
                    (assign, ":cart_instance", reg0),
                (try_end),

                (position_set_z, pos1, -1200),
                (prop_instance_animate_to_position, ":instance", pos1, 5), #Get rid of the cannon

                (agent_set_slot, ":agent_horse", mp_cannon_horse_cart, ":cart_instance"), #Tell the horse what cart is following it
                (scene_prop_set_slot, ":cart_instance", mp_cannon_horse_cart_cannon, ":instance"), #Tell the cart what cannon it's attached to
                (scene_prop_set_slot, ":cart_instance", mp_cannon_horse_cart_active, 1), #Tell the cart that it's in use
                (prop_instance_enable_physics, ":instance", 0), #Disable the cannon's collision
            (try_end),
        (try_end),
     ])
    
    sp_cannon_fire = (
    ti_on_scene_prop_start_use,
    [
      (store_trigger_param_1, ":agent"),
      (store_trigger_param_2, ":instance"),

      (agent_is_active, ":agent"),
      (agent_get_wielded_item, ":wielded_item", ":agent"),

      (try_begin),
        (scene_prop_slot_eq, ":instance", mp_cannon_reload, 2),
        (eq, ":wielded_item", -1),#-1

        (scene_prop_set_slot, ":instance", mp_cannon_reload, 0),

        #Get the firing position.
        (prop_instance_get_position, pos1, ":instance"),
        (position_move_z, pos1, 75),
        (position_move_y, pos1, 80),

        #Try to get a prop.
        (assign, ":projectile", -1),
        (scene_prop_get_num_instances, ":num_instances", "spr_mp_cannonball_projectile"),
        (try_for_range, ":cur_instance", 0, ":num_instances"),
            (scene_prop_get_instance, ":projectile_instance", "spr_mp_cannonball_projectile", ":cur_instance"),
            (neg|scene_prop_slot_eq, ":projectile_instance", mp_projectile_active, 1), #Make sure the cannonball isn't already in use
            (assign, ":num_instances", 0), #End loop.
            (assign, ":projectile", ":projectile_instance"),
        (try_end),
        (try_begin),
            #If unused projectile was not found, then spawn a new one.
            (eq, ":projectile", -1),
            (set_spawn_position, pos1),
            (spawn_scene_prop, "spr_mp_cannonball_projectile"),
            (assign, ":projectile", reg0),
        (try_end),

        #Fire projectile, if prop exists & is reloaded.
        (ge, ":projectile", 0),
        (scene_prop_set_slot, ":projectile", mp_projectile_active, 1),
        (scene_prop_set_slot, ":projectile", mp_projectile_shooter, ":agent"),
        (scene_prop_set_slot, ":projectile", mp_cannonball_decay, 0),
        (scene_prop_set_slot, ":projectile", mp_cannonball_speed, 200),#250
        (scene_prop_set_slot, ":projectile", mp_cannonball_cannon, ":instance"),
        (copy_position, pos2, pos1),
        (position_move_z, pos2, 85),
        (prop_instance_set_position, ":projectile", pos2),
        #(position_move_y, pos1, 50), #50 because of synchronization..
        (prop_instance_animate_to_position, ":projectile", pos1, 6),

        #Particle systems & sound.
        (init_position, pos3),
        (prop_instance_get_position, pos3, ":instance"),
        (position_move_z, pos3, 85),
        (position_move_y, pos3, 125),
        (particle_system_burst, "psys_cannon_smoke", pos3, 30),#40
        (particle_system_burst, "psys_cannon_fire", pos3, 50),
        (agent_play_sound, ":agent", "snd_cannon_fire_a"),
      (try_end),
    ])

sp_cannonball_spawn = (
    ti_on_scene_prop_use,
    [
        (store_trigger_param_2, ":instance"),
        (prop_instance_get_position, pos1, ":instance"),
        (prop_instance_get_scene_prop_kind, ":instance_kind", ":instance"),

        (position_move_y, pos1, -20),
        (set_spawn_position, pos1),
        (try_begin),
          (eq, ":instance_kind", "spr_sp_cannon_3lb_pile"),
          (spawn_item, "itm_sp_cannonball_3lb"),
         (try_end),
    ])

("sp_cannon_3lb", sokf_moveable|sokf_destructible|spr_use_time(3), "cannon_3lb", "bo_cannon_3lb",
 [
 sp_cannon_spawn,
 sp_cannon,
 sp_cannon_fire,
 (ti_on_init_scene_prop,
  [
    (store_trigger_param_1, ":instance_no"),
    (scene_prop_set_hit_points, ":instance_no", 10000000),
    ]),
 (ti_on_scene_prop_hit,
  [
    (play_sound, "snd_dummy_hit"),
    (particle_system_burst, "psys_dummy_smoke", pos1, 3),
    (particle_system_burst, "psys_dummy_straw", pos1, 10),
]),
]),

("sp_cannon_a_cart", 0, "cannon_a_cart", 0, []),
("sp_cannon_3lb_pile", spr_use_time(2), "bala_3lb", "bo_bala", [sp_cannonball_spawn]),
("mp_cannonball_projectile", 0, "projectile", "bo_projectile", []),

Code:
["sp_cannonball_box_3lb", "Bala 3-lb", [("bala_3lb",0)], itp_merchandise| itp_type_thrown |itp_primary,itcf_throw_stone,
100, weight(50)|difficulty(0)|spd_rtng(75) | shoot_speed(5) | thrust_damage(10,blunt)|max_ammo(1)|weapon_length(1),imodbits_thrown_minus_heavy,
[(ti_on_missile_hit, [

         (store_trigger_param_1,":thrower"),
         (try_begin),
            (agent_get_position, pos2, ":thrower"),
            (position_copy_rotation, pos1, pos2),
            (set_spawn_position, pos1),
            (spawn_scene_prop, "spr_sp_cannon_3lb_pile", 0),
          (try_end),])]],
          
["linstock", "Cargador", [("linstock",0)], itp_merchandise|itp_type_polearm|itp_offset_lance| itp_primary|itp_wooden_parry, itc_lanza,
 175 , weight(1.8)|difficulty(3)|spd_rtng(95) | weapon_length(109)|swing_damage(10 , blunt) | thrust_damage(10 ,  blunt),imodbits_polearm ],
["ramrod", "cargador", [("ramrod",0)], itp_merchandise|itp_type_polearm|itp_offset_lance| itp_primary|itp_wooden_parry, itc_lanza|itcf_carry_spear,
 250 , weight(2.5)|difficulty(0)|spd_rtng(75) | weapon_length(120)|swing_damage(15 , blunt) | thrust_damage(15 ,  blunt),imodbits_polearm ],
 ["cannonball_3lb", "Bala 3-lb", [("cannonball_3lb",0)], itp_type_thrown|itp_can_knock_down |itp_primary,0,
 20, weight(3)|difficulty(0)|spd_rtng(99) | shoot_speed(1) | thrust_damage(100,cut)|max_ammo(1)|weapon_length(1),imodbits_missile],

What is in module_script I will not put it here, because it is very complicated for me at the moment, because it is too late and I need time to analyze well to put what corresponds.
If I am missing something, it is because I did not want to put it, the code is made for 3 types of barrel, 3, 6 and 12 inches, but I only use the 3 in multi and single, I also added another called "cannon_bote" ...
On several occasions I omitted the other calibers, or deleted it, depending on where the code was.
Well, I'll leave you this mess hahaha
 
Upvote 0
Back
Top Bottom