LSP Kit Combat Project Age of Machinery [Released!]

KnightV

Squire
Best answers
0
HyperCharge said:
KnightV said:
Ooooh i am stupid :wink:) i have added this before but your trigger doesnt work


Hypercharge , can we speak about modding in another place? Emm..facebook, discord, vk, skype?
I haven't gotten any report that the trigger you have problem with until now. Can you try to re-add everything?

We could have spoken, but I don't have much time for long talks. Sorry. :sad:
The is no need in this . Lets think carefully ...mission trigger of your mod depends on what ? I think that presentations dont touch trigger ...next...maybe scripts . In another words, can you tell me what files i need to check concretically  ??
 

KnightV

Squire
Best answers
0
i have checked again and saw that all are right....i have 12 swadian ingeneers 3 trebuchets and then i attack bandits but menu where i need choose a number of catapults not appears i am crying now...
 

HyperCharge

Section Moderator
M&BWBWF&SNWVC
Best answers
0
KnightV said:
i have checked again and saw that all are right....i have 12 swadian ingeneers 3 trebuchets and then i attack bandits but menu where i need choose a number of catapults not appears i am crying now...
Search "Project Age of Machinery" in every single module_ file without the quotes. Check what is missing, then add it to yours.

It seems you have missed some parts.

And please try not to double posting.  :roll:
 

KnightV

Squire
Best answers
0
HyperCharge said:
KnightV said:
i have checked again and saw that all are right....i have 12 swadian ingeneers 3 trebuchets and then i attack bandits but menu where i need choose a number of catapults not appears i am crying now...
Search "Project Age of Machinery" in every single module_ file without the quotes. Check what is missing, then add it to yours.

It seems you have missed some parts.

And please try not to double posting.  :roll:
I have checked missions , scripts and game menus ...all are/is right(sorry for bad english)...what files are nessesary, too?
 

HyperCharge

Section Moderator
M&BWBWF&SNWVC
Best answers
0
module_constants
module_game_menus
module_items
module_mission_templates
module_presentations
module_particle_systems
module_meshes
module_party_templates
module_scene_props
module_scenes
module_scripts
module_triggers
module_troops
module_sounds
 

KnightV

Squire
Best answers
0
I made it work finally. There problem was in myself)))). Thank you for sharing it!!!!!!!

Could you post a screenshot how random_props position looks like because i am using my own scenes.
 

builder of the gods

Sergeant at Arms
Best answers
0
HyperCharge said:
Hi there, i was tried that hardly. But cause of some bugs, I was abandoned it. This code could make mods more impressive including my. I'm bringing back to work myself.

Progress(✔ = Done, ✔ = Will be added, ✔ = Partly done):

Porting artillery ✔
Hunting ✔
Adding artillery to sieges ✔
hyper, i might have found you a way to use engines in sieges.
just use the normal in battle code and create exceptions

1: siege tower
go in scripts to script_cf_siege_move_belfry
then at the end edit the code to
Code:
  
   (assign, "$belfry_positioned", 1),
   (assign, "$g_stop_ballista_fire", 1),
then in your scripts add a condition of $g_stop_ballista_fire being 0, and ofcourse assing it to 0 in a general ti_once mission template

2: ladders
here it gets a little more complicated, in a scene add an entry point like 99 at the point where attackers should use the ladders
then add a mission template checking the distance till the point every 15 or what seconds, if the distance becomes to close then
Code:
  
   (assign, "$g_stop_ballista_fire", 1),
use this trick again and both defending and attacking engines will stop firing

What this means
your engines fire till the actual clash of troops start,, you can easily implent basic conditions to make siege battles use siege engines till the clash, making siege engines implentation way more easy then when you need to add 100 random props, in addition to that the accurary of siege engines both defensively and in attack will increase as they dont aim for random points anymore.
just a agent_set_slot if the distance to an enemy agent is to big then in your find enemy script

you can not, however, destroy walls or anything like that with this technique

This might look still look a bit absract, but i'm already using this simple technique to enable basic siege engine features in sieges on For Rome, and will try to add pictures in this later

Update 1
i'm now using this script
Code:
	#conditions 1
	(assign, "$firenow", 0),
	(try_begin),
		(eq, "$g_stop_ballista_fire", 1), #so we are already fighting
		(entry_point_get_position, pos10, 1), #lets get our reinforcement point position
		(assign, ":min_distance_1", 100000),
		(try_for_agents,":cur_agent"),
			(agent_is_alive, ":cur_agent"),
			(agent_is_human, ":cur_agent"),
			(agent_get_team, ":agent_team", ":cur_agent"),
			(eq, ":agent_team", 1),
			(agent_get_position, pos2, ":cur_agent"),
			(get_distance_between_positions,":cur_dist",pos2,pos10),
			(lt, ":cur_dist", ":min_distance_1"),
			(assign, ":min_distance_1", ":cur_dist"), #gets closest distance to 
                        (assign, "$closestagent", ":cur_agent"),
		(try_end),
		(lt, ":cur_dist", 1500), #within ten meters of reinforcement, tweakable
		(assign, "$firenow", 2),
	(else_try),
                (eq, "$g_stop_ballista_fire", 0), 
		(assign, "$firenow", 1),
	(try_end),
	
	(this_or_next|eq, "$firenow", 1),
	(eq, "$firenow", 2),

then in the code that selects an enemy
Code:
	#calculate target
	(try_begin),
		(eq, "$firenow", 1),
		(assign, ":counter", 0),
		(try_for_agents,":enemy_agent"),
			(agent_is_alive, ":enemy_agent"),
			(agent_is_human, ":enemy_agent"),
			(agent_get_team, ":enemy_team", ":enemy_agent"),
			(teams_are_enemies, ":enemy_team", 2),
		(val_add,":counter",1),
		(try_end),
		(store_random_in_range,":random",0,":counter"),
		(try_for_agents,":enemy_agent"),
			(agent_is_alive, ":enemy_agent"),
			(agent_is_human, ":enemy_agent"),
			(agent_get_team, ":enemy_team", ":enemy_agent"),
			(teams_are_enemies, ":enemy_team", 2),
			(try_begin),
				(eq,":counter",":random"),
				(agent_get_position, pos0, ":enemy_agent"),
			(try_end),
			(val_add,":counter",1),
		(try_end),
	(else_try),
		(eq, "$firenow", 2),
		(agent_get_position, pos0, "$closestagent"),
	(try_end),

what does this do?
if the troops have not reached the wall yet, fire
if the troops have reached the wall but there also are troops close to reinforcement point atm (reinforcements spawned), set fire mode to at reinforcements
this way it actually offers more siege engine features then your current system does


Will be further updated....
 

MightyL

Recruit
Best answers
0
I've putted this to my mod. Everything works except that when I buy the artillery and the engineers. And when I've selected the artillery which I want on a battlefield, it doesn't spawn.  :???: Have I missed somewhere?

Nevermind I forgot the scenes XP, It is awesome!
 

cbamiduban

Regular
Best answers
0
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
WARNING: Local variable never used: value, at: 0
WARNING: Usage of unassigned global variable: $g_presentation_obj_7
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_info_pages.py", line 32, in <module>
    save_info_pages()
  File "process_info_pages.py", line 20, in save_info_pages
    ofile.write("ip_%s %s %s"%(info_page[0],string.replace(info_page[1]," ","_")
, string.replace(info_page[2]," ","_")))
IndexError: tuple index out of range
Exporting scripts...
WARNING: Local variable never used: cannon_no, at: field_artillery_spawn_a
WARNING: Local variable never used: cannon_no, at: field_artillery_spawn_b
WARNING: Local variable never used: cannon_no, at: siege_artillery_spawn_a
WARNING: Local variable never used: cannon_no, at: siege_artillery_spawn_b
Exporting mission_template data...
WARNING: Local variable never used: num_other_cannons, at: 0
WARNING: Local variable never used: num_other_cannons, at: 0
WARNING: Local variable never used: player_agent, at: 0
WARNING: Local variable never used: num_other_cannons, at: 0
WARNING: Local variable never used: player_agent, at: 0
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: $g_presentation_obj_7
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
I would like to ask how to solve the error! ~ :roll: :roll: :shock: :shock:
 

MightyL

Recruit
Best answers
0
cbamiduban said:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
WARNING: Local variable never used: value, at: 0
WARNING: Usage of unassigned global variable: $g_presentation_obj_7
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_info_pages.py", line 32, in <module>
    save_info_pages()
  File "process_info_pages.py", line 20, in save_info_pages
    ofile.write("ip_%s %s %s"%(info_page[0],string.replace(info_page[1]," ","_")
, string.replace(info_page[2]," ","_")))
IndexError: tuple index out of range
Exporting scripts...
WARNING: Local variable never used: cannon_no, at: field_artillery_spawn_a
WARNING: Local variable never used: cannon_no, at: field_artillery_spawn_b
WARNING: Local variable never used: cannon_no, at: siege_artillery_spawn_a
WARNING: Local variable never used: cannon_no, at: siege_artillery_spawn_b
Exporting mission_template data...
WARNING: Local variable never used: num_other_cannons, at: 0
WARNING: Local variable never used: num_other_cannons, at: 0
WARNING: Local variable never used: player_agent, at: 0
WARNING: Local variable never used: num_other_cannons, at: 0
WARNING: Local variable never used: player_agent, at: 0
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: $g_presentation_obj_7
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
I would like to ask how to solve the error! ~ :roll: :roll: :shock: :shock:
Those warnings for undefined variables are completely normal and do not do any problem. But this Traceback .... You messed somewhere with tupletes: ,
 

KnightV

Squire
Best answers
0
Hello, as i see you completely have added this feature to the sieges, is it true? To all the castles` and towns` scenes?
 

Eärendil the Mariner

Subforum Moderator
WBWF&SM&B
Best answers
52
KnightV said:
Hello, as i see you completely have added this feature to the sieges, is it true? To all the castles` and towns` scenes?
HyperCharge said:
Progress(✔ = Done, ✔ = Will be added, ✔ = Partly done):

Porting artillery ✔
Hunting ✔
Adding artillery to sieges ✔

DONE
But he also wrote
Siege Artillery:
Not yet done and not sure if they will be.

Problems:
All castle scenes would have to be modified.
Defenders have usually little space for those big engines.
A collision system would have to be created
Building destruction is hard to make I think. I couldn't even give a hp to wall.
 

KnightV

Squire
Best answers
0
[Bcw]Btm_Earendil said:
KnightV said:
Hello, as i see you completely have added this feature to the sieges, is it true? To all the castles` and towns` scenes?
HyperCharge said:
Progress(✔ = Done, ✔ = Will be added, ✔ = Partly done):

Porting artillery ✔
Hunting ✔
Adding artillery to sieges ✔

DONE
I downloaded and checked the modsys resource. Instruction says that i need to find all the codes which are marked. It`s OK, but i also see the new stuff which was provided by a different user above in this thread and it`s not marked. And now i`m confused whether i need to add the new stuff or not.
 

Eärendil the Mariner

Subforum Moderator
WBWF&SM&B
Best answers
52
I updated my answerwhile you have been answering, forgot to mention the second half.

If you mean this part, it is most probably not marked and you will need to add it by yourself since Hypercharge also didn't respond here anymore.
Godarcher said:
HyperCharge said:
Hi there, i was tried that hardly. But cause of some bugs, I was abandoned it. This code could make mods more impressive including my. I'm bringing back to work myself.

Progress(✔ = Done, ✔ = Will be added, ✔ = Partly done):

Porting artillery ✔
Hunting ✔
Adding artillery to sieges ✔
hyper, i might have found you a way to use engines in sieges.
just use the normal in battle code and create exceptions

1: siege tower
go in scripts to script_cf_siege_move_belfry
then at the end edit the code to
Code:
  
   (assign, "$belfry_positioned", 1),
   (assign, "$g_stop_ballista_fire", 1),
then in your scripts add a condition of $g_stop_ballista_fire being 0, and ofcourse assing it to 0 in a general ti_once mission template

2: ladders
here it gets a little more complicated, in a scene add an entry point like 99 at the point where attackers should use the ladders
then add a mission template checking the distance till the point every 15 or what seconds, if the distance becomes to close then
Code:
  
   (assign, "$g_stop_ballista_fire", 1),
use this trick again and both defending and attacking engines will stop firing

What this means
your engines fire till the actual clash of troops start,, you can easily implent basic conditions to make siege battles use siege engines till the clash, making siege engines implentation way more easy then when you need to add 100 random props, in addition to that the accurary of siege engines both defensively and in attack will increase as they dont aim for random points anymore.
just a agent_set_slot if the distance to an enemy agent is to big then in your find enemy script

you can not, however, destroy walls or anything like that with this technique

This might look still look a bit absract, but i'm already using this simple technique to enable basic siege engine features in sieges on For Rome, and will try to add pictures in this later

Update 1
i'm now using this script
Code:
	#conditions 1
	(assign, "$firenow", 0),
	(try_begin),
		(eq, "$g_stop_ballista_fire", 1), #so we are already fighting
		(entry_point_get_position, pos10, 1), #lets get our reinforcement point position
		(assign, ":min_distance_1", 100000),
		(try_for_agents,":cur_agent"),
			(agent_is_alive, ":cur_agent"),
			(agent_is_human, ":cur_agent"),
			(agent_get_team, ":agent_team", ":cur_agent"),
			(eq, ":agent_team", 1),
			(agent_get_position, pos2, ":cur_agent"),
			(get_distance_between_positions,":cur_dist",pos2,pos10),
			(lt, ":cur_dist", ":min_distance_1"),
			(assign, ":min_distance_1", ":cur_dist"), #gets closest distance to 
                        (assign, "$closestagent", ":cur_agent"),
		(try_end),
		(lt, ":cur_dist", 1500), #within ten meters of reinforcement, tweakable
		(assign, "$firenow", 2),
	(else_try),
                (eq, "$g_stop_ballista_fire", 0), 
		(assign, "$firenow", 1),
	(try_end),
	
	(this_or_next|eq, "$firenow", 1),
	(eq, "$firenow", 2),

then in the code that selects an enemy
Code:
	#calculate target
	(try_begin),
		(eq, "$firenow", 1),
		(assign, ":counter", 0),
		(try_for_agents,":enemy_agent"),
			(agent_is_alive, ":enemy_agent"),
			(agent_is_human, ":enemy_agent"),
			(agent_get_team, ":enemy_team", ":enemy_agent"),
			(teams_are_enemies, ":enemy_team", 2),
		(val_add,":counter",1),
		(try_end),
		(store_random_in_range,":random",0,":counter"),
		(try_for_agents,":enemy_agent"),
			(agent_is_alive, ":enemy_agent"),
			(agent_is_human, ":enemy_agent"),
			(agent_get_team, ":enemy_team", ":enemy_agent"),
			(teams_are_enemies, ":enemy_team", 2),
			(try_begin),
				(eq,":counter",":random"),
				(agent_get_position, pos0, ":enemy_agent"),
			(try_end),
			(val_add,":counter",1),
		(try_end),
	(else_try),
		(eq, "$firenow", 2),
		(agent_get_position, pos0, "$closestagent"),
	(try_end),

what does this do?
if the troops have not reached the wall yet, fire
if the troops have reached the wall but there also are troops close to reinforcement point atm (reinforcements spawned), set fire mode to at reinforcements
this way it actually offers more siege engine features then your current system does


Will be further updated....
 

KnightV

Squire
Best answers
0
[Bcw]Btm_Earendil said:
I updated my answerwhile you have been answering, forgot to mention the second half.

If you mean this part, it is most probably not marked and you will need to add it by yourself since Hypercharge also didn't respond here anymore.
Godarcher said:
HyperCharge said:
Hi there, i was tried that hardly. But cause of some bugs, I was abandoned it. This code could make mods more impressive including my. I'm bringing back to work myself.

Progress(✔ = Done, ✔ = Will be added, ✔ = Partly done):

Porting artillery ✔
Hunting ✔
Adding artillery to sieges ✔
hyper, i might have found you a way to use engines in sieges.
just use the normal in battle code and create exceptions

1: siege tower
go in scripts to script_cf_siege_move_belfry
then at the end edit the code to
Code:
  
   (assign, "$belfry_positioned", 1),
   (assign, "$g_stop_ballista_fire", 1),
then in your scripts add a condition of $g_stop_ballista_fire being 0, and ofcourse assing it to 0 in a general ti_once mission template

2: ladders
here it gets a little more complicated, in a scene add an entry point like 99 at the point where attackers should use the ladders
then add a mission template checking the distance till the point every 15 or what seconds, if the distance becomes to close then
Code:
  
   (assign, "$g_stop_ballista_fire", 1),
use this trick again and both defending and attacking engines will stop firing

What this means
your engines fire till the actual clash of troops start,, you can easily implent basic conditions to make siege battles use siege engines till the clash, making siege engines implentation way more easy then when you need to add 100 random props, in addition to that the accurary of siege engines both defensively and in attack will increase as they dont aim for random points anymore.
just a agent_set_slot if the distance to an enemy agent is to big then in your find enemy script

you can not, however, destroy walls or anything like that with this technique

This might look still look a bit absract, but i'm already using this simple technique to enable basic siege engine features in sieges on For Rome, and will try to add pictures in this later

Update 1
i'm now using this script
Code:
	#conditions 1
	(assign, "$firenow", 0),
	(try_begin),
		(eq, "$g_stop_ballista_fire", 1), #so we are already fighting
		(entry_point_get_position, pos10, 1), #lets get our reinforcement point position
		(assign, ":min_distance_1", 100000),
		(try_for_agents,":cur_agent"),
			(agent_is_alive, ":cur_agent"),
			(agent_is_human, ":cur_agent"),
			(agent_get_team, ":agent_team", ":cur_agent"),
			(eq, ":agent_team", 1),
			(agent_get_position, pos2, ":cur_agent"),
			(get_distance_between_positions,":cur_dist",pos2,pos10),
			(lt, ":cur_dist", ":min_distance_1"),
			(assign, ":min_distance_1", ":cur_dist"), #gets closest distance to 
                        (assign, "$closestagent", ":cur_agent"),
		(try_end),
		(lt, ":cur_dist", 1500), #within ten meters of reinforcement, tweakable
		(assign, "$firenow", 2),
	(else_try),
                (eq, "$g_stop_ballista_fire", 0), 
		(assign, "$firenow", 1),
	(try_end),
	
	(this_or_next|eq, "$firenow", 1),
	(eq, "$firenow", 2),

then in the code that selects an enemy
Code:
	#calculate target
	(try_begin),
		(eq, "$firenow", 1),
		(assign, ":counter", 0),
		(try_for_agents,":enemy_agent"),
			(agent_is_alive, ":enemy_agent"),
			(agent_is_human, ":enemy_agent"),
			(agent_get_team, ":enemy_team", ":enemy_agent"),
			(teams_are_enemies, ":enemy_team", 2),
		(val_add,":counter",1),
		(try_end),
		(store_random_in_range,":random",0,":counter"),
		(try_for_agents,":enemy_agent"),
			(agent_is_alive, ":enemy_agent"),
			(agent_is_human, ":enemy_agent"),
			(agent_get_team, ":enemy_team", ":enemy_agent"),
			(teams_are_enemies, ":enemy_team", 2),
			(try_begin),
				(eq,":counter",":random"),
				(agent_get_position, pos0, ":enemy_agent"),
			(try_end),
			(val_add,":counter",1),
		(try_end),
	(else_try),
		(eq, "$firenow", 2),
		(agent_get_position, pos0, "$closestagent"),
	(try_end),

what does this do?
if the troops have not reached the wall yet, fire
if the troops have reached the wall but there also are troops close to reinforcement point atm (reinforcements spawned), set fire mode to at reinforcements
this way it actually offers more siege engine features then your current system does


Will be further updated....
Do you know where i should put (assign, "$g_stop_ballista_fire", 1), and the rest pieces of codes?The first one is easy but the rest are not understandable for me. If you could help, i`d be thankful
 

builder of the gods

Sergeant at Arms
Best answers
0
disclaimer
this code was written only for an attacker dealing with a defensive ballista, you should reverse it to enable attackers using ballistas at defenders in sieges

Create a new mission template in module mission templates

Code:
common_siege_ballista = (
  19, 0, 0, [],
	[
	#conditions 1
	(scene_prop_get_num_instances,":num_instances","spr_ballista_loaded"),
	(gt, ":num_instances", 0), #we need to have actual ballista's
	
	#cleaning old messes
	(replace_scene_props, "spr_ballista_ammo_rock", "spr_ballista_pickup_rock"),	   
	
	#conditions 2
	(assign, "$firenow", 0),
	(try_begin),
		(eq, "$g_stop_ballista_fire", 1), #so we are already fighting
		(entry_point_get_position, pos10, 1), #lets get our reinforcement point position
		(assign, ":min_distance_1", 100000),
		(try_for_agents,":cur_agent"),
			(agent_is_alive, ":cur_agent"),
			(agent_is_human, ":cur_agent"),
			(agent_get_team, ":agent_team", ":cur_agent"),
			(eq, ":agent_team", 1),
			(agent_get_position, pos2, ":cur_agent"),
			(get_distance_between_positions,":cur_dist",pos2,pos10),
			(lt, ":cur_dist", ":min_distance_1"),
			(assign, ":min_distance_1", ":cur_dist"), #gets closest distance to 
			(assign, "$closestagent", ":cur_agent"),
		(try_end),
		(le, ":cur_dist", 2350), #within 23.5 meters of reinforcement, tweakable
		(assign, "$firenow", 2),
	(else_try),
		(eq, "$g_stop_ballista_fire", 0), 
		(assign, "$firenow", 1),
	(try_end),
	
	(this_or_next|eq, "$firenow", 1),
	(eq, "$firenow", 2),
		
	#conditions 3
	(assign, ":artillerycrew", 0),
	(assign, ":artillerycrewelite", 0),
	(assign, ":ballistakills", 0),
	(try_for_range,":instance_no",0,":num_instances"),
        (scene_prop_get_instance,":ballista_instance","spr_ballista_loaded",":instance_no"),
		(prop_instance_get_position, pos6, ":ballista_instance"),
		(try_for_agents, ":agent"),
			(agent_is_human, ":agent"),
			(agent_is_alive, ":agent"),
			(agent_get_team, ":team1", ":agent"),
			(eq, ":team1", 2),
			(agent_get_troop_id, ":troop", ":agent"),
			(try_begin),
				(this_or_next|eq, ":troop", "trp_roman_ballista"),
				(eq, ":troop", "trp_roman_gaul_ballista"),
				(agent_get_position, pos11, ":agent"),
				(get_distance_between_positions, ":dist", pos11, pos6),
				(le, ":dist", 700), #7 meter radius
				(val_add, ":artillerycrew", 1),	
				(agent_play_sound, ":agent", "snd_yellnew"),
				(agent_get_troop_id, "$bal_killer_troop", ":agent"),
			(else_try),
				(this_or_next|eq, ":troop", "trp_roman_gaul_elite_ballista"),
				(eq, ":troop", "trp_roman_elite_ballista"),
				(agent_get_position, pos11, ":agent"),
				(get_distance_between_positions, ":dist", pos11, pos6),
				(le, ":dist", 700), #7 meter radius
				(val_add, ":artillerycrew", 1),	
				(val_add, ":artillerycrewelite", 1),
				(agent_play_sound, ":agent", "snd_yellnew"),
				(agent_get_troop_id, "$bal_killer_troop", ":agent"),
			(try_end),
		(try_end),
		(ge, ":artillerycrew", 3), #engineers nearby
		
		#calculate target
		(try_begin),
			(eq, "$firenow", 1),
			(assign, ":counter", 0),
			(try_for_agents,":enemy_agent"),
				(agent_is_alive, ":enemy_agent"),
				(agent_is_human, ":enemy_agent"),
				(agent_get_team, ":enemy_team", ":enemy_agent"),
				(teams_are_enemies, ":enemy_team", 2),
				(val_add,":counter",1),
			(try_end),
			(store_random_in_range,":random",0,":counter"),
			(try_for_agents,":enemy_agent"),
				(agent_is_alive, ":enemy_agent"),
				(agent_is_human, ":enemy_agent"),
				(agent_get_team, ":enemy_team", ":enemy_agent"),
				(teams_are_enemies, ":enemy_team", 2),
				(try_begin),
					(eq,":counter",":random"),
					(agent_get_position, pos0, ":enemy_agent"),
				(try_end),
				(val_add,":counter",1),
			(try_end),
		(else_try),
			(eq, "$firenow", 2),
			(agent_get_position, pos0, "$closestagent"),
		(try_end),
		
		#spawning a rock, shooting it
		(set_spawn_position, pos6),
		(spawn_scene_prop, "spr_ballista_ammo_rock"),
		(scene_prop_get_instance, ":ammo", "spr_ballista_ammo_rock", 0), #we should be only using 1
	
		(store_random_in_range,":random",1,4), #1, 2 or 3
		(try_begin),
			(eq, ":random", 3),
			(prop_instance_animate_to_position,":ammo",pos0,4000), #takes 2 seconds
		(else_try),
			(position_get_x, ":x", pos0),
			(store_random_in_range, ":range", 1, 11), #1 to 10
			(try_begin),
				(gt, ":artillerycrewelite", 3), #only three troops actually fire the thing
				(assign, ":artillerycrewelite", 3),
			(try_end),
			(try_begin), #if ballista troops are elite that delivers a accurary bonus
				(gt, ":range", ":artillerycrewelite"),
				(val_sub, ":range", ":artillerycrewelite"),
				(val_add, ":x", ":range"),
				(position_set_x,pos0,":x"),
			(try_end),
		(try_end),
		(position_set_z, pos0, 100000),
		(position_set_z_to_ground_level,pos0),
		(prop_instance_animate_to_position,":ammo",pos0,5000), #takes 5 seconds
		
		#damage and effects
		(try_for_agents, ":agent"),
			(agent_is_alive, ":agent"),
			(agent_get_team, ":team"),
			(neq, ":team", 2), #defender in our situation
			(get_player_agent_no, ":player"),
			(neq, ":agent", ":player"),
			(agent_get_position, pos7, ":agent"),
			(get_distance_between_positions, ":distance", pos7, pos0),
			(le, ":distance", 132), #within 1.29 meter
			(val_add, ":ballistakills", 1),
			(agent_set_animation, ":agent", "anim_shield_strike"),
			(agent_play_sound, ":agent", "snd_man_hit"),
			(particle_system_burst, "psys_decap_blood", pos7, 10),
			(particle_system_burst, "psys_decap_blood", pos7, 10),
			(particle_system_burst, "psys_decap_blood", pos7, 10),
			(particle_system_burst, "psys_decap_blood", pos7, 10),
			(agent_deliver_damage_to_agent, "$bal_killer_troop", ":agent", 10000), #so youre pretty much dead
			(agent_deliver_damage_to_agent, "$bal_killer_troop", ":agent", 10), #to confirm the kill
		(try_end),
		(play_sound_at_position, "snd_ballista1", pos6), #bow release ballista variant
		(particle_system_burst, "psys_dummy_straw", pos6, 100), 
		(play_sound_at_position, "snd_ballista1", pos0),
		(particle_system_burst, "psys_broken_stones_a", pos0, 4),
		(particle_system_burst, "psys_broken_stones_b", pos0, 4),
		(particle_system_burst, "psys_broken_stones_c", pos0, 4),
		(store_random_in_range,reg1,0,4),
		(val_add,reg1,"snd_cannon_shot1"),
		(play_sound,reg1),	
	(try_end),
	
	#total notification
	(try_begin),
		(assign, reg11, ":ballistakills"),
		(gt, reg11, 0),
		(set_show_messages, 1),
		(display_message, "@A ballista strike killed {reg11} friendlies!", 0xf7f723),
		(set_show_messages, 0),
	(try_end),
	])

then i had a preparation mission template for my mod, sticking it into any ti_once which is called in every siege battle however also does the trick.
notice you only need the stop ballista fire = 0, the rest is just to illustrate suggested usage

Code:
common_battle_prepare = (
  ti_once, 0, 0, [],
  [
  (assign, "$rageused", 0), #reset every battle
  (assign, "$kill", 0), #reset first blood
  (assign, "$g_stop_ballista_fire", 0),
  (assign, "$notificationmode", 0),
  (assign, "$refill", 0),
  (assign, "$dead_enemies", 0),
  (assign, "$dead_enemiest", 0),
  (assign, "$dead_friendlies", 0),
  (assign, "$dead_friendliest", 0),
  ])


then in module_scripts search for
Code:
cf_siege_move_belfry
in this script add the g_stop_ballista_fire at  the end like down here
Code:
          (position_transform_position_to_parent, pos2, pos1, ":pos_no"),
          (prop_instance_animate_to_position, ":cur_belfry_object", pos2, ":belfry_speed"),
        (try_end),
      (try_end),
    (try_end),
    (gt, "$cur_belfry_pos", 55),
    (assign, "$belfry_positioned", 1),
    (assign, "$g_stop_ballista_fire", 1),