Post by foksie on Dec 24, 2007 23:09:19 GMT 1
This is a copy paste of the convo i had with Kevin where i explained a bit on the scripts. Its no where near a complete tutorial but it might help you, together with all the code thats default, to make your own effects.
[22:13] voltran1: foksie`LoY you here?
[22:17] foksie`LoY: y
[22:17] voltran1: it's kevin from the forums
[22:17] foksie`LoY: sup?
[22:18] voltran1: hey so I was wondering if you could provide me with an example of the fx scripts you used
[22:18] Sisqo`aw (~sisqo.q3@Mosselman.users.quakenet.org) has joined
[22:18] voltran1: seeing as how there are no guides or anything
[22:18] foksie`LoY: well i would, but since im close to publishing my movie, ill put the entire code for them after the movie gets published :>
[22:19] foksie`LoY: but, if you want help with making your own im here
[22:19] voltran1: hmm
[22:19] voltran1: ok
[22:19] voltran1: I want to know how to start, that's all
[22:19] foksie`LoY: mme/scripts
[22:19] voltran1: I don't even know what it is
[22:19] foksie`LoY: there you have effect files
[22:19] voltran1: is it
[22:19] voltran1: base_weapons.fx
[22:19] voltran1: ?
[22:19] foksie`LoY: yes
[22:19] foksie`LoY: for weapons
[22:19] foksie`LoY: base_player is for player effects
[22:20] foksie`LoY: like blood etc
[22:20] voltran1: hmm
[22:20] foksie`LoY: and so on
[22:20] voltran1: what about xtra?
[22:20] Sisqo` (~sisqo.q3@Mosselman.users.quakenet.org) has disconnected: Ping timeout
[22:20] foksie`LoY: for now its only the quad skin effect i think
[22:20] foksie`LoY: so not much there
[22:20] voltran1: hm
[22:20] voltran1: so as far as weapon trails
[22:21] voltran1: should i go to mme.shader ?
[22:21] voltran1: or base_weapons.fx
[22:21] foksie`LoY: mme.shader is where you define new sprites etc
[22:21] foksie`LoY: a bit advanced for now, but you might use it later
[22:21] voltran1: hm
[22:21] foksie`LoY: anyway, lets make you a new what?
[22:21] foksie`LoY: rocket trail?
[22:21] voltran1: yeah (:
[22:21] foksie`LoY: make a new txt file with notepad
[22:22] voltran1: yeah
[22:22] foksie`LoY: set its name to z-voltran-rocket.fx
[22:22] foksie`LoY: now lets fill it out
[22:23] voltran1:
[22:23] foksie`LoY: weapon/rocket/trail {
[22:23] foksie`LoY: }
[22:23] foksie`LoY: type that in
[22:23] voltran1: sorta like CSS?
[22:23] foksie`LoY: you can say so
[22:24] foksie`LoY: more like c++ functions
[22:24] voltran1: hm
[22:24] foksie`LoY: now currently it wont do anything :>
[22:24] foksie`LoY: since its empty
[22:24] foksie`LoY: add this in
[22:24] foksie`LoY: color 0.6 0.3 0
[22:24] foksie`LoY: size 200
[22:24] foksie`LoY: Light
[22:24] foksie`LoY: lets explain what this does
[22:25] foksie`LoY: color sets the color in R G B
[22:25] foksie`LoY: color 1 1 1 is white
[22:25] foksie`LoY: color 1 0 0 is red
[22:25] foksie`LoY: etc
[22:25] voltran1: oh
[22:25] voltran1: normally it's out of 255
[22:25] voltran1: so
[22:25] voltran1: it's just like
[22:25] foksie`LoY: size determines the size of something
[22:25] voltran1: you divide it?
[22:25] foksie`LoY: 1 is max 0 is min
[22:25] foksie`LoY: 0.5 is middle
[22:25] voltran1: ok
[22:25] foksie`LoY: just like in postscript
[22:25] foksie`LoY: if you ever used it
[22:26] foksie`LoY: size 200 is in quake units
[22:26] voltran1: haven't
[22:26] voltran1: but I get it
[22:26] foksie`LoY: it determines the size of the next thing that is drawn
[22:26] foksie`LoY: and light
[22:26] foksie`LoY: is the command that draws a dynamic light
[22:26] voltran1: ok
[22:26] foksie`LoY: so this 3 together give us the rocket light
[22:26] voltran1: oh
[22:26] voltran1: like
[22:26] foksie`LoY: which is yellow
[22:26] voltran1: yeah
[22:27] voltran1: cool
[22:27] foksie`LoY: try it out
[22:27] voltran1: ok
[22:27] voltran1: how does it know?
[22:27] foksie`LoY: save the file and load some demo
[22:27] voltran1: to reference the z-voltran-rocket.fx
[22:27] voltran1: file?
[22:27] voltran1: or does it just work the same way pk3 files do
[22:27] foksie`LoY: it uses all the files in scripts directory
[22:27] foksie`LoY: just like pk3
[22:27] voltran1: oh
[22:27] voltran1: nice
[22:27] foksie`LoY: thats why i said put z-
[22:27] foksie`LoY: cause last file loaded overwrites
[22:28] foksie`LoY: let me know when youre back
[22:28] voltran1: i see it
[22:28] voltran1:
[22:28] foksie`LoY: good
[22:28] voltran1: it removes the trails though is that supposed to happen?
[22:28] foksie`LoY: its a bit boring so lets add stuff :>
[22:28] foksie`LoY: yes
[22:28] foksie`LoY: we didnt define trails
[22:28] foksie`LoY: so no trails show up
[22:28] voltran1: ah
[22:28] foksie`LoY: ok lets add something else :>
[22:28] voltran1:
[22:28] foksie`LoY: shader flareshader
[22:28] foksie`LoY: size 48
[22:28] foksie`LoY: sprite
[22:29] foksie`LoY: what this does is:
[22:29] foksie`LoY: it defines the sprite we will use (shader command)
[22:29] foksie`LoY: sets its size
[22:29] foksie`LoY: and draws it as sprite
[22:29] voltran1: hmm
[22:29] voltran1: so
[22:29] foksie`LoY: it uses the color we set at start
[22:29] voltran1: so far it looks like this
[22:29] voltran1: weapon/rocket/trail {
[22:29] voltran1: color 0.0 1.0 .5
[22:29] voltran1: size 200
[22:29] voltran1: Light
[22:29] voltran1: shader flareshader
[22:29] voltran1: size 48
[22:29] voltran1: sprite
[22:29] voltran1: }
[22:29] foksie`LoY: um
[22:29] voltran1: oh this is AWESOME i just changed the light color to pink
[22:29] foksie`LoY: color 0.6 0.3 0
[22:30] voltran1: yeah
[22:30] foksie`LoY: :>
[22:30] voltran1: i was just messing aroudn with it
[22:30] foksie`LoY: np
[22:30] voltran1: but that's the correct format so far?
[22:30] foksie`LoY: check out the rocket now, it has a lens flare
[22:30] voltran1: O:
[22:30] foksie`LoY: yep its correct
[22:30] voltran1: woah
[22:30] voltran1: this is crazy
[22:30] foksie`LoY: notice that the lens flare stays on the rocket
[22:31] voltran1: yeah
[22:31] foksie`LoY: you should realize that everything is drawn from the location of the rocket
[22:31] foksie`LoY: so if you want smoke that stays behind
[22:31] foksie`LoY: what you really do is make the smoke shoot from the rocket
[22:31] voltran1: yeah
[22:31] foksie`LoY: so relative to rocket it moves, but relative to player it stays on same place
[22:31] foksie`LoY: lets do that now :>
[22:31] voltran1: quick question
[22:32] voltran1: do i have to reboot q3mme each time
[22:32] voltran1: or is there a way
[22:32] voltran1: like \vid_restart or somethign?
[22:32] voltran1: so i can just save it and load again
[22:32] foksie`LoY: i think canabis added something script reload
[22:32] foksie`LoY: tyr \cvarlist *script*
[22:32] foksie`LoY: or cvarlist *fx*
[22:32] voltran1: hm
[22:32] voltran1: didn't find anything
[22:33] foksie`LoY: well close demo and open it again
[22:33] foksie`LoY: it will reload on demo load
[22:33] voltran1: yeah
[22:33] voltran1: that's good enough
[22:33] voltran1: since vid restart does that anyway
[22:33] foksie`LoY: :>
[22:33] voltran1: ok so moving on
[22:33] foksie`LoY: ye
[22:33] foksie`LoY: color 1 1 1
[22:33] foksie`LoY: alpha 0.33
[22:33] foksie`LoY: shader smokePuff
[22:33] foksie`LoY: rotate 360 * rand
[22:33] foksie`LoY: this wont do anything yet
[22:33] foksie`LoY: but lets explain it first
[22:34] foksie`LoY: color you know
[22:34] voltran1: a white trail
[22:34] voltran1: right?
[22:34] foksie`LoY: alpha is the command that sets transparency
[22:34] foksie`LoY: y
[22:34] foksie`LoY: 0.33 means 33% visible
[22:34] foksie`LoY: shader sets the name of the shader we will use (this time its smokepuff)
[22:34] foksie`LoY: and rotate sets the rotation
[22:35] foksie`LoY: 360*rand means that the smoke will be rotated to a random degree
[22:35] foksie`LoY: from 0 to 360
[22:35] foksie`LoY: (rand produces a number between 0 and 1)
[22:35] voltran1: ok
[22:35] foksie`LoY: note that this hapens only once, so the smoke wont spin like crazy
[22:36] foksie`LoY: it will be created in random direction
[22:36] foksie`LoY: and stay that way
[22:36] foksie`LoY: and now lets make the smokes
[22:36] foksie`LoY: distance 30 {
[22:36] foksie`LoY: emitter 2 {
[22:36] foksie`LoY: alphaFade 0.2
[22:36] foksie`LoY: size 8 + lerp * 64
[22:36] foksie`LoY: sprite cullNear
[22:36] foksie`LoY: }
[22:36] foksie`LoY: }
[22:37] foksie`LoY: lets explain
[22:37] foksie`LoY: distance is how often to make the smoke show up
[22:37] foksie`LoY: if it was 1 you would get really thick smoke
[22:37] foksie`LoY: if it was 300 you would get smoke once every 300 quake units
[22:37] voltran1: ahh
[22:37] foksie`LoY: try playing with the distance a bit
[22:38] foksie`LoY: emitter is the thing that creates the smoke
[22:38] foksie`LoY: emitter is short for "particle emitter"
[22:38] foksie`LoY: 2 means that each particle created will stay alive for 2 seconds
[22:38] foksie`LoY: set it to 0.1 to get really fast dying smoke
[22:39] voltran1: ok
[22:39] foksie`LoY: or to some big number to have it on screen for a long time
[22:39] foksie`LoY: you can use things like 2 + 2*rand
[22:39] foksie`LoY: which will make smoke live a random ammount of time (between 2 and 4 seconds)
[22:40] foksie`LoY: alpha fade is the command that determines when the smoke will start fading out
[22:40] voltran1: ah that's cool
[22:40] foksie`LoY: if you set it to 1 smoke will start dissapearing right away
[22:40] foksie`LoY: on 0 smoke will never start fading away
[22:41] foksie`LoY: since our smoke lives for 2 seconds, alpha fade 0.2 means that after 1.6 seconds (2-(2*0.2)) the smoke will start fading from its beggining 0.33 % to 0%
[22:41] voltran1: aha
[22:41] foksie`LoY: linearly
[22:42] foksie`LoY: size 8 + lerp * 64 means:
[22:42] foksie`LoY: set the size to 8 + (number from 0 to 1 depending on time) * 64
[22:42] foksie`LoY: lerp is "how long has the sprite been alive"
[22:42] foksie`LoY: 0 is when the sprite just showed up
[22:43] foksie`LoY: 1 is when the sprite dies
[22:43] foksie`LoY: so in our case at 0 sec its 0, at 1 sec its 0.5 and at 2 sec its 1
[22:43] foksie`LoY: so this command will make smoke grow in size with time
[22:43] voltran1: ah
[22:43] foksie`LoY: from size 8 to size 72
[22:43] voltran1: useful
[22:43] foksie`LoY: y
[22:43] foksie`LoY: you can also use it to make explosion light smaller
[22:43] foksie`LoY: with time
[22:44] foksie`LoY: by using 1 - lerp
[22:44] foksie`LoY: or lets say make fire that gets smaller with time
[22:44] foksie`LoY: stuff like that
[22:44] voltran1: yeah
[22:44] foksie`LoY: and in the end sprite cullnear
[22:44] foksie`LoY: sprite means "draw the last defined shader as sprite"
[22:44] foksie`LoY: in this case smokepuff
[22:45] foksie`LoY: and cullnear means : if two sprites overlap, draw the first one we see
[22:45] foksie`LoY: and dont draw those behind it
[22:45] voltran1: ok
[22:45] foksie`LoY: give it a try, does it look ok?
[22:46] voltran1: yeah i have been messing with it this whole time
[22:46] voltran1: it looks really nice
[22:46] voltran1: what about color?
[22:46] foksie`LoY: what about it? >:
[22:46] foksie`LoY: :>
[22:46] voltran1: changing the color of the trail
[22:47] foksie`LoY: you set it with color # # #
[22:47] voltran1: oh
[22:47] voltran1: aha
[22:47] foksie`LoY: currently its 1 1 1
[22:48] foksie`LoY: now lets do some kinky stuff?
[22:48] voltran1: h0h0h0h0h0h0
[22:48] voltran1: this is so cool
[22:48] foksie`LoY: try this:
[22:48] foksie`LoY: where shader smokePuff is
[22:48] foksie`LoY: delete that line
[22:49] foksie`LoY: and put
[22:49] foksie`LoY: shaderlist loop {
[22:49] foksie`LoY: smokePuff
[22:49] foksie`LoY: flareshader
[22:49] foksie`LoY: }
[22:50] voltran1: hm
[22:50] voltran1: i'm not sure what it did
[22:50] foksie`LoY: what it does is, on random it will pick either lens flare or smokepuff
[22:51] foksie`LoY: for drawing in the smoke
[22:51] voltran1: oh
[22:51] foksie`LoY: try using camera and moving arround the smoke to see that
[22:51] voltran1: aha
[22:51] voltran1: yeah
[22:51] foksie`LoY: ok add this one inside it as well
[22:52] foksie`LoY: shader grenadeExplosion
[22:52] foksie`LoY: and check it out :>
[22:52] voltran1: shaderlist loop {
[22:52] voltran1: smokePuff
[22:52] voltran1: flareShader
[22:52] voltran1: grenadeExplosion
[22:52] voltran1: }
[22:52] voltran1: right?
[22:52] foksie`LoY: y
[22:52] voltran1: O:!
[22:52] voltran1: wait
[22:53] voltran1: how do you comment stuff out?
[22:53] Unknown command: /
[22:53] foksie`LoY: .//
[22:53] foksie`LoY: without .
[22:53] voltran1: rgr
[22:53] voltran1: AHH
[22:53] voltran1: that is grazy
[22:53] voltran1: crazy
[22:53] voltran1: the grenade explosion
[22:53] foksie`LoY: lets add more kinky stuff? :>
[22:54] voltran1: yes plz
[22:54] foksie`LoY: try adding this
[22:54] foksie`LoY: before the emitter
[22:55] foksie`LoY: normalize parentVelocity v0
[22:55] foksie`LoY: inverse v0
[22:55] foksie`LoY: wobble v0 velocity 100+rand*4
[22:55] foksie`LoY: scale velocity velocity 50+rand*300
[22:55] foksie`LoY: and check it out
[22:55] foksie`LoY: then ill explain
[22:56] voltran1: hm
[22:57] voltran1: emitter 0.5 {
[22:57] voltran1: normalize parentVelocity v0
[22:57] voltran1: inverse v0
[22:57] voltran1: wobble v0 velocity 100+rand*4
[22:57] foksie`LoY: no no
[22:57] voltran1: scale velocity velocity 50+rand*300
[22:57] voltran1: alphaFade .5
[22:57] voltran1: size 8 + lerp * 12
[22:57] voltran1: sprite cullNear
[22:57] voltran1: }
[22:57] foksie`LoY: first what i just typed
[22:57] foksie`LoY: then emitter {
[22:57] voltran1: oh
[22:57] voltran1: isn't it under distance { then?
[22:58] foksie`LoY: yes its inside distance
[22:58] voltran1: ok
[22:58] foksie`LoY: but before emitter
[22:58] voltran1: yeah
[22:58] voltran1:
[22:58] foksie`LoY: give it a try
[22:58] voltran1: i can't tell if it did anything
[22:58] voltran1: hmm
[22:58] foksie`LoY: hm you should be able to tell that
[22:59] voltran1: sec
[22:59] foksie`LoY: try following the rocket real close with a camera
[22:59] voltran1: pastebin.org/12787
[22:59] voltran1: ?
[22:59] foksie`LoY: y
[23:00] foksie`LoY: what it should be doing is make the smoke come out in a slightly random direction
[23:00] foksie`LoY: try putting distance to 1
[23:00] foksie`LoY: to see it better
[23:00] foksie`LoY: and follow the rocket with the camera
[23:01] voltran1: oh
[23:01] voltran1: yeah
[23:02] foksie`LoY: now lets explain the commands
[23:02] foksie`LoY: normalize parentVelocity v0
[23:03] foksie`LoY: this means: take the values of the vector "parentVelocity" which is the rocket velocity and make it always positive and store it in vector v0
[23:03] foksie`LoY: then
[23:03] foksie`LoY: inverse v0
[23:03] foksie`LoY: make the smoke go in the direction oposite of the rocket
[23:03] foksie`LoY: wobble v0 velocity 100+rand*4
[23:04] foksie`LoY: change the direction of the vector v0 for the ammount 100+rand*4
[23:04] foksie`LoY: try putting that into lets say 10+rand*400
[23:04] foksie`LoY: and have a fun sparkle machine
[23:04] foksie`LoY: scale velocity velocity 50+rand*300
[23:04] foksie`LoY: this means: change the speed of the smoke slightly
[23:05] foksie`LoY: for the ammount mentioned
[23:05] foksie`LoY: play with it a bit
[23:06] foksie`LoY: does it work? :>
[23:09] voltran1: ah I gotta go sa;dfjslk
[23:09] voltran1: I'll be back in a bit
[23:09] voltran1: thanks for all the help though!
[23:09] voltran1: i'll try that stuff when i get back and let you know
[23:09] voltran1: cya!
[22:13] voltran1: foksie`LoY you here?
[22:17] foksie`LoY: y
[22:17] voltran1: it's kevin from the forums
[22:17] foksie`LoY: sup?
[22:18] voltran1: hey so I was wondering if you could provide me with an example of the fx scripts you used
[22:18] Sisqo`aw (~sisqo.q3@Mosselman.users.quakenet.org) has joined
[22:18] voltran1: seeing as how there are no guides or anything
[22:18] foksie`LoY: well i would, but since im close to publishing my movie, ill put the entire code for them after the movie gets published :>
[22:19] foksie`LoY: but, if you want help with making your own im here
[22:19] voltran1: hmm
[22:19] voltran1: ok
[22:19] voltran1: I want to know how to start, that's all
[22:19] foksie`LoY: mme/scripts
[22:19] voltran1: I don't even know what it is
[22:19] foksie`LoY: there you have effect files
[22:19] voltran1: is it
[22:19] voltran1: base_weapons.fx
[22:19] voltran1: ?
[22:19] foksie`LoY: yes
[22:19] foksie`LoY: for weapons
[22:19] foksie`LoY: base_player is for player effects
[22:20] foksie`LoY: like blood etc
[22:20] voltran1: hmm
[22:20] foksie`LoY: and so on
[22:20] voltran1: what about xtra?
[22:20] Sisqo` (~sisqo.q3@Mosselman.users.quakenet.org) has disconnected: Ping timeout
[22:20] foksie`LoY: for now its only the quad skin effect i think
[22:20] foksie`LoY: so not much there
[22:20] voltran1: hm
[22:20] voltran1: so as far as weapon trails
[22:21] voltran1: should i go to mme.shader ?
[22:21] voltran1: or base_weapons.fx
[22:21] foksie`LoY: mme.shader is where you define new sprites etc
[22:21] foksie`LoY: a bit advanced for now, but you might use it later
[22:21] voltran1: hm
[22:21] foksie`LoY: anyway, lets make you a new what?
[22:21] foksie`LoY: rocket trail?
[22:21] voltran1: yeah (:
[22:21] foksie`LoY: make a new txt file with notepad
[22:22] voltran1: yeah
[22:22] foksie`LoY: set its name to z-voltran-rocket.fx
[22:22] foksie`LoY: now lets fill it out
[22:23] voltran1:
[22:23] foksie`LoY: weapon/rocket/trail {
[22:23] foksie`LoY: }
[22:23] foksie`LoY: type that in
[22:23] voltran1: sorta like CSS?
[22:23] foksie`LoY: you can say so
[22:24] foksie`LoY: more like c++ functions
[22:24] voltran1: hm
[22:24] foksie`LoY: now currently it wont do anything :>
[22:24] foksie`LoY: since its empty
[22:24] foksie`LoY: add this in
[22:24] foksie`LoY: color 0.6 0.3 0
[22:24] foksie`LoY: size 200
[22:24] foksie`LoY: Light
[22:24] foksie`LoY: lets explain what this does
[22:25] foksie`LoY: color sets the color in R G B
[22:25] foksie`LoY: color 1 1 1 is white
[22:25] foksie`LoY: color 1 0 0 is red
[22:25] foksie`LoY: etc
[22:25] voltran1: oh
[22:25] voltran1: normally it's out of 255
[22:25] voltran1: so
[22:25] voltran1: it's just like
[22:25] foksie`LoY: size determines the size of something
[22:25] voltran1: you divide it?
[22:25] foksie`LoY: 1 is max 0 is min
[22:25] foksie`LoY: 0.5 is middle
[22:25] voltran1: ok
[22:25] foksie`LoY: just like in postscript
[22:25] foksie`LoY: if you ever used it
[22:26] foksie`LoY: size 200 is in quake units
[22:26] voltran1: haven't
[22:26] voltran1: but I get it
[22:26] foksie`LoY: it determines the size of the next thing that is drawn
[22:26] foksie`LoY: and light
[22:26] foksie`LoY: is the command that draws a dynamic light
[22:26] voltran1: ok
[22:26] foksie`LoY: so this 3 together give us the rocket light
[22:26] voltran1: oh
[22:26] voltran1: like
[22:26] foksie`LoY: which is yellow
[22:26] voltran1: yeah
[22:27] voltran1: cool
[22:27] foksie`LoY: try it out
[22:27] voltran1: ok
[22:27] voltran1: how does it know?
[22:27] foksie`LoY: save the file and load some demo
[22:27] voltran1: to reference the z-voltran-rocket.fx
[22:27] voltran1: file?
[22:27] voltran1: or does it just work the same way pk3 files do
[22:27] foksie`LoY: it uses all the files in scripts directory
[22:27] foksie`LoY: just like pk3
[22:27] voltran1: oh
[22:27] voltran1: nice
[22:27] foksie`LoY: thats why i said put z-
[22:27] foksie`LoY: cause last file loaded overwrites
[22:28] foksie`LoY: let me know when youre back
[22:28] voltran1: i see it
[22:28] voltran1:
[22:28] foksie`LoY: good
[22:28] voltran1: it removes the trails though is that supposed to happen?
[22:28] foksie`LoY: its a bit boring so lets add stuff :>
[22:28] foksie`LoY: yes
[22:28] foksie`LoY: we didnt define trails
[22:28] foksie`LoY: so no trails show up
[22:28] voltran1: ah
[22:28] foksie`LoY: ok lets add something else :>
[22:28] voltran1:
[22:28] foksie`LoY: shader flareshader
[22:28] foksie`LoY: size 48
[22:28] foksie`LoY: sprite
[22:29] foksie`LoY: what this does is:
[22:29] foksie`LoY: it defines the sprite we will use (shader command)
[22:29] foksie`LoY: sets its size
[22:29] foksie`LoY: and draws it as sprite
[22:29] voltran1: hmm
[22:29] voltran1: so
[22:29] foksie`LoY: it uses the color we set at start
[22:29] voltran1: so far it looks like this
[22:29] voltran1: weapon/rocket/trail {
[22:29] voltran1: color 0.0 1.0 .5
[22:29] voltran1: size 200
[22:29] voltran1: Light
[22:29] voltran1: shader flareshader
[22:29] voltran1: size 48
[22:29] voltran1: sprite
[22:29] voltran1: }
[22:29] foksie`LoY: um
[22:29] voltran1: oh this is AWESOME i just changed the light color to pink
[22:29] foksie`LoY: color 0.6 0.3 0
[22:30] voltran1: yeah
[22:30] foksie`LoY: :>
[22:30] voltran1: i was just messing aroudn with it
[22:30] foksie`LoY: np
[22:30] voltran1: but that's the correct format so far?
[22:30] foksie`LoY: check out the rocket now, it has a lens flare
[22:30] voltran1: O:
[22:30] foksie`LoY: yep its correct
[22:30] voltran1: woah
[22:30] voltran1: this is crazy
[22:30] foksie`LoY: notice that the lens flare stays on the rocket
[22:31] voltran1: yeah
[22:31] foksie`LoY: you should realize that everything is drawn from the location of the rocket
[22:31] foksie`LoY: so if you want smoke that stays behind
[22:31] foksie`LoY: what you really do is make the smoke shoot from the rocket
[22:31] voltran1: yeah
[22:31] foksie`LoY: so relative to rocket it moves, but relative to player it stays on same place
[22:31] foksie`LoY: lets do that now :>
[22:31] voltran1: quick question
[22:32] voltran1: do i have to reboot q3mme each time
[22:32] voltran1: or is there a way
[22:32] voltran1: like \vid_restart or somethign?
[22:32] voltran1: so i can just save it and load again
[22:32] foksie`LoY: i think canabis added something script reload
[22:32] foksie`LoY: tyr \cvarlist *script*
[22:32] foksie`LoY: or cvarlist *fx*
[22:32] voltran1: hm
[22:32] voltran1: didn't find anything
[22:33] foksie`LoY: well close demo and open it again
[22:33] foksie`LoY: it will reload on demo load
[22:33] voltran1: yeah
[22:33] voltran1: that's good enough
[22:33] voltran1: since vid restart does that anyway
[22:33] foksie`LoY: :>
[22:33] voltran1: ok so moving on
[22:33] foksie`LoY: ye
[22:33] foksie`LoY: color 1 1 1
[22:33] foksie`LoY: alpha 0.33
[22:33] foksie`LoY: shader smokePuff
[22:33] foksie`LoY: rotate 360 * rand
[22:33] foksie`LoY: this wont do anything yet
[22:33] foksie`LoY: but lets explain it first
[22:34] foksie`LoY: color you know
[22:34] voltran1: a white trail
[22:34] voltran1: right?
[22:34] foksie`LoY: alpha is the command that sets transparency
[22:34] foksie`LoY: y
[22:34] foksie`LoY: 0.33 means 33% visible
[22:34] foksie`LoY: shader sets the name of the shader we will use (this time its smokepuff)
[22:34] foksie`LoY: and rotate sets the rotation
[22:35] foksie`LoY: 360*rand means that the smoke will be rotated to a random degree
[22:35] foksie`LoY: from 0 to 360
[22:35] foksie`LoY: (rand produces a number between 0 and 1)
[22:35] voltran1: ok
[22:35] foksie`LoY: note that this hapens only once, so the smoke wont spin like crazy
[22:36] foksie`LoY: it will be created in random direction
[22:36] foksie`LoY: and stay that way
[22:36] foksie`LoY: and now lets make the smokes
[22:36] foksie`LoY: distance 30 {
[22:36] foksie`LoY: emitter 2 {
[22:36] foksie`LoY: alphaFade 0.2
[22:36] foksie`LoY: size 8 + lerp * 64
[22:36] foksie`LoY: sprite cullNear
[22:36] foksie`LoY: }
[22:36] foksie`LoY: }
[22:37] foksie`LoY: lets explain
[22:37] foksie`LoY: distance is how often to make the smoke show up
[22:37] foksie`LoY: if it was 1 you would get really thick smoke
[22:37] foksie`LoY: if it was 300 you would get smoke once every 300 quake units
[22:37] voltran1: ahh
[22:37] foksie`LoY: try playing with the distance a bit
[22:38] foksie`LoY: emitter is the thing that creates the smoke
[22:38] foksie`LoY: emitter is short for "particle emitter"
[22:38] foksie`LoY: 2 means that each particle created will stay alive for 2 seconds
[22:38] foksie`LoY: set it to 0.1 to get really fast dying smoke
[22:39] voltran1: ok
[22:39] foksie`LoY: or to some big number to have it on screen for a long time
[22:39] foksie`LoY: you can use things like 2 + 2*rand
[22:39] foksie`LoY: which will make smoke live a random ammount of time (between 2 and 4 seconds)
[22:40] foksie`LoY: alpha fade is the command that determines when the smoke will start fading out
[22:40] voltran1: ah that's cool
[22:40] foksie`LoY: if you set it to 1 smoke will start dissapearing right away
[22:40] foksie`LoY: on 0 smoke will never start fading away
[22:41] foksie`LoY: since our smoke lives for 2 seconds, alpha fade 0.2 means that after 1.6 seconds (2-(2*0.2)) the smoke will start fading from its beggining 0.33 % to 0%
[22:41] voltran1: aha
[22:41] foksie`LoY: linearly
[22:42] foksie`LoY: size 8 + lerp * 64 means:
[22:42] foksie`LoY: set the size to 8 + (number from 0 to 1 depending on time) * 64
[22:42] foksie`LoY: lerp is "how long has the sprite been alive"
[22:42] foksie`LoY: 0 is when the sprite just showed up
[22:43] foksie`LoY: 1 is when the sprite dies
[22:43] foksie`LoY: so in our case at 0 sec its 0, at 1 sec its 0.5 and at 2 sec its 1
[22:43] foksie`LoY: so this command will make smoke grow in size with time
[22:43] voltran1: ah
[22:43] foksie`LoY: from size 8 to size 72
[22:43] voltran1: useful
[22:43] foksie`LoY: y
[22:43] foksie`LoY: you can also use it to make explosion light smaller
[22:43] foksie`LoY: with time
[22:44] foksie`LoY: by using 1 - lerp
[22:44] foksie`LoY: or lets say make fire that gets smaller with time
[22:44] foksie`LoY: stuff like that
[22:44] voltran1: yeah
[22:44] foksie`LoY: and in the end sprite cullnear
[22:44] foksie`LoY: sprite means "draw the last defined shader as sprite"
[22:44] foksie`LoY: in this case smokepuff
[22:45] foksie`LoY: and cullnear means : if two sprites overlap, draw the first one we see
[22:45] foksie`LoY: and dont draw those behind it
[22:45] voltran1: ok
[22:45] foksie`LoY: give it a try, does it look ok?
[22:46] voltran1: yeah i have been messing with it this whole time
[22:46] voltran1: it looks really nice
[22:46] voltran1: what about color?
[22:46] foksie`LoY: what about it? >:
[22:46] foksie`LoY: :>
[22:46] voltran1: changing the color of the trail
[22:47] foksie`LoY: you set it with color # # #
[22:47] voltran1: oh
[22:47] voltran1: aha
[22:47] foksie`LoY: currently its 1 1 1
[22:48] foksie`LoY: now lets do some kinky stuff?
[22:48] voltran1: h0h0h0h0h0h0
[22:48] voltran1: this is so cool
[22:48] foksie`LoY: try this:
[22:48] foksie`LoY: where shader smokePuff is
[22:48] foksie`LoY: delete that line
[22:49] foksie`LoY: and put
[22:49] foksie`LoY: shaderlist loop {
[22:49] foksie`LoY: smokePuff
[22:49] foksie`LoY: flareshader
[22:49] foksie`LoY: }
[22:50] voltran1: hm
[22:50] voltran1: i'm not sure what it did
[22:50] foksie`LoY: what it does is, on random it will pick either lens flare or smokepuff
[22:51] foksie`LoY: for drawing in the smoke
[22:51] voltran1: oh
[22:51] foksie`LoY: try using camera and moving arround the smoke to see that
[22:51] voltran1: aha
[22:51] voltran1: yeah
[22:51] foksie`LoY: ok add this one inside it as well
[22:52] foksie`LoY: shader grenadeExplosion
[22:52] foksie`LoY: and check it out :>
[22:52] voltran1: shaderlist loop {
[22:52] voltran1: smokePuff
[22:52] voltran1: flareShader
[22:52] voltran1: grenadeExplosion
[22:52] voltran1: }
[22:52] voltran1: right?
[22:52] foksie`LoY: y
[22:52] voltran1: O:!
[22:52] voltran1: wait
[22:53] voltran1: how do you comment stuff out?
[22:53] Unknown command: /
[22:53] foksie`LoY: .//
[22:53] foksie`LoY: without .
[22:53] voltran1: rgr
[22:53] voltran1: AHH
[22:53] voltran1: that is grazy
[22:53] voltran1: crazy
[22:53] voltran1: the grenade explosion
[22:53] foksie`LoY: lets add more kinky stuff? :>
[22:54] voltran1: yes plz
[22:54] foksie`LoY: try adding this
[22:54] foksie`LoY: before the emitter
[22:55] foksie`LoY: normalize parentVelocity v0
[22:55] foksie`LoY: inverse v0
[22:55] foksie`LoY: wobble v0 velocity 100+rand*4
[22:55] foksie`LoY: scale velocity velocity 50+rand*300
[22:55] foksie`LoY: and check it out
[22:55] foksie`LoY: then ill explain
[22:56] voltran1: hm
[22:57] voltran1: emitter 0.5 {
[22:57] voltran1: normalize parentVelocity v0
[22:57] voltran1: inverse v0
[22:57] voltran1: wobble v0 velocity 100+rand*4
[22:57] foksie`LoY: no no
[22:57] voltran1: scale velocity velocity 50+rand*300
[22:57] voltran1: alphaFade .5
[22:57] voltran1: size 8 + lerp * 12
[22:57] voltran1: sprite cullNear
[22:57] voltran1: }
[22:57] foksie`LoY: first what i just typed
[22:57] foksie`LoY: then emitter {
[22:57] voltran1: oh
[22:57] voltran1: isn't it under distance { then?
[22:58] foksie`LoY: yes its inside distance
[22:58] voltran1: ok
[22:58] foksie`LoY: but before emitter
[22:58] voltran1: yeah
[22:58] voltran1:
[22:58] foksie`LoY: give it a try
[22:58] voltran1: i can't tell if it did anything
[22:58] voltran1: hmm
[22:58] foksie`LoY: hm you should be able to tell that
[22:59] voltran1: sec
[22:59] foksie`LoY: try following the rocket real close with a camera
[22:59] voltran1: pastebin.org/12787
[22:59] voltran1: ?
[22:59] foksie`LoY: y
[23:00] foksie`LoY: what it should be doing is make the smoke come out in a slightly random direction
[23:00] foksie`LoY: try putting distance to 1
[23:00] foksie`LoY: to see it better
[23:00] foksie`LoY: and follow the rocket with the camera
[23:01] voltran1: oh
[23:01] voltran1: yeah
[23:02] foksie`LoY: now lets explain the commands
[23:02] foksie`LoY: normalize parentVelocity v0
[23:03] foksie`LoY: this means: take the values of the vector "parentVelocity" which is the rocket velocity and make it always positive and store it in vector v0
[23:03] foksie`LoY: then
[23:03] foksie`LoY: inverse v0
[23:03] foksie`LoY: make the smoke go in the direction oposite of the rocket
[23:03] foksie`LoY: wobble v0 velocity 100+rand*4
[23:04] foksie`LoY: change the direction of the vector v0 for the ammount 100+rand*4
[23:04] foksie`LoY: try putting that into lets say 10+rand*400
[23:04] foksie`LoY: and have a fun sparkle machine
[23:04] foksie`LoY: scale velocity velocity 50+rand*300
[23:04] foksie`LoY: this means: change the speed of the smoke slightly
[23:05] foksie`LoY: for the ammount mentioned
[23:05] foksie`LoY: play with it a bit
[23:06] foksie`LoY: does it work? :>
[23:09] voltran1: ah I gotta go sa;dfjslk
[23:09] voltran1: I'll be back in a bit
[23:09] voltran1: thanks for all the help though!
[23:09] voltran1: i'll try that stuff when i get back and let you know
[23:09] voltran1: cya!