Author Topic: Help On Preset Coding  (Read 2934 times)

Offline ApeEscape92

  • Curious Wanderer
  • *
  • Posts: 14
  • Country: 00
  • Floof-O-Meter: 1
    • View Profile
    • Tigers of Temptation
Help On Preset Coding
« on: August 22, 2016, 12:48:27 pm »
I'm clear on how to do coding for presets to add special effects (i.e. moving textures, transparency, ect.), however what I am not familiar with is how to apply 'more than one' special effect coding. Do I place one code above another? If not, what should I look for in the coding material file so that I can apply extra coding affects?

Thank you for reading through my question, I appreciate it.


          Sarsaparilla(c)EscapeReality

Offline Kynvuu

  • #Grimstagram
  • Elder Grey Pelt
  • ****
  • Posts: 2,538
  • Country: us
  • Floof-O-Meter: 212
  • I'm not saying that it was aliens but...
    • View Profile
Re: Help On Preset Coding
« Reply #1 on: August 22, 2016, 02:19:35 pm »
Which two effects codes are you trying to use? I believe there is a way to blend them so that they work together but I would have to know which ones you are using in order to show you how c:
On a temporary leave. Please contact other members of staff if you need assistance.

Offline ApeEscape92

  • Curious Wanderer
  • *
  • Posts: 14
  • Country: 00
  • Floof-O-Meter: 1
    • View Profile
    • Tigers of Temptation
Re: Help On Preset Coding
« Reply #2 on: August 22, 2016, 02:25:54 pm »
I would really like to use the transparency code, the moving texture code, the glowing marking code, and the code which allows you to have flashing textures outside of the texture wall. It's going to be a complex preset...


but if I can AT LEAST get the transparency coding and the moving texture coding working together, I'll be satisfied.


          Sarsaparilla(c)EscapeReality

Offline Kynvuu

  • #Grimstagram
  • Elder Grey Pelt
  • ****
  • Posts: 2,538
  • Country: us
  • Floof-O-Meter: 212
  • I'm not saying that it was aliens but...
    • View Profile
Re: Help On Preset Coding
« Reply #3 on: August 22, 2016, 02:29:42 pm »
Hmm, logically thinking through this, the moving texture(If you are talking about the scrolling one, and not the animation one) as well as the transparency texture might not work together. The only reason I say this is because in order for the preset to scroll, you have to create a transparent part on the parent preset and then underlay a texture that scrolls wherever it is transparent. So if you intend to make a part invisible, the scrolling texture would override it. Personally I have not combined these two before nor do I know if its possible, but I'll dabble around a bit and see if I can get something that works c:

EDIT: Also do you want the whole preset to be scrolling or just one section under a fixed texture?
« Last Edit: August 22, 2016, 02:33:34 pm by Kynvuu »
On a temporary leave. Please contact other members of staff if you need assistance.

Offline ApeEscape92

  • Curious Wanderer
  • *
  • Posts: 14
  • Country: 00
  • Floof-O-Meter: 1
    • View Profile
    • Tigers of Temptation
Re: Help On Preset Coding
« Reply #4 on: August 22, 2016, 03:15:07 pm »
Preferably one section under a fixed texture. I've done this before on multiple occasions. However, I can see where you're coming from. If those two fail to mesh, perhaps the transparent code and the glow marking code together would do just fine.


          Sarsaparilla(c)EscapeReality

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Help On Preset Coding
« Reply #5 on: August 22, 2016, 07:51:09 pm »
i don't know what i'm doing but i've made 2 kinds before, one that had a scrolling texture that showed under a top layer with transparent holes in it.  If one particular transparent region wasn't supposed to have the scrolling or rotating texture you could possibly fake it by using animated layers that all have the same region that should remain transparent removed.
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"

Offline Whisperingwaves

  • #2FAB4U
  • Community Champion
  • ****
  • Posts: 1,593
  • Country: us
  • Floof-O-Meter: 135
  • #SlainyTheBattleTurkey
    • Whisperingwaves
    • @slainytbm
    • View Profile
    • Kiros
Re: Help On Preset Coding
« Reply #6 on: August 22, 2016, 08:18:26 pm »
Basically, you're trying to add multiple effects, correct?


In order to do this, you'll need to mask off the different 'markings' or places you want each effect. These masks will need to be on a separate layer in your art program and transparent underneath.
Gonna use the mask to my IT preset as an example:

I recommend using black for masking.
Now that you're masking is done, your material is next.

Let's have a look at Nox's preset code:
Code: [Select]
material NoxMat/BodyMat
{
receive_shadows on
technique
{
pass
{
ambient 1.000000 1.000000 1.000000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.050000 0.050000 0.050000 1.000000
emissive 0.000000 0.000000 0.000000 1.000000
cull_hardware none
cull_software none
scene_blend alpha_blend
alpha_rejection greater_equal 128
texture_unit
{
texture NoxBody.png
alpha_op_ex source1 src_texture src_texture
colour_op_ex blend_diffuse_alpha src_texture src_current
tex_address_mode wrap
filtering trilinear
}
}
pass
{
ambient 1.000000 1.000000 1.000000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.050000 0.050000 0.050000 1.000000
emissive 0.000000 0.000000 0.000000 1.000000
cull_hardware none
cull_software none
scene_blend alpha_blend
alpha_rejection greater_equal 128
texture_unit
            {
                texture NoxDot1Mask.png
                alpha_op_ex source1 src_texture src_texture
                colour_op_ex source2 src_texture src_texture
            }
            texture_unit
            {
              texture DotFlash1.png
scroll_anim 0.4 0.4
                colour_op_ex blend_diffuse_alpha src_texture src_current
}
}
pass
        {
ambient 1.000000 1.000000 1.000000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.010000 0.010000 0.010000 1.000000
emissive 0.000000 0.000000 0.000000 1.000000
cull_hardware none
cull_software none
scene_blend alpha_blend
alpha_rejection greater_equal 128
texture_unit
            {
                texture NoxDot2Mask.png
                alpha_op_ex source1 src_texture src_texture
                colour_op_ex source2 src_texture src_texture
            }
            texture_unit
            {
              texture DotFlash2.png
scroll_anim .1 .1
                colour_op_ex blend_diffuse_alpha src_texture src_current
}
}
pass
        {
ambient 1.000000 1.000000 1.000000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.010000 0.010000 0.010000 1.000000
emissive 0.000000 0.000000 0.000000 1.000000
cull_hardware none
cull_software none
scene_blend alpha_blend
alpha_rejection greater_equal 128
texture_unit
            {
                texture NoxLeafMask.png
                alpha_op_ex source1 src_texture src_texture
                colour_op_ex source2 src_texture src_texture
            }
            texture_unit
            {
              texture NoxChrome.png
scroll_anim .1 .1
                colour_op_ex blend_diffuse_alpha src_texture src_current
}
}
}
}

This is three different scroll codings. Just replace each pass with your own effect. Also, do not make marks on the actual body/head/tail texture, just masks on separate layers or it won't work.
Hopefully this helps out a little~ If you have any other questions, don't be afraid to ask.
Code Lines for Effects: Click Me

~ Whisper
« Last Edit: August 22, 2016, 08:22:12 pm by HidenShadow »

Avatar by Chezdip on Lioden || Signature by Jackdaw ♥
In-Game As Whisperingwaves

Offline Ruby1234

  • Mean Tutorial Queen
  • Elder Grey Pelt
  • ****
  • Posts: 2,794
  • Country: us
  • Floof-O-Meter: 297
  • aka Phloxenfree.
    • View Profile
Re: Help On Preset Coding
« Reply #7 on: August 22, 2016, 10:13:53 pm »
I would like to note that this section

Code: [Select]
ambient 1.000000 1.000000 1.000000 1.000000
diffuse 1.000000 1.000000 1.000000 1.000000
specular 0.010000 0.010000 0.010000 1.000000
emissive 0.000000 0.000000 0.000000 1.000000

is simply the default render script, and can be removed without effecting the results.

Also, depending on your scrolling, it may look better to simply put the scrolling down first, then the actual texture over it. Types of masking can leave black/white edges, if you choose to use those colours, so I prefer to use this method, at least when it comes to scrolling.

For example, this:



Is achieved by layering these on top of each other via coding, in this order:







The basic structure of this code looks like this
Code: [Select]
material EXAMPLEMAT
{
technique
{
pass
{
ambient 0.5 0.5 0.5 1
texture_unit
{
texture scroll.png
scroll_anim 1.0 1.0
}
}
pass
{
ambient 0.5 0.5 0.5 1
scene_blend alpha_blend
texture_unit
{
texture body.png
}
}
pass
{
emissive 1.0 1.0 1.0 1
scene_blend alpha_blend
texture_unit
{
texture glow.png
}
}
}
}

If it turns out that you need to layer scrolling ON TOP of something, then the only way to do this is via the masking method which Whisper has provided. (+Fluff for Whis)

Offline ApeEscape92

  • Curious Wanderer
  • *
  • Posts: 14
  • Country: 00
  • Floof-O-Meter: 1
    • View Profile
    • Tigers of Temptation
Re: Help On Preset Coding
« Reply #8 on: August 23, 2016, 02:49:37 am »
Thank you everyone for your help. I really appreciate it. :) I think I'm going to toy around with all of your suggestions, and see if I can figure it out. If I can, I'll post my solutions and results so others may indulge if they have the same problem.


          Sarsaparilla(c)EscapeReality

Offline Kerriki

  • Band Geek
  • Immortal Legend
  • *****
  • Posts: 5,670
  • Country: us
  • Floof-O-Meter: 371
  • Who needs furniture when you have the floor?
    • Kikiorylandia
    • View Profile
    • DeviantART
Re: Help On Preset Coding
« Reply #9 on: August 23, 2016, 03:11:02 am »
I think it is actually possible to get scrolling and transparency

There is a way to get scrolling on a mane with none of the blocky looking things (manes usually require transparency if you don't want the blocky look)

I'll link to this tutorial, and I think it could be translated back to non-mane body parts

http://www.feral-heart.com/smf/index.php?topic=53773.0

That's as far as I know, honestly xD Someone else will have to take a look at that tutorial and come up with a transparency and scrolling code for you
Farewell everyone<3