Solved How to toss bombs with aerial attack2 command

Question that is answered or resolved.

mulambo

Member
Code:
Currently attack2 is mapped to throwing knife and it works correctly. 
I've followed a tutorial here about tossing bombs, customized for my sprites and and sounds, so the code is now like this, in player's txt :

anim attack2
range 120 160
rangez -35 35
delay 15
tossframe 1 50 
offset 41 119
bbox 18 24 35 96
frame data/chars/guy/jump1.gif
delay 8
frame data/chars/guy/jump2.gif
delay 16
frame data/chars/guy/jump3.gif
delay 8
frame data/chars/guy/jump4.gif
frame data/chars/guy/jump5.gif
in models.txt is both loaded and known
and this is the bomb.txt
Code:
name Bomb
speed 13
jumpheight 3
type none
shadow 1

anim idle
loop 1
delay 10
offset 12 13
hitflash spark
burn 2 2 20 20 15 1
hitfx data/sounds/glass1.wav
frame data/chars/misc/bomb.gif

anim attack1
delay 4
offset 60 68
hitflash spark
hitfx data/sounds/glass1.wav
sound data/sounds/glass1.wav
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
burn 25 12 60 73 15 1
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
attack 0
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif
frame data/chars/misc/bomb.gif

anim attack2
delay 4
offset 40 48
sound data/chars/ralf/xplosion.wav
frame data/chars/misc/bomb1.gif
frame data/chars/misc/bomb2.gif 
frame data/chars/misc/bomb3.gif 
frame data/chars/misc/bomb4.gif 
frame data/chars/misc/bomb5.gif 
frame data/chars/misc/bomb6.gif
But still I didn't have a way to test if it works because I don't know how to make the player throw bombs during jump and by pressing attack2.
 
maxman said:
If throwing in air, would you be using custstar for throwing knives downwards?
Currently I have set up the attack 2 command for knives standing, I just want to use the same button for tossing bombs from air (as there's a specific tactic in using them like... imagine a wall of enemies and a specific enemy beyond them, I can jump and toss the bomb on that specific enemy).
I don't know what custstar does, I followed a tutorial about tossing bombs (as written in the code above) but it doesn't seem to work. Any clue?
 
I've used the custbomb command in animations meant to throw the things to desired effect. It's worked very well for me. Though to be fair, I declare all my projectiles (knives, bullets, etc,) as bombs, because it gives me more options to customize their varying effects.
Try it out, and best of luck to you bro!  ;D
 
SaintJudas said:
I've used the custbomb command in animations meant to throw the things to desired effect. It's worked very well for me. Though to be fair, I declare all my projectiles (knives, bullets, etc,) as bombs, because it gives me more options to customize their varying effects.
Try it out, and best of luck to you bro!  ;D
Can you provide a little explanation/tutorial on how to do it?
I've already done the sprites for the bomb and its explosion, what should I use as code on the models.txt and on the bomb.txt ? Also: how to assign it to "attack2" under jump state ? thanks
sorry if the question sounds obvious, but I'm kinda new to this engine.
 
Hmmm.... have you tried defining custbomb like this:

Code:
anim attack2
range 120 160
rangez -35 35
delay 15
tossframe 1 50 
custbomb Bomb
offset 41 119
bbox 18 24 35 96
frame data/chars/guy/jump1.gif
delay 8
frame data/chars/guy/jump2.gif
delay 16
frame data/chars/guy/jump3.gif
delay 8
frame data/chars/guy/jump4.gif
frame data/chars/guy/jump5.gif
 
Bloodbane said:
Hmmm.... have you tried defining custbomb like this:

Code:
anim attack2
range 120 160
rangez -35 35
delay 15
tossframe 1 50 
custbomb Bomb
offset 41 119
bbox 18 24 35 96
frame data/chars/guy/jump1.gif
delay 8
frame data/chars/guy/jump2.gif
delay 16
frame data/chars/guy/jump3.gif
delay 8
frame data/chars/guy/jump4.gif
frame data/chars/guy/jump5.gif
unfortunely it doesn't work... I jump, press attack 2 but nothing happens.
maybe attack2 can't be performed in air (according to what's written in the manual) ?
 
Ah I missed the general idea, the problem lies elsewhere instead

I'm not sure how you perform this ATTACK2 but if you're using com, then you can use similar command in JUMP animation like this:
Code:
anim jump
	cancel 0 9 0 a2 freespecial2
...

Read manual for more info about cancel command

Hmmm... you might need to make FREESPECIAL2 for throwing bomb in midair
 
Bloodbane said:
Ah I missed the general idea, the problem lies elsewhere instead

I'm not sure how you perform this ATTACK2 but if you're using com, then you can use similar command in JUMP animation like this:
Code:
anim jump
	cancel 0 9 0 a2 freespecial2
...

Read manual for more info about cancel command

Hmmm... you might need to make FREESPECIAL2 for throwing bomb in midair

currently what seems to be attack2 button is used for throwing knives, this way:

com A2 freespecial2
Code:
anim freespecial2 
	custknife	knifep
	throwframe	3 60
energycost 2
	offset	46 111
	bbox	212 143 30 55
	hitfx   data/sounds/hit01.wav 
        delay   6
	frame	data/chars/guy/kl00.gif 
        delay   12
	frame	data/chars/guy/kl01.gif 
        delay   5
        attack  64 37 38 40 8 1
	frame	data/chars/guy/kl02.gif
        delay   19
	frame	data/chars/guy/kl03.gif

I just want to use the same button to launch bombs in mid-air (so, probably another name instead of freespecial2.. like, freespecial3?  ). 
 
Back
Top Bottom