In it’s wisdom, CA provided us with the banana shot and through the crusades campaign the grape shot as well (must have been a fruit day). Whereas the first one works quite well, weird as it is, the second one does not.
I will now try to simplify the way to achieve functionality for this shot variety, explaining the connections between files on the way.
-------------------------------------------------
In figure 1 I have taken the entry for the NE Bombard unit from the crusades campaign and highlighted the regular shot and the grapeshot.
Figure 1type NE Bombard
dictionary NE_Bombard ; Bombard
category siege
class missile
voice_type Light
banner faction main_missile
banner holy crusade
soldier NE_Bombard_Crew, 16, 2, 1
engine bombard
attributes sea_faring, hardy, can_withdraw, gunpowder_unit, cannon, artillery
formation 1.5, 1.5, 3, 3, 3, square
stat_health 1, 0
stat_pri 7, 3, no, 0, 0, melee, artillery_gunpowder, piercing, knife, 25, 1.8
;stat_pri_ex 0, 0, 0
stat_pri_attr no
stat_sec 55, 3, bombard_shot, 325, 30, siege_missile, artillery_gunpowder, blunt, none, 25, 1
;stat_sec_ex 0, 0, 0
stat_sec_attr ap, bp, area, launching
stat_ter 65, 3, grape_shot, 115, 10, siege_missile, artillery_gunpowder, blunt, none, 26, 1
;stat_ter_ex 0, 0, 0
stat_ter_attr ap, launching
Figure 2 shows the entry for grape shot in the descr_projectiles file. Note the highlighted entry <area_effect> entry at the bottom. This means that a certain effect is needed for this shot.
Figure 2projectile grape_shot
;effect bombard_set
end_effect bullet_impact_ground_set
end_man_effect man_impact_tiny_set
end_package_effect bullet_impact_wall_set
end_shatter_effect bullet_impact_ground_set
end_shatter_man_effect man_impact_tiny_set
end_shatter_package_effect bullet_impact_wall_set
damage 120
damage_to_troops 100
radius 0.3
mass 1.0
area 2.0
accuracy_vs_units 0.0725
accuracy_vs_buildings 0.0455
accuracy_vs_towers 0.025
min_angle -15
max_angle 25
velocity 20 50
bounce 0.01 0.01 0.93 0.5
grapeshot
; self_explode <prob> <min sec> <max sec> [<area effect>]
self_explode 1.0 0.1 0.1 grape_shot
display aimed
;effect_only
; Stuck model not used at the mo, shatter effect is better, but adding some shatter debris for ground impact would be good?
;stuck
effect_only
In figure 3 the effect for the grape shot is detailed. And here was the major fault: the highlighted musket_bullet entry was originally “grape_shot”. This caused a circular reference (known to anybody who has worked with spreadsheets) between the descr_projectile file and the descr_area_effects. Changing it to the entry shown below fixes this.
Figure 3<area_effect>
<name>grape_shot</name>
<type>projectile</type>
<projectile_type>musket_bullet</projectile_type>
<explosion_force_min>0.5</explosion_force_min>
<explosion_force_max>1.5</explosion_force_max>
<preserve_momentum>true</preserve_momentum>
<direction>horizontal</direction>
<scatter_angle>45</scatter_angle>
<projectile_number>60</projectile_number>
</area_effect>
The spoilers underneath (figure 4) show a movie from our 1648 mod and a screenshot during research for this function - the projectiles on their way to the hapless unit.
Spoiler for the movie:
Figure 4Spoiler for the picture:
Should you wish to transfer this feature to a mod, the following files (found in the attachments) will be required:
1.Descr_area_effects.xml - contains the corrected entry
2.Descr_flaming_projectiles - kingdoms file for flaming projectiles
3.Descr_projectiles.txt - kingdoms file for projectiles
4.Grape.cas - 3D model for the grape shot, the texture is a standard ‘vanilla’ file
5.Shared.txt - contains the tooltip (custom battle) for the grapeshot
6.Battlepage_03.tga - contains the special function button for grape shot
7.Battle.sd - contains the location details for the special function graphic
One note for the user: due to some programming quirk the use of grape shot requires that either a flaming or an exploding projectile is present. In the case of bombard_shot as in figure 1 CA provided us with the flaming_bombard_projectile. Other cannon shots have not got that second type of projectile and therefore the grapeshot will not work.
I have added “exploding_serpentine_shot” and “exploding_culverin_shot” to the descr_projectile file. You can therefore use the grape shot feature with any cannon that uses either serpentine_shot or culverin_shot. Other varieties can be added according to your need and knowledge.
This has been another tutorial by gigantus
Download Link, contains the following:
- GrapeShot = files discussed in this article
- Creating a World - Functional Grape Shot = this article
.