YesNoOk
avatar

projectile wont fire (Read 2331 times)

Started by jamestheepic, June 11, 2024, 09:38:35 am
Share this topic:
projectile wont fire
New #1  June 11, 2024, 09:38:35 am
  • avatar
  • *
    • Australia
so basically i'm trying make my character shoot a projectile but when i try click the move he does the animation but no fireball spawns

heres the code

[Statedef 1000]
type    = S
movetype= A
physics = S
poweradd= 55
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 8
value = 0, 2
channel = 1

[State 1000, 3 Helper]
type = Helper
trigger1 = animelem = 10
name = "Fireball"
ID = 1000
stateno = 1001
pos = 43,-60
postype = p1   
facing = 1
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(Pos Y != 0 || Vel Y != 0,50,0)
ctrl = 1

[Statedef 1001]
type    = S
movetype= A
physics = S
poweradd= 55
velset = 4,0
anim = 1001
sprpriority = 2

[State 1001, 1 HitDef]
type = HitDef
trigger1 = time = 10
attr = S, SP
animtype  = Medium
damage    = 50, 4
hitflag = MA
guardflag = L
pausetime = 0,12
sparkno = S70010
guard.sparkno = S7000
sparkxy = -10,0
hitsound   = S5,0
guardsound = S6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4
air.velocity = -2,-4.2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
palfx.time = 10
palfx.mul = 250,224,120
palfx.add = 240,50,0
palfx.sinadd = 110,55,85,10

[State 1002, DestroySelf]
type = DestroySelf
trigger1 = !animtime

let me know if theres any problems in the code if not any suggestions welcome.
Last Edit: June 23, 2024, 08:44:00 am by jamestheepic
Re: projectile wont fire
#2  June 11, 2024, 09:53:49 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Do you have an animation 1001?
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: projectile wont fire
#3  June 11, 2024, 10:14:04 am
  • avatar
  • *
    • Australia
Yes
Re: projectile wont fire
#4  June 11, 2024, 10:46:28 am
  • *
It looks like either [anim 1000] never reaches animelem=10 or [anim 1001] has very short/weird loop time. Also double check that [anim 1001] doesn't have any duplicates.
Re: projectile wont fire
#5  June 11, 2024, 10:51:26 am
  • avatar
  • *
    • Australia
no it doesnt have any duplicates
Re: projectile wont fire
#6  June 11, 2024, 10:56:18 am
  • *
It would be nice to see how .air file code for both 1000 and 1001 looks like.
Re: projectile wont fire
#7  June 11, 2024, 11:04:47 am
  • avatar
  • *
    • Australia
here it is
; Fireball shoot
[Begin Action 1000]
Clsn2: 1
  Clsn2[0] = -41, -97, 49, 1
0,0, 0,0, 10


; Fireball
[Begin Action 1001]
Clsn1Default: 1
  Clsn1[0] = -7, -7, 8, 9
1000,0, 0,0, 10
1000,1, 0,0, 10
Re: projectile wont fire
#8  June 11, 2024, 11:10:30 am
  • *
Animation 1000 has only 1 element so animelem=10 never triggers. Use time=x instead to create a fireball helper. Like this:

[State 1000, 3 Helper]
type = Helper
trigger1 = time = 8
name = "Fireball"
ID = 1000
stateno = 1001
pos = 43,-60
postype = p1   
facing = 1
ownpal = 1
supermovetime = 0
pausemovetime = 0