Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Bobboau on January 21, 2007, 07:36:11 am

Title: weapon effect generator
Post by: Bobboau on January 21, 2007, 07:36:11 am
ok, so I made a little program for fun that will take in a bunch of functions and use them to make a texture, it doesn't have any features for saveing to file, but you can just as easily use preintscreen and paste into PSP or PS.

for more detailed explaination look here (http://www.hard-light.net/forums/index.php/topic,44797.0.htm)

it's syntax goes like this you define a bunch of variables (you can use a variable you have defined in later ones) then you define an output useing some of those variables

@variablename=expression

$output<mode>{
:variablename:
:variablename:
:variablename:
}


here are some specific examples on how you use the two current output modes of rgb and hsl

@R=1-:r:

@red=:R:

@green=:R:*1.1

@blue=:R:*.9

$output<rgb>{
:red:
:green:
:blue:
}

now for hsl mode

@H=:r:/8

@S=(1-:r:)*2

@L=1-:r:

$output<hsl>{
:H:
:S:
:L:
}

there are a handfull of predefined variables, here they are (note case sensitivity)

relitive to the upper left from 0 to 1:
:x: - the x position
:y: - the y position

relitive to the screen center from -1 to 1
:X: - the x position
:Y: - the y position

:r: - distance from center of screen
:ang: - angle from the center (relitive to directly to the right)

I'll probly implement a time variable sometime in the future after I implement file output and allow the screen to be resized.

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: Bobboau on January 21, 2007, 12:57:30 pm
 :blah:...

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: Nuke on January 21, 2007, 06:09:32 pm
hey bob maybe a save to bmp feature would be a good idea :D
Title: Re: weapon effect generator
Post by: Bobboau on January 22, 2007, 03:00:06 am
well I intend to sooner or later, but that will involve probably importing and get running DevIL.
Title: Re: weapon effect generator
Post by: Bobboau on January 22, 2007, 09:13:23 am
got the ability to specify screen size now, as if anyone cared...
if it isn't working tell me,
you need to have your screen color depth set to 32bit.

@R=1-:r:
@H=:R:*.2+:R:*sin(:ang:*3+:R:*5)*.1+.5+cos(tan(:ang:*2+:r:*8))*.05
@S=:r:
@L=1.5*((clamp(:R:*(cos(tan(-:ang:*9+:r:*6))*.2+cos(tan(:ang:*9+:r:*6))*.2+log(tan(:ang:+:r:*5))+log(tan(-:ang:+:r:*10)))))/2+:R:^2-:r:^8)
$output<hsl>{:H::S::L:}

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: Col. Fishguts on January 22, 2007, 10:49:17 am
Heh, nice idea :yes:

Can you generate a Mandelbrot set as a weaponeffect ?
Title: Re: weapon effect generator
Post by: Bobboau on January 22, 2007, 11:01:32 am
if you can write it up as a function of x and y then yes.
Title: Re: weapon effect generator
Post by: DaBrain on January 22, 2007, 11:58:23 am
It's an impressive tool, but I fear I'm way too bad at maths....

I can create some random pictures, but I guess I'll never get what I want.
Title: Re: weapon effect generator
Post by: Bobboau on January 22, 2007, 12:05:53 pm
mostly what I do is just string semi-random functions together with only the vaugest idea what it might do. if you start from one of the simple examples I give you'll probly be able to come up with something, hell, just 1-:r: makes a good plasma ball looking effect
Title: Re: weapon effect generator
Post by: Bobboau on January 22, 2007, 12:47:31 pm
I'm dealing with some people right now, if I can get DevIL staticly linked I'll be able to get file output, then I can start working on animations, and that is were this thing is gona start kicking major ass.
can't wait to star doing animations with this

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: IPAndrews on January 22, 2007, 01:03:57 pm
Great. Now you need a wizard for dumbos so they don't have to get their heads around the maths equations.
Title: Re: weapon effect generator
Post by: Huggybaby on January 22, 2007, 01:07:30 pm
This is going to be HUGE! Kickass work Bobboau.  :yes: :yes:
Title: Re: weapon effect generator
Post by: FlareBaffled on January 22, 2007, 01:14:32 pm
I'm holding my breath for the version that does animations :) If you can put in a range of variables, then the effects that would produce would be potentially stunning!
Title: Re: weapon effect generator
Post by: Huggybaby on January 22, 2007, 02:12:51 pm
Indeed. Once these effects start making their way into mods, it's going to seriously enhance things.
Title: Re: weapon effect generator
Post by: Bobboau on January 23, 2007, 09:24:14 am
:mad: RWARR!!! I _HATE_ haveing to include DLLs I ****ING HATE IT!!!!!! :mad:

anyway, I wasn't able to get a statically linked solution so I just had to go back and link dynamically, which means you need the DevIL libs everywhere on your system cluttering up every file folder that you happen to place my program in, because it's "better" and everyone even remotely connected with DevIL including all other users don't see it my way.
and that pisses me off...
but I've got file saving, it supports tga, jpg, tiff, pcx, and some others, including a few I don't list in the save dialog, I've only tested tga so far though, so that's the only one I can guarantee works.

and technically you can just put the DLLs in you system folder, or somesuch, and it should work for you.

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: Bobboau on January 23, 2007, 09:25:45 am
oh, and goodie, look at that they are too damned big to be atached with my actual file  :rolleyes:

I'll be working on animation next

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: Bobboau on January 23, 2007, 01:32:10 pm
@T=:t:*2*PI
@H=:r:/8+sin(:T:)*.1
@S=1-:r:
@L=clamp((1-:r:+1)^3)*((1-:r:)+clamp(sin(:ang:*6+:r:*9+:T:)*.1+cos((-:ang:+:T:)*6+:r:*9+:T:)*.09))


$output<hsl>{
:H:
:S:
:L:
}

:D
that's for the orange one
videos of animations (video conversion via vurtualdub, there is a bit of compression atrtifacts) in proxb.zip
prox.zip is the executable used, it still requires the DLLs mentioned in the other post.

these were just quick tests, they can get much neater.

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: Bobboau on January 23, 2007, 01:53:09 pm
an animated version of something else I made earlier.

[attachment deleted by admin]
Title: Re: weapon effect generator
Post by: Ulala on January 23, 2007, 04:38:05 pm
 :eek2: Prettttttty!
Title: Re: weapon effect generator
Post by: Bobboau on January 23, 2007, 08:24:33 pm
warp effect?

[attachment deleted by admin]