Code: Select all
<Tshark> Repeating dubs
<Tshark> Also, the shots didn't appear for some reason
<Avan> yes, just like when you put it in the 'sound='?
<Tshark> Yup
<Avan> Right
<Tshark> You did warn me about it
<Avan> thats supposed to happen
<Tshark> K
<Tshark> So, there's no way to make a sound gun like that?
<Avan> There is no way to get it to play
<Tshark> Also, the laser shots didn't appear
<Avan> and then stop playing
<Tshark> I see
<Avan> once you stop shotting
<Avan> *Shooting
<Avan> unless you stop shooting at the same time
<Avan> that the track ends
<Tshark> Hmm
<Tshark> Wait a minute
<Tshark> There is a uiStopMusic
<Tshark> And a uiPlayMusic
<Avan> hm, that should do what you want
<Tshark> But I need to figure out how to make it stop when I stop shooting
<Avan> Just create a virtual station
<Avan> then each time the weapon is fired
<Avan> search the system for a station with that exact unid
<Avan> cancel any pending events
<Avan> on that station
<Avan> then do a timer event to run in 60 ticks (1 second) or so
<Avan> that event, when it fires, will just run uiStopMusic
Code: Select all
<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
[
<!ENTITY unidExtension "0xDEF3FF00">
<!ENTITY itDubstepGun "0xDEF3FF01">
<!ENTITY Dubstep "0xDEF3FF03">
]>
<TranscendenceExtension UNID="&unidExtension;" version="1.0" name="DubstepGun" credits="Tshark">
<ItemType UNID="&itDubstepGun;"
name= "dubstep gun"
level= "7"
value= "50000"
mass= "75000"
omnidirectional= "true"
frequency= "rare"
modifiers= "EnergyWeapon; Military; MajorItem"
showReference= "true"
description= "Dubstep guns fire condensed, explosive sound waves using specialized foci."
>
<Image imageID="&rsItems1;" imageX="96" imageY="0" imageWidth="96" imageHeight="96"/>
<Weapon
type= "beam"
damage= "ion:2d6+6; momentum1"
fireRate= "7"
omnidirectional= "true"
lifetime= "50"
powerUse= "50"
>
<Effect>
<Beam
beamType= "blueparticle"
/>
</Effect>
</Weapon>
<Events>
<onFireWeapon>
(block nil (if (eq gSource gPlayership) (sysPlaySound &Dubstep; gPlayership)))
</onFireWeapon>
</Events>
</ItemType>
<ShipClass UNID="&scSapphirePlayer;"
manufacturer= "Zubrin Systems"
class= "Sapphire"
type= "yacht"
score= "95"
mass= "30"
reactorPower= "150"
fuelCapacity= "37500"
cargoSpace= "50"
thrust= "150"
rotationCount= "40"
maneuver= "2"
maxSpeed= "20"
maxArmor= "6000"
maxCargoSpace= "150"
maxDevices= "8"
leavesWreck= "30"
attributes= ""
>
<Armor>
<ArmorSection start="315" span="90" armorID="&itReactiveArmor;" areaSet="0,2" />
<ArmorSection start="225" span="90" armorID="&itReactiveArmor;" areaSet="3,4" />
<ArmorSection start="45" span="90" armorID="&itReactiveArmor;" areaSet="7,13" />
<ArmorSection start="135" span="90" armorID="&itReactiveArmor;" areaSet="1,6" />
</Armor>
<Devices>
<Device deviceID="&itDubstepGun;"/>
<Device deviceID="&itClass1Deflector;"/>
</Devices>
<Items>
<Item count="4d6" item="&itHelium3FuelRod;"/>
</Items>
<AISettings
fireRateAdj= "30"
fireAccuracy= "90"
perception= "4"
/>
<Image imageID="&rsSapphireYacht;" imageX="0" imageY="0" imageWidth="48" imageHeight="48"/>
<DriveImages>
<NozzleImage imageID="&rsDriveExhaust2;" imageX="0" imageY="0" imageWidth="48" imageHeight="48"/>
<NozzlePos x="-28" y="-4"/>
<NozzlePos x="-28" y="5"/>
</DriveImages>
<PlayerSettings
desc= "The versatile Sapphire yacht strikes a good balance between a gunship and a freighter."
largeImage= "&rsZubrinLarge;"
initialClass= "true"
startingCredits= "10d100+1000"
startingSystem= "SE"
startingPos= "Start"
>
<ArmorDisplay>
<ArmorSection name="forward"
imageID="&rsZubrinArmor;"
imageX="0" imageY="0" imageWidth="52" imageHeight="29"
destX="42" destY="15" hpX="55" hpY="14"
nameY="8" nameBreakWidth="200" nameDestX="0" nameDestY="10" />
<ArmorSection name="starboard"
imageID="&rsZubrinArmor;"
imageX="52" imageY="0" imageWidth="22" imageHeight="59"
destX="92" destY="45" hpX="95" hpY="60"
nameY="30" nameBreakWidth="360" nameDestX="12" nameDestY="0" />
<ArmorSection name="port"
imageID="&rsZubrinArmor;"
imageX="142" imageY="0" imageWidth="22" imageHeight="59"
destX="22" destY="45" hpX="15" hpY="60"
nameY="52" nameBreakWidth="200" nameDestX="0" nameDestY="8" />
<ArmorSection name="aft"
imageID="&rsZubrinArmor;"
imageX="74" imageY="0" imageWidth="68" imageHeight="14"
destX="34" destY="103" hpX="55" hpY="105"
nameY="74" nameBreakWidth="360" nameDestX="12" nameDestY="0" />
</ArmorDisplay>
<ShieldDisplay>
<Image imageID="&rsZubrinShields;" imageX="0" imageY="0" imageWidth="136" imageHeight="136"/>
</ShieldDisplay>
<ReactorDisplay>
<Image imageID="&rsZubrinReactor;"
imageX="0" imageY="0" imageWidth="256" imageHeight="60"/>
<PowerLevelImage imageID="&rsZubrinReactor;"
imageX="0" imageY="60" imageWidth="202" imageHeight="14"
destX="54" destY="9"/>
<FuelLevelImage imageID="&rsZubrinReactor;"
imageX="0" imageY="74" imageWidth="194" imageHeight="14"
destX="54" destY="37"/>
<FuelLowLevelImage imageID="&rsZubrinReactor;"
imageX="0" imageY="88" imageWidth="194" imageHeight="14"/>
<ReactorText x="62" y="22" width="154" height="14"/>
<PowerLevelText x="62" y="0" width="154" height="9"/>
<FuelLevelText x="62" y="51" width="154" height="9"/>
</ReactorDisplay>
</PlayerSettings>
</ShipClass>
<Sound UNID="&Dubstep;" filename="Dubstep.wav"/>
</TranscendenceExtension>
PS: I am an absolute newb lord at coding, I literally just started yesterday by reading a few tutorials, so please explain what you mean in your reply. Thanks!