Partial transparency

Started by Flowrellik, November 03, 2014, 06:21:00 PM

Previous topic - Next topic

Flowrellik

Ok guys I have a question in dealing with transparency. In looking at tatsu's kung fu chars in mugen I notice that he uses some sort of special code to achieve a partial transparency on his projectiles seen here
EXHIBIT A

and seen here is what we usually use for CVS chars
EXHIBIT B


How to I make Exhibit B achieve the look of sub-transparency of Exhibit A? I'm really kinda lost here on this one as I looked in fighter factory and both A and B's sprites are completely transparent, so it must be some sort of code in CNS or states file. Thing is which code and how to implement.

Алексей

Hmm, it looks like Add1 transparency to me. For that to look nice, you have to have a super clean sprite because it will show the black around the sprite.

-[Все слова это только слова.]-

Flowrellik

hting is how to add it though. I want to experiment abit with this.

Niitris

Quote from: Алексей on November 03, 2014, 06:42:09 PM
Hmm, it looks like Add1 transparency to me. For that to look nice, you have to have a super clean sprite because it will show the black around the sprite.

Ah, so that's what it is; wanted to experiment with lighting effects and such. Something I'd thought I'd know by now. :P

Flowrellik

Ikr.
So far Tatsu made some pretty amazing effects with this, and was shown on his vids. I would like to at least try and replicate this because lets face it: Exhibit A has a cross feel of KOFXIII with CVS2.

Алексей

Quote from: Niitris on November 03, 2014, 07:33:03 PM
Ah, so that's what it is; wanted to experiment with lighting effects and such. Something I'd thought I'd know by now. :P
It's never too late to learn new things. :D

You can go about it a few ways actually. First is in the animation itself. On each frame, you have transparency options. There are presets like "A" and "S." Set it to A1 to get Add1 transparency. The second way is on the Explod sctrl. There's a parameter called trans. Set that to "add1" without the quotes. The third way is with the "Trans" sctrl and setting the trans parameter to "add1" like with the last method.

-[Все слова это только слова.]-

Flowrellik

yeah about that.
I found out the "hadouken" is actually a helper not an explod.
I tried many means even in animations but it looks like this is not budging one bit.

Алексей

Explod or Helper, I provided ways to use Add1 with both. I'm not really sure if it is Add1, but Add would be more noticeable and look like your Exhibit B. You should look at the source of that projectile and see what's going on. Check the CNS and the actual animation.

-[Все слова это только слова.]-

Memo

That ryu has hi res fx while the other char does not

Flowrellik

yeah I know that -_-.

Spoiler (click to show)
[Statedef 1000]
type = S
physics = S
movetype = A
anim = 1000
ctrl = 0
velset = 0, 0
poweradd = 72 * !var(20)
sprpriority = 1
facep2 = 1

[State 1000, Strength]
type = varset
trigger1 = !time && !AIlevel
var(10) = ifelse(command = "qcfz", 3, ifelse(command = "qcfy", 2, 1))
[State 1000, Strength AI]
type = varset
trigger1 = !time && AIlevel
var(10) = ifelse((p2movetype = H || random < 500), 3, ifelse(random < 500, 2, 1))

[State 1000, width]
type = width
trigger1 = animelemtime(5) = 0
value = 30, 0

[State 1000, Hadouken]
type = helper
trigger1 = animelemtime(5) = 1
helpertype = normal
stateno = 1005
ID = 1005
name = "Hadouken"
postype = p1
pos = 70, -68
size.xscale = 0.5
size.yscale = 0.5
ownpal = 1

[State 1000, Snd]
type = playsnd
trigger1 = animelem = 3
value = 4 + (var(1) = 2) * 10, 0
channel = 0
[State 1000, Snd]
type = playsnd
trigger1 = animelemtime(5) = 1
value = 5, 0

[State 1000, End]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
The Ryu is by POTS (Mrlyly edit). I'm not giving up yet until I figure out how this projectile works.

Алексей

Post stateno 1005 since that's the helper.

-[Все слова это только слова.]-

Memo

You should just use the projectile helpers from 1 of jmorphsmans chars
Since its updated code.

Flowrellik

#12
I thought about it zordon and I found The helper.
Spoiler (click to show)
[Statedef 1005]
type = S
physics = N
movetype = A
anim = 1005
ctrl = 0
velset = 0, 0
sprpriority = 4

[State 1005, HitOverride]
type = hitoverride
trigger1 = 1
time = -1
attr = SCA, AA, AP, AT
stateno = 1006
ignorehitpause = 1
[State 1005, HB]
type = hitby
trigger1 = 1
time = -1
value = SCA, NP, SP, HP
ignorehitpause = 1

[State 1005, Strength]
type = varset
trigger1 = !time
var(10) = root, var(10)
[State 1005, movehitvar]
type = varset
trigger1 = movecontact && numtarget
trigger1 = !(target, ishelper)
var(3) = 1
ignorehitpause = 1

[State 1005, Vel]
type = velset
trigger1 = 1
x = ifelse(var(10) = 3, 6, ifelse(var(10) = 2, 4.5, 3.375))
y = 0

[State 1005, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 1005, HitSound]
type = playsnd
trigger1 = movehit && numtarget
trigger1 = target, time = 0 && target, movetype = H
value = 2, 7
persistent = 0
ignorehitpause = 1

[State 1005, Hit]
type = hitdef
trigger1 = !(Root, var(16)) && (Root, var(15) < 1 || Root, var(20))
trigger1 = !(Root, var(27))
priority = 4, Hit
attr = S, SP
;damage = ceil(52 * root, fvar(12)), 7
damage = ceil(ifelse((root, fvar(12)) * 52 < 7, 7, (root, fvar(12)) * 52)), 8
animtype = Hard
hitflag = MAF
guardflag = MA
pausetime = 0, 12 / ((root, var(20) > 0) + 1)
sparkno = -1
guard.sparkno = -1;s7001
sparkxy = -10, 0
guardsound = s2, 0
ground.type = High
ground.slidetime = 16
ground.hittime = 16
ground.velocity = -10.52, 0
ground.cornerpush.veloff = 0
air.velocity = -4, -4
air.fall = 1
fall.recover = 1
fall.recovertime = 120
getpower = ifelse(p2movetype = H, 72, 144) * !(root, var(20)), 36 * !(root, var(20))
givepower = 36, 36
envshake.time = 14
envshake.freq = 120
envshake.ampl = 4
sprpriority = 4
yaccel = 0.5
airguard.ctrltime = 16
airguard.velocity = ifelse((root, var(20)), -4, -8), -1.5
forcestand = 1
palFX.time = 12 * (root, var(29))
palFX.add = 255,255,255
palFX.sinAdd= -255,-255,-255,48

[State 1005, Miss]
type = hitdef
trigger1 = numenemy
trigger1 = (enemynear, stateno = [5070, 5071])
attr = S, SP
hitflag =

;[State 1005, Sparks]
;type = explod
;trigger1 = movehit && numtarget
;trigger1 = (target, movetype = H) && !(target, time)
;anim = 7020 + (random % 8)
;ID = 7000
;sprpriority = 5
;postype = left
;pos = ceil((target, pos x) -((target, const(size.ground.front) -10) * facing) + 160), ceil(screenpos y)
;removetime = -2
;ownpal = 1
;facing = -1
;ignorehitpause = 1
;persistent = 0
;pausemovetime = 100
;supermovetime = 100

[State 1005, hitspark]
type = helper
trigger1 = moveContact = 1 && numtarget
trigger1 = !(target, hitshakeover)
helperType = Normal
stateNo = ifElse(moveguarded, 8001, 8013)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(p2dist x < 0, 0, ifelse(p2dist x < 20, ceil(p2dist x), 20)), 0
facing = -1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
persistent = 0
ignoreHitPause = 1

Алексей


[State 1005, Assert]
type = trans
trigger1 = 1
trans = addalpha ; <-- Change to Add1
alpha = 256, 256 ; <-- Remove this line
ignorehitpause = 1

-[Все слова это только слова.]-

Flowrellik


Алексей


-[Все слова это только слова.]-

Markpachi

I honestly think we should ask Tatsu himself, so that we'll know his method on how he does it. I'm curious about this as well.

Rest in peace, Tamez. Thank you for everything.

Flowrellik

I tried asking him before but I didn't get a reply :T