[Mod Request] Fireworks Mod

A place to discuss mods in development and concepts for new mods.
Post Reply
User avatar
0xABCDEF
Commonwealth Pilot
Commonwealth Pilot
Posts: 93
Joined: Thu May 19, 2016 12:58 am
Location: Was destroyed by a Phobos-class dreadnought in the Eridani system

Wed Jul 05, 2017 5:41 am

I had the idea of implementing various missiles with firework-like effects for a US Independence Day themed mod. These missiles would have randomly colored explosions, fragments, and particles in order to imitate the various fireworks I see on the 4th of July. However, I do not have much experience with EffectType.

Code: Select all

<OnFireWeapon>
	(gamEnd Nil "encountered an unexpected error")
</OnFireWeapon>
-Command Screen Library: RTS in a dockscreen
-Extended Justice: A safer Commonwealth for all
-Playership Bones: Revisit your old ship wrecks!
-Please help out our official Documentarist (me) by editing the wiki

PM
Fleet Admiral
Fleet Admiral
Posts: 2239
Joined: Wed Sep 01, 2010 12:54 am

Wed Jul 05, 2017 6:00 pm

primaryColor and secondaryColor can be set within the <GetParameters> event of some effects. Value might be in string form, and might need to concatenate strings. "#" <red hexadecimal value from 0-255, or 00-ff> <green hexadecimal value> <blue hexadecimal value>.

You may need some way to convert normal decimal values to hexadecimal.

I made some fireworks style weapons for Drake Technologies Alpha and Item Pack 912 years ago before I phased them out, but some of the code I used is still present.

Just simply picking random colors results in a pastel-like rainbow colors. You may want to select color based on a timestamp or some other criteria. Or it could be something fixed, simple, but bulky like having multiple <Fragments> that are the same except for color.
Download and Play in 1.7 Beta...
Playership Drones v7 (Beta): Acquire and command almost any ship in Stars of the Pilgrim or Eternity Port.
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Relive classic arcade gaming in a new Transcendence adventure!
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1411
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Fri Jul 07, 2017 2:51 am

PM wrote:
Wed Jul 05, 2017 6:00 pm
primaryColor and secondaryColor can be set within the <GetParameters> event of some effects. Value might be in string form, and might need to concatenate strings. "#" <red hexadecimal value from 0-255, or 00-ff> <green hexadecimal value> <blue hexadecimal value>.

You may need some way to convert normal decimal values to hexadecimal.

I made some fireworks style weapons for Drake Technologies Alpha and Item Pack 912 years ago before I phased them out, but some of the code I used is still present.

Just simply picking random colors results in a pastel-like rainbow colors. You may want to select color based on a timestamp or some other criteria. Or it could be something fixed, simple, but bulky like having multiple <Fragments> that are the same except for color.
And hopefully I can help out here too :)

170 colors ( found in Shipyards)
http://forums.kronosaur.com/viewtopic.php?f=5&t=7665

Examples :
you will notice that you can set color / colors , opacity of those colors
configuration of shot, muzzle flash :
type of style : Plain, jagged, flare, spray, cloud, etc....

Code: Select all

			<Effect>
				<Particle
						style=			"plain"
						minWidth=		"3" 
						maxWidth=		"6"
						primaryColor=	"0xfc, 0xe8, 0x87"
						secondaryColor=	"0x85, 0x0c, 0x0f"
						/>
			</Effect>
			

Code: Select all

		<Weapon
				type=				"missile"

				repeating=			"4"
				damage=				"ion:1d8"
				fireRate=			"15"
				missileSpeed=		"100"
				lifetime=			"60"
				interaction=		"0"
				powerUse=			"650"

				sound=				"&snLaserCannon;"
				>

			<Effect>
				<Ray
						style=			"jagged"
						shape=			"tapered"
						length=			"108"
						
						primaryColor=	"#00d5ff"
						secondaryColor=	"#006b80"
						>
					<Events>
						<GetParameters>
							(block (
								(damageHP (@ gData 'damageHP))
								)
								{
									width: (mathScale damageHP 10 140 20 40 50)
									intensity: 60
									}
								)
						</GetParameters>
					</Events>
				</Ray>
			
				<ParticleComet
						particleCount=	"200"
						primaryColor=	"#00d5ff"
						>
					<Events>
						<GetParameters>
							(block (
								(damageHP (@ gData 'damageHP))
								)

								{
									particleCount: (mathScale damageHP 10 140 100 300 50)
									length: 72 ;(mathScale damageHP 10 140 60 220 50)
									width: 15
									}
								)
						</GetParameters>
					</Events>
				</ParticleComet>
			</Effect>
		</Weapon>

Code: Select all

		<Weapon
				type=				"missile"

				repeating=			"4"
				damage=				"positron:2d8"
				fireRate=			"20"
				missileSpeed=		"90"
				lifetime=			"34"
				interaction=		"0"
				powerUse=			"3500"

				sound=				"&snLaserCannon;"
				>

			<Effect>
				<Shape
						directional=		"true"
						scaleLength=		"72" 
						scaleWidth=			"6"

						scaleLengthInc=		"3" 

						color=				"0x00, 0x80, 0x80"
						opacity=			"140"
						>
					<Point x="0"	y="0"/>
					<Point x="-35"	y="50"/>
					<Point x="-100"	y="0"/>
					<Point x="-35"	y="-50"/>
				</Shape>

				<Shape
						directional=		"true"
						scaleLength=		"72" 
						scaleWidth=			"4"

						scaleLengthInc=		"3" 

						color=				"0x00, 0x80, 0x80"
						opacity=			"255"
						>
					<Point x="0"	y="0"/>
					<Point x="-35"	y="50"/>
					<Point x="-100"	y="0"/>
					<Point x="-35"	y="-50"/>
				</Shape>

				<Shape
						directional=		"true"
						scaleLength=		"64" 
						scaleWidth=			"3"

						scaleLengthInc=		"3" 

						color=				"0x00, 0x80, 0x80"
						opacity=			"255"
						>
					<Point x="0"	y="0"/>
					<Point x="-25"	y="50"/>
					<Point x="-100"	y="0"/>
					<Point x="-25"	y="-50"/>
				</Shape>
			</Effect>
		</Weapon>
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2604
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Wed Jul 12, 2017 11:53 pm

I've been playing with <GetParameters> and effects for a while.
I do have random colored weapons, rainbow weapons and a number of supporting functions in WE6 such as:
- RGB to HSL converter.
- dec to hex to dec (taken from alterecco's DSF, and fixed because it has a bug)
- function that converts '(0xAA 0xBB 0xCC) to "#AABBCC" color formats
- colornamer function with over 1000 names of colors. (converted to transLisp from a javascript function)

Post Reply