Problems with my last hyper for Marisa_RP

Started by TrinitroRoy, May 19, 2013, 12:30:10 PM

Previous topic - Next topic

TrinitroRoy

Hello again,
as you may already saw, I'm working on Marisa Kirasame in RicePigeon's old style.
And now, I'm at my last hyper: Orreries Universe.
I'm trying to recreate Marisa's second Story Mode Spell Card from Scarlet Weather Rapsody, where she rides her broom while the orbs are surounding her, as a timed Spell Card.
However, now I need to know, how I can make it like that so Marisa is in a special state, which does following things:

  • if Marisa is on her broom and doesn't move, the orbs start to do one of their 3 bullet patterns, and all 3 patterns need a different amount of time to be counted as finished
  • if the orbs finished one of their bullet patterns, Marisa starts to fly to a random place, and stops afterwards, just to repeat the previous step
  • if the power is 0, Marisa gets to her falling state
Thanks in advance!
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Veolf

Last one can be done through changestate and power check.
[Changestate, 50]
trigger1 (presumed) = power <= 0
value = (state for change)

1st one can be done if there is no velset by checking if there is no velocity being used. Then use a varset to determine that change and just do your 3 bullet patterns from there.

2nd one is just random% for distance/direction and just indicate a stop with either animelem to changeanim back to the 1st step.

So for those 2 steps, use trigger = anim to not have conflicting state changes to your special state.

TrinitroRoy

#2
Okay, another question: How can I achieve that diagonal laser effect from the original Orreries Universe without using multiple sprites, but still being in sync with the orbs?
And how can I make it like that so every orb uses the same attack?
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Ricepigeon

Quote from: Trinitronity on May 20, 2013, 12:59:57 PM
Okay, another question: How can I achieve that diagonal laser effect from the original Orreries Universe without using multiple sprites, but still being in sync with the orbs?

I assume you mean that the angle of the laser changes and you want the hitbox to change with it as well?

This is one of the few times where the Projectile state controller comes in handy over using Helper Projectiles. Just have the laser constantly spawn invisible projectiles that travel the angle of the laser (using sin and cos for x and y velocities, respectively).

Off the top of my head, if you want examples of this in action the following characters I released used something like this:

Yuyuko (Light of the Undead, Resurrection Butterfly)
Lie Meiling (Dichromatic Spark)
Hong Meiling (Fragrant Wave)
Cyber Naraku (Sweep Laser)

TrinitroRoy

Quote from: Ricepigeon on May 20, 2013, 03:29:40 PM
Quote from: Trinitronity on May 20, 2013, 12:59:57 PM
Okay, another question: How can I achieve that diagonal laser effect from the original Orreries Universe without using multiple sprites, but still being in sync with the orbs?

I assume you mean that the angle of the laser changes and you want the hitbox to change with it as well?

This is one of the few times where the Projectile state controller comes in handy over using Helper Projectiles. Just have the laser constantly spawn invisible projectiles that travel the angle of the laser (using sin and cos for x and y velocities, respectively).

Off the top of my head, if you want examples of this in action the following characters I released used something like this:

Yuyuko (Light of the Undead, Resurrection Butterfly)
Lie Meiling (Dichromatic Spark)
Hong Meiling (Fragrant Wave)
Cyber Naraku (Sweep Laser)
Thanks, will look into that.

     Posted: May 20, 2013, 09:16:35 PM
Okay, I already got a problem:

; Orreries Universe Orb
[Statedef 4220]
movetype = A
physics = N
ctrl = 0
anim = 1998
velset = 0,0
sprpriority = 1

[State 2105]
type = AngleDraw
trigger1 = 1
scale = 0.75,0.75
ignorehitpause = 1

;[State 1010, VA]
;type = varadd
;trigger1 = time || ((time = 0)&&(var(40) > 0))
;var(40) = 1

[State 1010, NHB]
type = nothitby
trigger1 = 1
time = -1
value = ,AA,AT
ignorehitpause = 1

[State 1010, CA]
type = changeanim
trigger1 = time = 0
value = 3102+1*ishelper(3103)+2*ishelper(3104)+3*ishelper(3105)+4*ishelper(3106)+5*ishelper(3107)

[State 1001, AFI]
Type = AfterImage
Trigger1 = var(1) = 0
Trans = Add
Time = -1;2
Length = 8
TimeGap = 3
FrameGap = 1
PalBright = 0,0,0
PalContrast = 128,128,128
PalAdd = 0,0,0
PalMul = .8,.8,.8

[State 1001, Anglesetter]
type = Null
triggerall = time = 0;var(40) = 0
trigger1 = ishelper(3102)
trigger1 = (var(0):= 0) || 1
trigger2 = ishelper(3103)
trigger2 = (var(0):= 90) || 1
trigger3 = ishelper(3104)
trigger3 = (var(0):= 180) || 1
trigger4 = ishelper(3105)
trigger4 = (var(0):= 270) || 1

[State 1001, VS]
type = varset
trigger1 = 1
fvar(0) = ifelse(power>2960,(3000-power)/30.0,ifelse(power<=40,(power)/30.0,1.0))

[State 3102, STS]
type = statetypeset
trigger1 = power<=10
movetype = I

[State 1010, PS]
type = posset
trigger1 = 1
x = floor(root,pos x)+floor(50*fvar(0)*cos((var(0)+((3000-power)))*pi/180.0))*(-(root,facing))
y = floor(root,pos y)+root,const(size.mid.pos.y)+floor(50*fvar(0)*sin((var(0)+((3000-power)))*pi/180.0))

;[State 4201]
;type = varrandom
;trigger1 = var(48) = 120
;v = 47
;range = 1, 4

[State 4201]
type = varset
trigger1 = 1
v = 47
value = 1

[State 4201]
type = varset
trigger1 = root, anim = 4202
v = 48
value = 0

[State 4201]
type = VarAdd
trigger1 = root, anim = 4201 || root, anim = 4200
v = 48
value = 1

[State 4000, Effect]
type = helper
trigger1 = var(48) = 120
trigger1 = var(47) >= 1 && var(47) < 2
persistent = 0
helpertype = normal
name = "Laser"
ID = 4221
pos = 3,-40
postype = p1
stateno = 4220
ownpal = 1
facing = 1
pausemovetime = 180
supermovetime = 180

[State 1001, ASS]
Type = AssertSpecial
Trigger1 = 1
Flag = Noshadow

[State 1001, SPR]
Type = SprPriority
Trigger1 = 1
Value = 5
ignorehitpause = 1

[State 1001, AIT]
Type = AfterImageTime
;trigger1 = root,stateno != 3100
trigger1 = root,movetype = H
trigger2 = root,alive = 0
trigger3 = power <= 0;var(40) >= 150
time = 0

[State 1001, Zeeky]
type = DestroySelf
;trigger1 = root,stateno != 3100
trigger1 = root,movetype = H
trigger2 = root,alive = 0
trigger3 = power <= 0;var(40) >= 150

The lasers wont spawn. What do I do wrong?
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Ricepigeon

Quote from: Trinitronity on May 20, 2013, 09:15:32 PM

[State 4201]
type = varset
trigger1 = 1
v = 47
value = 1

[State 4201]
type = varset
trigger1 = root, anim = 4202
v = 48
value = 0

[State 4201]
type = VarAdd
trigger1 = root, anim = 4201 || root, anim = 4200
v = 48
value = 1

[State 4000, Effect]
type = helper
trigger1 = var(48) = 120
trigger1 = var(47) >= 1 && var(47) < 2
persistent = 0
helpertype = normal
name = "Laser"
ID = 4221
pos = 3,-40
postype = p1
stateno = 4220
ownpal = 1
facing = 1
pausemovetime = 180
supermovetime = 180

The lasers wont spawn. What do I do wrong?

From the looks of it it looks like the lasers are supposed to spawn after 120 ticks pass while Marisa is in anim numbers 4200 and 4201, but you also have the line "persistent = 0", which should only cause one laser to appear once throughout the entire duration of the state.

I suspect something else may be causing the lasers to selfdestruct too early. Mind posting the code for that?

EDIT: The destruct controller causes it to destroyself when the root is not in state 3100, but you're using anims 4200-4202 in the root? Is this intentional?

TrinitroRoy

Quote from: Ricepigeon on May 21, 2013, 04:11:47 PM
EDIT: The destruct controller causes it to destroyself when the root is not in state 3100, but you're using anims 4200-4202 in the root? Is this intentional?
Whoops, that's an error on my side. Though, I actually commented it out...
Quote from: Ricepigeon on May 21, 2013, 04:11:47 PM
From the looks of it it looks like the lasers are supposed to spawn after 120 ticks pass while Marisa is in anim numbers 4200 and 4201, but you also have the line "persistent = 0", which should only cause one laser to appear once throughout the entire duration of the state.
Really? What's the value or persistant should be?
Quote from: Ricepigeon on May 21, 2013, 04:11:47 PM
I suspect something else may be causing the lasers to selfdestruct too early. Mind posting the code for that?
Sure, I can post the code:

; Orreries Laser
[Statedef 4221]
Type = S
Movetype = A
physics = N
sprPriority = 1
anim = 4203
ctrl = 0
velset = 0,0

[State 4221, PS]
type = angleset
trigger1 = 1
value = (parent, pos x)*(parent, pos y)

[State 4221]
type = PosSet
trigger1 = 1
X = parent, pos x
Y = parent, pos y

[State 4221, NHB]
type = nothitby
trigger1 = 1
value = sca

[State 4221, Turn]
Type     = Turn
Trigger1 = P2Dist X < 0

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 4221, HOR]
type = HitOverRide
trigger1 = Time = 0
time = -1
attr = SCA, AP,AA,AT
slot = 0
stateno = 3056

[State 4221]
type = VarSet
trigger1 = time = 479
v = 49
value = 1

[State 4221, CS]
Type = DestroySelf
trigger1 = time = 480

It doesn't have the invisible projectiles right. since I want to make the lasers display properly first.
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Veolf

The self destruct either destroys at time =480 or the fx time (anim) is already lapsed. I suggest taking persistent = 0 and make  persistent = (How many lasers you want, in this case it is 4).

Ricepigeon

Persistent basically dictates how often the state controller should occur. Its set to 1 by default, which means to occur every 1st time the triggers are true (which is to say, every time).

Setting persistent = 2 would cause it to activate every 2nd time after the 1st. That is to say....

trigger1 = time%2 = 0
persistent = 1


and

trigger1 = 1
persistent = 2


are equivalent. Setting persistent to 0 means that the controller will never activate again once it has already activated until you reenter the state.

I dont see anything in the laser helper state to suggest its destroying itself prematurely. I think its either the issue with persistent or the stateno 3100 thats causing it to happen.

TrinitroRoy

Oh wait, it wasn't the fault of persistant. It was the fault of the helper creator part of the state.
I refferenced to the wrong state. Stupid me!
However, I got a new problem: the lasers don't change the angle...

[State 4221, PS]
type = angleset
trigger1 = 1
value = (parent, pos x)*(parent, pos y)

I'm sure I did something wrong, but I don't know what...

Also, when the lasers disappear, Marisa doesn't start to move...

; Orreries Universe - Flight State
[Statedef 4201]
type    = S
movetype = A
physics = S
ctrl = 0
anim = 4201
velset = 0, 0
sprpriority = 2

[State 1010, DEPLETE DA POWAH!]
type = poweradd
trigger1 = time || ((time = 0)&&(power < 3000))
value = -1

;[State -2, ComboLimit Add]
;type = varset
;trigger1 = time = 0
;v = 6
;value = 0
;persistent = 0

[State 4201]
type = varrandom
trigger1 = 1
v = 45
range = 1, 7
[State 4201]
type = varrandom
trigger1 = 1
v = 46
range = -3, 3

[State 4201]
type = ChangeAnim
trigger1 = var(49) = 1
trigger1 = anim = 4201
value = 4202

[State 4201, I've got to move it move it!]
type = VelSet
trigger1 = anim = 4202
X = var(45)
Y = var(46)

[State 4201, Gotta stop now!]
type = ChangeAnim
trigger1 = anim = 4202
trigger1 = animtime = 0
value = 4201

[State 4201, STOP!]
type = VelSet
trigger1 = anim = 4201
X = 0
Y = 0

[State 4201, NHB]
type = nothitby
trigger1 = 1
value = SCA, AA, AP, AT

;[State 4201, TB]
;type = targetbind
;trigger1 = time = 0
;id = 4200
;pos = 50,0

;[State 210, PSND]
;type = playsnd
;trigger1 = animelem = 6
;value = 4200,2
;channel = 0

[State 3200, CS]
type = changestate
trigger1 = power = 0
Value = 52
Ctrl = 0

What do I do wrong?
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Ricepigeon

#10
Quote from: Trinitronity on May 21, 2013, 08:01:40 PM
Oh wait, it wasn't the fault of persistant. It was the fault of the helper creator part of the state.
I refferenced to the wrong state. Stupid me!
However, I got a new problem: the lasers don't change the angle...

[State 4221, PS]
type = angleset
trigger1 = 1
value = (parent, pos x)*(parent, pos y)

I'm sure I did something wrong, but I don't know what...

What you're doing is changing the angle based on the parent's X and Y position values. I'm sure this isn't what you intended to do, as the top right corner of the screen is going to give you an angle of 160*-240, or -38400.

Did you want the lasers to be angled to match that of the orbs? You may have to reference the parent helper's angle in relation to Marisa that case. Simplest way to do this would be to just store the angle in a variable and read it from there using trigger redirection.

Might also be worthwhile to have the orbs use sin and cos in its bindtoroot controller, rather than use velocities or posset, if you havent done so already. If you lifted the code directly from my old Mima then it should be there already.

TrinitroRoy

#11
Quote from: Ricepigeon on May 23, 2013, 05:27:54 PM
Did you want the lasers to be angled to match that of the orbs? You may have to reference the parent helper's angle in relation to Marisa that case. Simplest way to do this would be to just store the angle in a variable and read it from there using trigger redirection.
Well, the angle actually gets stored already...I think:
[State 1001, Anglesetter]
type = Null
triggerall = time = 0;var(40) = 0
trigger1 = ishelper(3102)
trigger1 = (var(0):= 0) || 1
trigger2 = ishelper(3103)
trigger2 = (var(0):= 90) || 1
trigger3 = ishelper(3104)
trigger3 = (var(0):= 180) || 1
trigger4 = ishelper(3105)
trigger4 = (var(0):= 270) || 1

I guess, the angle should be var(0) then? Just tried out, didn't worked...
Quote from: Ricepigeon on May 23, 2013, 05:27:54 PM
Might also be worthwhile to have the orbs use sin and cos in its bindtoroot controller, rather than use velocities or posset, if you havent done so already. If you lifted the code directly from my old Mima then it should be there already.
Well...
[State 1010, PS]
type = posset
trigger1 = 1
x = floor(root,pos x)+floor(50*fvar(0)*cos((var(0)+(var(1)*5*fvar(2)))*pi/180.0))
y = floor(root,pos y)+root,const(size.mid.pos.y)+floor(50*fvar(0)*sin((var(0)+(var(1)*5*fvar(2)))*pi/180.0))

This is from your Mima, and I only see possets there. :S
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Ricepigeon

Right, I was looking at Lie and Reimu which had a similar code using BindtoParent instead.

Anyway, Var(0) is only the initial angle. I believe the rest of it was also based on var(1), which was a custom time counter (needed to produce the speed up/slow down of Orreries Sun's laser attacks). If you condense that to an unused variable and have the lasers read that, it should produce the desired effect.

TrinitroRoy

Quote from: Ricepigeon on May 23, 2013, 06:57:46 PM
Anyway, Var(0) is only the initial angle. I believe the rest of it was also based on var(1), which was a custom time counter (needed to produce the speed up/slow down of Orreries Sun's laser attacks). If you condense that to an unused variable and have the lasers read that, it should produce the desired effect.
Are you sure? I haven't found anything, and I have tested the laser of Mima's Orreries Sun, and there wasn't any speed up/slow down... :-\
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Ricepigeon

The orbs should rotate faster when doing the gatling shots and rotate slower when firing the laser.

TrinitroRoy

Quote from: Ricepigeon on May 23, 2013, 08:14:12 PM
The orbs should rotate faster when doing the gatling shots and rotate slower when firing the laser.
Oh wait, now I notice that. o_O
And I think, I have found the code, which handles the speed:

[State 2001, VS]
type = varset
trigger1 = 1
fvar(2) = ifelse((root,stateno = 1001)&&(root,var(10)=1)&&(root,animelem=4,>=0),2.0,1.0)

[State 2001, VS]
type = varset
trigger1 = 1
fvar(2) = ifelse((root,stateno = 1001)&&(root,var(10)=2)&&(root,animelem=4,>=0),0.5,fvar(2))

[State 1010, PS]
type = posset
trigger1 = 1
x = floor(root,pos x)+floor(50*fvar(0)*cos((var(0)+(var(1)*5*fvar(2)))*pi/180.0))
y = floor(root,pos y)+root,const(size.mid.pos.y)+floor(50*fvar(0)*sin((var(0)+(var(1)*5*fvar(2)))*pi/180.0))
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

TrinitroRoy

Sorry to bump, but I just wanted to note that the problem with Marisa not moving has been solved thanks to Cyanide.
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

TrinitroRoy

#17
Sorry to bump, but aside from the beams still not changing angles (I just couldn't make it work properly), I also got a new problem:

;---------------------------
; Orreries Universe Orb
[Statedef 4220]
movetype = A
physics = N
ctrl = 0
anim = 1998
velset = 0,0
sprpriority = 1

[State 2105]
type = AngleDraw
trigger1 = 1
scale = 0.75,0.75
ignorehitpause = 1

[State 1010, NHB]
type = nothitby
trigger1 = 1
time = -1
value = ,AA,AT
ignorehitpause = 1

[State 1010, CA]
type = changeanim
trigger1 = time = 0
value = 3102+1*ishelper(3103)+2*ishelper(3104)+3*ishelper(3105)+4*ishelper(3106)+5*ishelper(3107)

[State 1001, AFI]
Type = AfterImage
Trigger1 = var(1) = 0
Trans = Add
Time = -1;2
Length = 8
TimeGap = 3
FrameGap = 1
PalBright = 0,0,0
PalContrast = 128,128,128
PalAdd = 0,0,0
PalMul = .8,.8,.8

[State 1001, Anglesetter]
type = Null
triggerall = time = 0;var(40) = 0
trigger1 = ishelper(3102)
trigger1 = (var(0):= 0) || 1
trigger2 = ishelper(3103)
trigger2 = (var(0):= 90) || 1
trigger3 = ishelper(3104)
trigger3 = (var(0):= 180) || 1
trigger4 = ishelper(3105)
trigger4 = (var(0):= 270) || 1

[State 1001, VS]
type = varset
trigger1 = 1
fvar(0) = ifelse(power>2960,(3000-power)/30.0,ifelse(power<=40,(power)/30.0,1.0))

[State 3102, STS]
type = statetypeset
trigger1 = power<=10
movetype = I

[State 1010, PS]
type = posset
trigger1 = 1
x = floor(root,pos x)+floor(50*fvar(0)*cos((var(0)+((3000-power)))*pi/180.0))*(-(root,facing))
y = floor(root,pos y)+root,const(size.mid.pos.y)+floor(50*fvar(0)*sin((var(0)+((3000-power)))*pi/180.0))

[State 4201]
type = varset
trigger1 = var(48) = 120
v = 47
value = 1+random%3

;[State 4201]
;type = varset
;trigger1 = 1
;v = 47
;value = 1

[State 4201]
type = varset
trigger1 = root, anim = 4202
v = 48
value = 0

[State 4201]
type = VarAdd
trigger1 = root, anim = 4201; || root, anim = 4200
v = 48
value = 1

[State 4000, Effect]
type = helper
trigger1 = var(48) = 120
trigger1 = var(47) = 1;>= 1 && var(47) < 2
;persistent = -1;0;4
helpertype = normal
name = "Laser"
ID = 4221
pos = 3,-40
postype = p1
stateno = 4221
ownpal = 1
facing = 1
pausemovetime = 180
supermovetime = 180

[State 4000, Effect]
type = helper
trigger1 = var(48) = 120 || var(48) = 124 || var(48) = 128 || var(48) = 132 || var(48) = 136 || var(48) = 140
trigger1 = var(47) != 1;>= 2;var(47) >= 2 && var(47) < 3
;persistent = -1;0;4
helpertype = normal
name = "Aimed Shot"
ID = 4222
pos = 3,-40
postype = p1
stateno = 4222
ownpal = 1
facing = 1
pausemovetime = 180
supermovetime = 180

[State 1001, ASS]
Type = AssertSpecial
Trigger1 = 1
Flag = Noshadow

[State 1001, SPR]
Type = SprPriority
Trigger1 = 1
Value = 5
ignorehitpause = 1

[State 1001, AIT]
Type = AfterImageTime
;trigger1 = root,stateno != 3100
trigger1 = root,movetype = H
trigger2 = root,alive = 0
trigger3 = power <= 0;var(40) >= 150
time = 0

[State 1001, Zeeky]
type = DestroySelf
;trigger1 = root,stateno != 3100
trigger1 = root,movetype = H
trigger2 = root,alive = 0
trigger3 = power <= 0;var(40) >= 150

If I do this, then not every orb does the same attack. How do I fix this?
Oh and I think I did something wrong here as well:
[State 4222]
type = VelSet
trigger1 = time = 0
X=1
Y=P2Dist Y+enemynear,const(size.mid.pos.y)

With that, I try to make the aiming part of the second bullet pattern I'm coding while I still have problems with the first one.
While I know, that I did something wrong in the Y part, I don't what the correct value should be...
...please help me. Thanks in advance!
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

TrinitroRoy

Sorry to bump, but I have updated the previous post with a code optimization suggested by Cyanide.
I hope, the problem can be solved easier that way...
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Seravy

QuoteY=P2Dist Y+enemynear,const(size.mid.pos.y)
This sets the Y velocity to be the same as the distance of the opponent's midsection.
Meaning you'll reach it by moving one tick. Then next tick you move that much again and again and in just a few ticks you left the screen.
If your aim is to reach the opponent in a set amount of time, then you need to divide this by the amount of time.
For example if you want to reach the y position of the opponent in 20 ticks then you would need
Y=(P2Dist Y+enemynear,const(size.mid.pos.y))/20.0

QuoteIf I do this, then not every orb does the same attack. How do I fix this?

You are setting var(47) to a random value from 1 to 3, then do a laser if that value is 1 and a shot if it is not 1. If the attack is randomly selected by the orb itself then each orb will do a different thing.