fire_rate coding
Posted: Tue Aug 30, 2011 3:56 pm
Howdy all,
I've been having some fun hacking the Caduceus shipdata, trying to make it just a 'little' more über ...
I'm not being lucky regarding specifying the
Here's a snippet for the main ship entity of my modified
And here's the turret code where I'm experimenting with
The ship is already working overall (minus the fire_rate override), now with ten turrets in six different colors (yeah, I KNOW it's quite corny indeed ). But what I'd like to achieve is to have different fire rates for each turret, so that even if the fire_rate differences are not that much significant, it would turn out a beautiful, chaotic out-of-sync effect.
I suspect that the fire_rate thing would fit better in the main ship entity, alongside the quaternion specs of zeroturretD... would anyone care to provide examples and/or coding suggestions ? (Just bear in mind that I'm not an OXP'er, just a copy-paste-tweak guy ).
Cheers
I've been having some fun hacking the Caduceus shipdata, trying to make it just a 'little' more über ...
I'm not being lucky regarding specifying the
[b][color=#0000FF]fire_rate[/color][/b]
parm... the only previously-made examples I could gather use a syntax which is different than the one in the Caddy OXP.Here's a snippet for the main ship entity of my modified
[b][color=#0000FF]shipdata.plist[/color][/b]
:Code: Select all
<!-- ############################################################################################################################################### -->
<!-- DARK RAINBOW - PLAYER VERSION -->
<!-- (more cargo, more missiles, more turrets (with more COLORS !!!) than Caduceus Omega) -->
<!-- ############################################################################################################################################### -->
<key>dark-rainbow-mk1-player</key>
<dict>
<key>aft_eject_position</key>
<string>-0.1985 -5.5002 -57.7762</string>
<key>energy_recharge_rate</key>
<real>5.8</real>
<key>cloak_passive</key>
<false/>
<key>hyperspace_motor_spin_time</key>
<integer>12</integer>
<key>exhaust</key>
<array>
<string>-4.663113 -0.5 -55.1 3.8 3.8 2.0</string>
<string>4.663113 -0.5 -55.1 3.8 3.8 2.0</string>
<string>-4.663113 -0.5 -56.0 1.1 1.1 1.0</string>
<string>4.663113 -0.5 -56.0 1.1 1.1 1.0</string>
</array>
<key>forward_weapon_type</key>
<string>WEAPON_BEAM_LASER</string>
<key>laser_color</key>
<string>greenColor</string>
<key>max_cargo</key>
<integer>150</integer>
<key>extra_cargo</key>
<integer>30</integer>
<key>max_energy</key>
<real>512</real>
<key>max_flight_pitch</key>
<real>0.8</real>
<key>max_flight_yaw</key>
<real>0.8</real>
<key>max_flight_roll</key>
<real>1.8</real>
<key>max_flight_speed</key>
<real>460</real>
<key>scoop_position</key>
<string>0.0 -6.48006 53.297053</string>
<key>missile_launch_position</key>
<string>-3.532853 -10.17446 -12.143362</string>
<key>max_missiles</key>
<integer>16</integer>
<key>model</key>
<string>cbodyg.dat</string>
<key>smooth</key>
<true/>
<key>name</key>
<string>Dark Rainbow</string>
<key>roles</key>
<string>player</string>
<key>thrust</key>
<real>45</real>
<key>view_position_aft</key>
<string>0.0 0.0 -60.1</string>
<key>view_position_forward</key>
<string>0.0 0.0 54.1</string>
<key>view_position_port</key>
<string>-8.59 0.0 0.0</string>
<key>view_position_starboard</key>
<string>8.59 0.0 0.0</string>
<key>weapon_position_forward</key>
<string>0.0 0.0 53.9</string>
<key>weapon_position_aft</key>
<string>0.0 0.0 -59.9</string>
<key>subentities</key>
<array>
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<string>cenginea -4.5 -0.5 -60.5 1 0 0 0</string>
<string>cengineb 4.5 -0.5 -60.7 1 0 0 0</string>
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<string>cmount 0.0 -2.6 26.0 1 0 0 0</string>
<string>cmount 0.0 -2.6 13.0 1 0 0 0</string>
<string>cmount 0.0 -2.6 0.0 1 0 0 0</string><!-- *** mid-ship, front-to-back (0.0 in #3); mid-ship, right-to-left (0.0 in #1) *** -->
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<string>caduceusturret 8.0 -2.7 26.0 1 0 -1 0</string><!-- *** front-most lateral turret (26.0 in #3) ; fires sideways [ 1 0 -1 0] *** -->
<string>caduceusturret 8.0 -2.7 13.0 1 0 -1 0</string><!-- *** middle lateral turret ; fires sideways [ 1 0 -1 0] *** -->
<string>caduceusturret 8.0 -2.7 0.0 1 0 -1 0</string><!-- *** mid-ship, front-to-back (0.0 in #3) ; fires sideways [ 1 0 -1 0] *** -->
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<string>caduceusturretB -8.0 -2.7 26.0 1 0 1 0</string><!-- *** front-most lateral turret (26.0 in #3) ; fires sideways [ 1 0 1 0] *** -->
<string>caduceusturretB -8.0 -2.7 13.0 1 0 1 0</string><!-- *** middle lateral turret ; fires sideways [ 1 0 1 0] *** -->
<string>caduceusturretB -8.0 -2.7 0.0 1 0 1 0</string><!-- *** mid-ship, front-to-back (0.0 in #3) ; fires sideways [ 1 0 1 0] *** -->
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<!-- original top & bottom turrets: both are MORE to the REAR of the ship -->
<string>zeroturret -0.198 -7.8 -32.0 1 -1 0 0</string><!-- *** bottom turret (-7.8 in #2); mid-ship, right-to-left (-0.198 in #1); aft-most (-32.0 in #3); fires downwards [ 1 -1 0 0] *** -->
<string>zeroturretB 0.0 1.4 -14.8 1 1 0 0</string><!-- *** top turret ( 1.4 in #2); mid-ship, right-to-left ( 0.0 in #1); forward-most (-14.8 in #3); fires upwards [ 1 1 0 0] *** -->
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<!-- additional turret: front bottom, fires forward -->
<string>zeroturretC 0.0 -6.9 60.1 1 0 0 1</string><!-- *** bottom turret (-6.9 in #2); mid-ship, right-to-left ( 0.0 in #1); forward-most ( 60.1 in #3); fires forward [ 1 0 0 1] *** -->
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<!-- additional turret: back top, fires backwards -->
<string>zeroturretD -0.198 5.5 -56.0 0 0 1 0</string><!-- *** top turret ( 5.5 in #2); mid-ship, right-to-left (-0.198 in #1); aft-most (-56.0 in #3); fires backwards [ 0 0 1 0] *** -->
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
</array>
<!-- =============================================================================================================================================== -->
<key>shaders</key>
<dict>
[ . . . ]
</dict>
<!-- =============================================================================================================================================== -->
<key>custom_views</key>
<array>
[ . . . ]
</array>
</dict>
<!-- ############################################################################################################################################### -->
[b][color=#0000FF]fire_rate[/color][/b]
:Code: Select all
<!-- =============================================================================================================================================== -->
<!-- 'ZEROTURRETD-NPC's - turret ABOVE ship, on central axe, aft, fires backwards -->
<!-- - not used ANYWHERE - CLONEd into 'ZEROTURRETD's -->
<!-- =============================================================================================================================================== -->
<key>zeroturretD-npc</key>
<dict>
<key>ai_type</key>
<string>nullAI.plist</string>
<key>laser_color</key>
<string>orangeColor</string>
<key>model</key>
<string>zeroturret.dat</string>
<key>smooth</key>
<true/>
<key>name</key>
<string>Zero Turret</string>
<key>roles</key>
<string>ballturret zeroturret</string>
<key>setup_actions</key>
<array>
<string>initialiseTurret</string>
</array>
<key>max_flight_pitch</key>
<real>1</real>
<key>max_flight_yaw</key>
<real>1</real>
<key>max_flight_roll</key>
<real>1</real>
<key>thrust</key>
<real>1</real>
<key>weapon_energy</key>
<real>50</real><!-- *** 50 is maximum for NPC ships *** -->
<key>fire_rate</key>
<real>0.25</real><!-- TEST: interval between shots, in seconds. Default: 0.5. Minimum 0.25 *** -->
<key>accuracy</key>
<real>8</real><!-- *** original value: 5 *** -->
<key>energy_recharge_rate</key>
<real>5</real>
<key>max_energy</key>
<real>200</real>
</dict>
<!-- =============================================================================================================================================== -->
<!-- 'ZEROTURRETD's - turret ABOVE ship, on central axe, aft, fires backwards -->
<!-- - used by DARK RAINBOW - PLAYER and NPC VERSIONs - CLONEd from 'ZEROTURRETD-NPC's -->
<!-- =============================================================================================================================================== -->
<key>zeroturretD</key>
<dict>
<key>like_ship</key>
<string>zeroturretD-npc</string>
</dict>
<!-- ############################################################################################################################################### -->
I suspect that the fire_rate thing would fit better in the main ship entity, alongside the quaternion specs of zeroturretD... would anyone care to provide examples and/or coding suggestions ? (Just bear in mind that I'm not an OXP'er, just a copy-paste-tweak guy ).
Cheers