Freelancer pack

A place to discuss mods in development and concepts for new mods.
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

BTW, is there a way to change the standard shield hit effects and sound?
Glad you asked >:D
I got this idea from DSMK2 and it's used for his dreadnought.
I have (maybe will?) used it in my personal mod and here's some code for you to test out:

Code: Select all

				<ItemType 
						name=				"Honzavesely gunship shield"
						level=				"2"
						value=				"0"
						mass=				"3139"
						frequency=			"common"
						attributes=			"Honzavesely; MinorEquipment; HonzaveselyMinorEquipment; "

						description=		"This shield is used by Honzavesely gunships."

						
						>

					<Image imageID="&rsItemsEI1;" imageX="0" imageY="0" imageWidth="96" imageHeight="96"/>

					<Shields
							hitPoints=		"46"
							regen=			"37"
							depletionDelay=	"318"
							powerUse=		"136"
							/>
				
			
				<Events>
						
							<OnShieldDamage>
								(block Nil
									(sysCreateEffect &efBeamAbsorb; gSource aHitPos)
									)
							</OnShieldDamage>
							
				</Events>
			
				
				</ItemType>
				
				
	<Effect UNID="&efBeamAbsorb;">
		<Shockwave
				style=			"image"
				lifetime= "15"
				fadeStart = "40"
				speed=			"7"
				>
			<Image imageID=				"&rsShatterShockwave;"
					imageX=				"0" 
					imageY=				"0" 
					imageWidth=			"512" 
					imageHeight=		"128"
					/>
		</Shockwave>
	</Effect>
All you have to do is make the effects and stick them in the shield's event ;)
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Autohummer
Militia Lieutenant
Militia Lieutenant
Posts: 238
Joined: Fri Jan 06, 2012 10:51 am

Thanks. I think I can extract the shield effects straight from FL, I think it's just a flat texture. Now all that is left are the countermeasures and the cruise engines and the cruise disruptor.

(Unrelated discussion: The mining drone on that Dreadnought may be useful for making a resource collector?)
Has resurfaced!
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Yes, I was thinking about using that code as well. ;)
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Autohummer
Militia Lieutenant
Militia Lieutenant
Posts: 238
Joined: Fri Jan 06, 2012 10:51 am

Code: Select all

		<Weapon
				type=				"particles"
				damage=				"laser:1"
				fireRate=			"7"
				missileSpeed=		"99"
				lifetime=			"30"
				powerUse=			"4"
				particleCount=		"1"

				sound= "&snLaserCannon;">		
			<effect>
				<MoltenBolt
                 		 width=            "4"
                 		 length=            "20"
                  		 growth=            "3"
                  		 primaryColor=      "0x99, 0x66, 0x33"
                  		 secondaryColor=      "0xCC, 0x99, 0x00"
                  		/>
            			<ParticleComet
                 		particleCount=   "30"
                  		primaryColor=   "0xcc, 0xcc, 0x00"
                 		width=         "8"
                  		length=         "120"
                  		/>
			</effect>
		</Weapon>
I tried firing this, but no projectile comes out, what is wrong?
Has resurfaced!
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

This works:

Code: Select all

<ItemType UNID="&ittest;"
			name=				"test item"
			level=				"7"
			value=				"0"
			mass=				"4000-"
			frequency=			"notrandom"
			modifiers=			"MajorItem; SolarReactor; NotForSale;"

			description=		"A weapon best used against spams."
			>
		<Image imageID="&rsItems1;" imageX="96" imageY="0" imageWidth="96" imageHeight="96"/>

		<Weapon 
            type=            "missile"
            damage=            "laser:1"
            fireRate=         "7"
            missileSpeed=      "99"
            lifetime=         "30"
            powerUse=         "4"
            particleCount=      "1"

            sound= "&snLaserCannon;">      
         <Effect>
            <MoltenBolt
				width=           	 "4"
				length=           	 "20"
				growth=           	 "3"
				primaryColor=     	 "0x99, 0x66, 0x33"
				secondaryColor=      "0xCC, 0x99, 0x00"
				/>
			 <ParticleComet
				particleCount=  	"30"
				primaryColor=  		"0xcc, 0xcc, 0x00"
				width=         		"8"
				length=        		"120"
				/>
         </Effect>
      </Weapon>
	  </Itemtype>
Basically change type= to missiles.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Autohummer
Militia Lieutenant
Militia Lieutenant
Posts: 238
Joined: Fri Jan 06, 2012 10:51 am

Code: Select all

	<ItemType UNID="&itadvdebilitator;"
			name=				"CP-d 'Debilitator' Civilian Advanced Pulse Cannon"
			level=				"7"
			value=				"22310"
			mass=				"1000"
			modifiers=			"EnergyWeapon; MajorItem;"
			frequency=			"common"
			showReference=		"true"
			omnidirectional=	"true"
			description=		"This is a pulse-based weapon that does enormous amounts of shield damage, but virtually no hull damage. This 

weapon is most effective against positron shields, and weakest against graviton shields. This is the best Civilian Pulse Cannon available."
			sortName=			"pulse cannon, civilian"
			>

		<Image imageID="&rsweaponicon;" imageX="0" imageY="0" imageWidth="70" imageHeight="68"/>

		<Weapon
				type=				"beam"
				damage=				"generic:2"
				fireRate=			"15"
				lifetime=			"30"
				powerUse=			"47"
				particleCount=		"1"

				sound= "&snpulse4;">	
			<events>
				<OnDamageShields>
				(setq aShieldDamageHP 80)
				</OnDamageShields>
			</events>	
			<effect>
				<Starburst
               style=         "morningStar"
               spikeCount= "1d10"
               spikeLength= "1d10"
               primaryColor=      "0x00, 0xf7, 0xff"
               secondaryColor=      "0xff, 0xff, 0xff"
               />
			   </effect>
		</Weapon>

	</ItemType>	
This oddly makes the pulse cannon a shield-bypassing hull-buster instead of a shield-busting, hull-scratching weapon.
Has resurfaced!
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I think the problem is that generic damage isn't really blocked... :/
You could probably set the damage to laser:0 and since the script does the shield damage for you if it hits hull it won't do any damage.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

you might want to use special damage modifiers too.
http://transcendence.kronosaur.com/wiki ... descriptor

Code: Select all

damage=            "generic:2;shield9"
the shield descriptor will multiply the damage to the shields, giving low damage to armors and high to shields.

Since you are making a conversion, you might also take a damage type for shield buster weapons (such as ion ?) and then make all your armors partially immune or highly resistant to ion, achieving the same effect.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

You're passing damage improperly.

aShieldDamageHP is not a return value. Changing it has no effect. What does damage is what is returned.

[quote=wiki]<OnDamageShields>

This event is called when a projectile from this weapon hits the shields on a ship.

If the event returns Nil, the shields process the damage normally.

If the event returns an integer, then the shields are by-passed and the value is interpreted as the amount of damage to do to armor.

If the event returns the string “reflect”, then the projectile is reflected and neither shields nor armor take any damage.

If the event returns a list, then the list must have three elements. The first element is either the string “reflect” or Nil. The second element is the number of HP to subtract from the current shield level. The third element is the number of HP to do to armor.[/quote]

Your last statement is your return value, in this case setq returns 80 so the event returns 80 and 80 damage bypasses the shields completely.

What you want is:

Code: Select all

(list nil 80 0)
Literally is the new Figuratively
User avatar
Autohummer
Militia Lieutenant
Militia Lieutenant
Posts: 238
Joined: Fri Jan 06, 2012 10:51 am

Thanks, the code worked like a charm.


Here is the Beta version of the Civilian ship pack. Only Civilian guns and ships are included.

http://www.sendspace.com/file/4uvddg
Has resurfaced!
User avatar
Autohummer
Militia Lieutenant
Militia Lieutenant
Posts: 238
Joined: Fri Jan 06, 2012 10:51 am

Is there a way to make the shield play a different sound depending on the amount of damage it takes in one hit?
Has resurfaced!
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Yeah, in the OnshieldHit event (or something similar), you can insert code that looks like this

Code: Select all

(switch
	(check for damage here)
		(sysPlaySound blah blah blah)
	(check for damage here)
		(sysPlaySound blah blah blah)
	(check for damage here)
		(sysPlaySound blah blah blah)
	)
and it should play according to damage.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Autohummer
Militia Lieutenant
Militia Lieutenant
Posts: 238
Joined: Fri Jan 06, 2012 10:51 am

Shields now added, though I still don't know how to get the hit sounds to work.

Next on the to-do list are missiles and torpedoes. Stay tuned.

http://www.sendspace.com/file/vnhgke

A snag that I hit is that the game seems to be unable to load the .wav files from the resources folder. Any pointers for solving this?
Has resurfaced!
User avatar
Autohummer
Militia Lieutenant
Militia Lieutenant
Posts: 238
Joined: Fri Jan 06, 2012 10:51 am

I figured it out, Transcendence would not read compressed .wav files, they must be converted to an uncompressed format before it is usable.

I'm trying to get the shield to play a sound when it takes 1-9, 10-49 and >50 damage, but the code below doesn't work.

Code: Select all

			<OnshieldDamage>
				(block Nil
				aShieldDamageHP 
					(switch
						(gr aShieldDamageHP 1)
							;(sysPlaySound &snsh_li01;)
						(gr aShieldDamageHP 10)
							;(sysPlaySound &snsh_li02;)
						(gr aShieldDamageHP 50)
							;(sysPlaySound &snsh_li03;)							
					)
				)
			</OnshieldDamage>
Has resurfaced!
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Try this:

Code: Select all

		<OnshieldDamage>
            (block Nil
               (switch
                  (gr aShieldDamageHP 1)
                     (sysPlaySound &snsh_li01;)
                  (gr aShieldDamageHP 10)
                     (sysPlaySound &snsh_li02;)
                  (gr aShieldDamageHP 50)
                     (sysPlaySound &snsh_li03;)                     
               )
			   aShieldDamageHP
            )
         </OnshieldDamage>
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Post Reply