Barrel problem

Zox

New member
ok i have a code probl with barrels, when i throw it it comes back to regular idle,
i want it to be different idle when its once thrown.

3004fx2.png
 
As Zox stated on the barrel, what we are trying to do is to pick up that standing barrel so that when we can throw it, and after it's thrown to the ground, the barrel needs to lie on the ground without going back to standing. Problem is, we can't pick up a standing barrel though the laid barrel can be picked up. The picture shown above is we can pick a laid barrel from the ground not a standing one.
 
Here's the shot of the two barrels and each of them is in idle anim as 'weapons'. I can't set the standing barrel as weapon item. I want to make barrel as weapon item to carry.

DDREMAKE_0000.png


Throwing a barrel (after getting a laid barrel) will not disappear after it reaches the ground and so it performs back to idle (the laid barrel). Dunno how yours works, Bloodbane.

(Is there a way for picking up standing barrel and throwing it to the ground or hit opponent and then touch the ground without disappearing and after it's rolled to stop, it performs laid idle?)
 
I can't set the standing barrel as weapon item. I want to make barrel as weapon item to carry.

I don't understand why you can't make both barrels as weapon. Is standing barrel an obstacle?

Throwing a barrel (after getting a laid barrel) will not disappear after it reaches the ground and so it performs back to idle (the laid barrel). Dunno how yours works, Bloodbane.

My method is to 'shoot' different entity for thrown barrel. This thrown barrel, after it stops on ground, spawns barrel weapon and removes itself
Because of that, there's no need to worry about thrown barrel going back to IDLE

(Is there a way for picking up standing barrel and throwing it to the ground or hit opponent and then touch the ground without disappearing and after it's rolled to stop, it performs laid idle?)

Well, if standing barrel is a weapon, it should be easy. If it's an obstacle, we need a little workaround.
 
I don't understand why you can't make both barrels as weapon. Is standing barrel an obstacle?

If it's an obstacle, we need a little workaround.

Yeah, it is an obstacle, but I meant ONLY the standing barrel which I can't pick up as a weapon. I made a txt copy of Billy5 to be renamed as Billy11 for the standing barrel while Billy5 is for picking up only the laid barrel.

Main Billy character header:
name                Billy
health              100
speed                13
type                player
com                  a2    freespecial #High kick
com                  D F A freespecial6 #Head butt
com                  D F A2 freespecial3 #Knee
com                  d f s freespecial8 #Whirlwind kick
jumpheight          3
running              25 3 2 1 0
gfxshadow            1
falldie              1
bounce              1
atchain              1 2 3
nodieblink          1
risetime            -50
grabdistance        36
throwdamage          6
throw                1 4
makeinv              2 0
antigrab            2
mp                  100
mprate              1
icon                data/chars/Billy/Billy.png
weapons              Billy1 Billy2 Billy3 Billy4 Billy5 Billy6 Billy7 Billy8 Billy9 Billy10 Billy11 Billy
animationscript      data/scripts/player.c
palette none

The standing barrel is named barrel2 and I did set weapnum as 11. I

name            barrel2
type            item
counter        100000
subtype        weapon
gfxshadow      1
nolife          1
shootnum        1
subject_to_wall 0
weapnum 11

Both Billy5 and Billy11 (one which I created as a copy of Billy5) have the same animations except the name(s). Also they have the same pbomb to throw a barrel, but Billy11 can't pick and throw while Billy5 works.

Billy11 header:
name                Billy11
health              100
speed                10
type                none
gfxshadow            1
atchain              1
jumpheight          1
antigrab            4
mp                  100
mprate              1
running              10 0 2 1 0
icon                data/chars/Billy5/billy.png
palette              none

From both Billy5 and Billy11 (pbomb2 is thrown barrel):
anim attack
loop 0
delay 10
offset 27 84
bbox 0 0 0 0
custpbomb pbomb2
pbombframe 1 55
offset 27 84
frame data/chars/Billy5/7.png
offset 27 53
frame data/chars/Billy5/8.png
offset 27 51
frame data/chars/Billy5/9.png

pbomb2 (barrel):
Code:
name             pbomb2
type             item
counter          3
subtype          weapon
speed            8
gfxshadow        1
weapnum          9999
shootnum        9999
jumpheight       2
nolife           1
subject_to_wall  0
candamage        enemy player
palette          none

anim	attack
	loop	0
	delay	3
	offset	15 120
	bbox	0 0 0 0
	sound	data/sounds/drum2.wav
	frame	data/chars/misc/pbomb2/hit1.png
	frame	data/chars/misc/pbomb2/hit2.png
	frame	data/chars/misc/pbomb2/hit3.png
	frame	data/chars/misc/pbomb2/hit4.png
	frame	data/chars/misc/pbomb2/hit5.png
	frame	data/chars/misc/pbomb2/hit6.png
	frame	data/chars/misc/pbomb2/hit7.png
	frame	data/chars/misc/pbomb2/hit8.png
	frame	data/chars/misc/pbomb2/hit9.png
	frame	data/chars/misc/pbomb2/hit10.png
	frame	data/chars/misc/pbomb2/hit11.png
	frame	data/chars/misc/pbomb2/hit12.png
	frame	data/chars/misc/pbomb2/hit13.png
	frame	data/chars/misc/pbomb2/hit14.png
	frame	data/chars/misc/pbomb2/hit15.png
	frame	data/chars/misc/pbomb2/hit16.png
	frame	data/chars/misc/pbomb2/hit17.png
	frame	data/chars/misc/pbomb2/hit18.png
	frame	data/chars/misc/pbomb2/hit19.png
	frame	data/chars/misc/pbomb2/hit20.png
	frame	data/chars/misc/pbomb2/hit21.png
	frame	data/chars/misc/pbomb2/hit22.png
	frame	data/chars/misc/pbomb2/hit23.png
	frame	data/chars/misc/pbomb2/hit24.png
	frame	data/chars/misc/pbomb2/hit25.png
	frame	data/chars/misc/pbomb2/hit26.png
	frame	data/chars/misc/pbomb2/hit27.png
	frame	data/chars/misc/pbomb2/hit28.png
	frame	data/chars/misc/pbomb2/hit29.png
	spawnframe	data/chars/misc/pbomb2/hit30.png 68
	subentity	drum

anim	attack2
	loop	0
	delay	3
	offset	15 116
	bbox	0 0 0 0
	frame	data/chars/misc/pbomb2/hit1.png
	frame	data/chars/misc/pbomb2/hit2.png
	frame	data/chars/misc/pbomb2/hit3.png
	frame	data/chars/misc/pbomb2/hit4.png
	frame	data/chars/misc/pbomb2/hit5.png
	frame	data/chars/misc/pbomb2/hit6.png
	frame	data/chars/misc/pbomb2/hit7.png
	frame	data/chars/misc/pbomb2/hit8.png
	frame	data/chars/misc/pbomb2/hit9.png
	frame	data/chars/misc/pbomb2/hit10.png
	frame	data/chars/misc/pbomb2/hit11.png
	frame	data/chars/misc/pbomb2/hit12.png
	frame	data/chars/misc/pbomb2/hit13.png
	frame	data/chars/misc/pbomb2/hit14.png
	frame	data/chars/misc/pbomb2/hit15.png
	frame	data/chars/misc/pbomb2/hit16.png
	frame	data/chars/misc/pbomb2/hit31.png
	frame	data/chars/misc/pbomb2/hit32.png
	frame	data/chars/misc/pbomb2/hit33.png
	frame	data/chars/misc/pbomb2/hit34.png
	frame	data/chars/misc/pbomb2/hit35.png
	frame	data/chars/misc/pbomb2/hit36.png
	frame	data/chars/misc/pbomb2/hit37.png
	frame	data/chars/misc/pbomb2/hit38.png
	frame	data/chars/misc/pbomb2/hit39.png
	frame	data/chars/misc/pbomb2/hit40.png
	frame	data/chars/misc/pbomb2/hit41.png
	frame	data/chars/misc/pbomb2/hit42.png
	frame	data/chars/misc/pbomb2/hit43.png
	frame	data/chars/misc/pbomb2/hit44.png
	sound	data/sounds/drum2.wav
	frame	data/chars/misc/pbomb2/hit45.png
	frame	data/chars/misc/pbomb2/hit46.png
	frame	data/chars/misc/pbomb2/hit47.png
	frame	data/chars/misc/pbomb2/hit48.png
	frame	data/chars/misc/pbomb2/hit49.png
	frame	data/chars/misc/pbomb2/hit50.png
	frame	data/chars/misc/pbomb2/hit51.png
	frame	data/chars/misc/pbomb2/hit52.png
	frame	data/chars/misc/pbomb2/hit53.png
	frame	data/chars/misc/pbomb2/hit54.png
	frame	data/chars/misc/pbomb2/hit55.png
	frame	data/chars/misc/pbomb2/hit56.png
	frame	data/chars/misc/pbomb2/hit57.png
	frame	data/chars/misc/pbomb2/hit58.png
	frame	data/chars/misc/pbomb2/hit59.png
	frame	data/chars/misc/pbomb2/hit60.png
	frame	data/chars/misc/pbomb2/hit61.png
	frame	data/chars/misc/pbomb2/hit62.png
	frame	data/chars/misc/pbomb2/hit63.png
	frame	data/chars/misc/pbomb2/hit64.png
	frame	data/chars/misc/pbomb2/hit65.png
	frame	data/chars/misc/pbomb2/hit66.png
	frame	data/chars/misc/pbomb2/hit67.png
	frame	data/chars/misc/pbomb2/hit68.png
	frame	data/chars/misc/pbomb2/hit69.png
	frame	data/chars/misc/pbomb2/hit70.png
	frame	data/chars/misc/pbomb2/hit71.png
	frame	data/chars/misc/pbomb2/hit72.png
	frame	data/chars/misc/pbomb2/hit73.png
	frame	data/chars/misc/pbomb2/hit74.png
	spawnframe	data/chars/misc/pbomb2/hit75.png 167
	subentity	barrel

anim	idle
	loop	1
	delay	15
	offset	15 43
	bbox	0 0 0 0
	hitfx	data/sounds/drum.wav
	frame	data/chars/misc/barrel/8.png
	frame	data/chars/misc/barrel/9.png
	delay	4
	attack	0 0 30 38 20 1
	frame	data/chars/misc/barrel/6.png
	frame	data/chars/misc/barrel/6.png
	frame	data/chars/misc/barrel/6.png
	attack	0 0 0 0
	delay	15
	frame	data/chars/misc/barrel/7.png
 
Both Billy5 and Billy11 (one which I created as a copy of Billy5) have the same animations except the name(s). Also they have the same pbomb to throw a barrel, but Billy11 can't pick and throw while Billy5 works.

Huh? why would you want to allow Billy to pick another weapon while holding barrel?

Also what actually you meant by Billy11 can't throw? do you mean he throws nothing or he simply can't throw anything at all?
 
Bloodbane said:
Both Billy5 and Billy11 (one which I created as a copy of Billy5) have the same animations except the name(s). Also they have the same pbomb to throw a barrel, but Billy11 can't pick and throw while Billy5 works.

Huh? why would you want to allow Billy to pick another weapon while holding barrel?

I don't mean he's picking another weapon while holding a barrel. What I mean is the character code, they have the same animation and character header. I declared them for picking it up but standing barrel can't be picked up.

Weapons = Item = Ability to pick up
Billy5 = laid barrel = can be picked up
Billy11 = standing barrel = CAN'T be picked up

Bloodbane said:
Also what actually you meant by Billy11 can't throw? do you mean he throws nothing or he simply can't throw anything at all?

My apology for confusing you on the throwing and picking issue. It's the weapon picking issue, not the throwing issue. I meant when Billy picks up a laid barrel from the ground, then Billy switches to weapon Billy5 for holding a barrel. Yes, Billy can pick up a laid barrel. The standing barrel is supposed to be picked up by him and Billy cannot pick up a standing barrel at all.
 
I didn't think of bbox until I did it a few days ago. Also, for platform, I did adjust it to match the platform size with the height and width, but the problem is the player can't make him jump on top of it unless he gets knocked out after he carries the barrel that was standing before it got picked up.

Also, another problem is that every time I throw a barrel (either if it's standing or lying down) to an enemy to knock him, the lying barrel pops out of nowhere and the thrown barrel bounces and stops where the lying barrel popped out. However, throwing it to the ground instead of throwing it to enemies is fine.

Another problem is when the player picks up the standing barrel and the enemy knocks him out, the barrel is dropped with the standing barrel instead of being dropped to play a lying down animation. When I pick up a standing barrel and the enemy knocks me out, how can I make a barrel drop to lying down instead of going back to standing position?

Click them to see what I mean.







Question: I wonder if it's possible to spawn a gotten item when the player is getting an item. For example, on DD iPhone version, the player picks up the barrel while the barrel animation is playing.

$#1+!!! I've been trying to post this but this (IE) browser keeps emptying my post and forces me to repost from scratch. I'm getting too tired of reposting this many times. >:(
 
That's more than one month old thread you've revived so please excuse me if I'm lost to what was posted earlier  :'(

another problem is that every time I throw a barrel (either if it's standing or lying down) to an enemy to knock him, the lying barrel pops out of nowhere and the thrown barrel bounces and stops where the lying barrel popped out

Uh... did you set something which could spawn lying barrel in thrown barrel text?
If not then I'm lost

Another problem is when the player picks up the standing barrel and the enemy knocks him out, the barrel is dropped with the standing barrel instead of being dropped to play a lying down animation. When I pick up a standing barrel and the enemy knocks me out, how can I make a barrel drop to lying down instead of going back to standing position?

For this one, I solved it by setting weapon's counter to 0 so when the weapon (barrel) is dropped because of getting hit, it will disappear and can't be repicked. And in Billy's PAIN & FALL animation he 'shoots' barrel which can hurt enemies and Billy too. Or I should say that Billy drops the barrel he was holding (DD style)
That's the general idea however. In practice, we need extra work to stabilize this

Question: I wonder if it's possible to spawn a gotten item when the player is getting an item. For example, on DD iPhone version, the player picks up the barrel while the barrel animation is playing.

Huh? oh I thought you meant player picks up barrel while barrel is moving or animating but you actually meant: after picking up an item, an animation is played
You need special script declared with didhitscript in item's text to do this. I need to find an example for this... I'll post it after I find one :)
 
did you set something which could spawn lying barrel in thrown barrel text?

The thrown one is a pbomb. I just found out just now. Pbomb2 is the thrown barrel so here it is. I believe there was a mistake that the subentity and spawnframe were put below the last frame for attack1 and attack2 anims. I didn't see it until now.

name            pbomb2
type            item
counter          3
subtype          weapon
speed            8
gfxshadow        1
weapnum          9999
shootnum        9999
jumpheight      2
nolife          1
subject_to_wall  0
candamage        enemy player
palette          none

anim attack
loop 0
delay 10
offset 15 120
bbox 0 0 0 0
sound data/sounds/drum2.wav
frame data/chars/misc/pbomb2/hit1.png
delay 3
frame data/chars/misc/pbomb2/hit2.png
frame data/chars/misc/pbomb2/hit3.png
frame data/chars/misc/pbomb2/hit4.png
frame data/chars/misc/pbomb2/hit5.png
frame data/chars/misc/pbomb2/hit6.png
frame data/chars/misc/pbomb2/hit7.png
frame data/chars/misc/pbomb2/hit8.png
frame data/chars/misc/pbomb2/hit9.png
frame data/chars/misc/pbomb2/hit10.png
frame data/chars/misc/pbomb2/hit11.png
frame data/chars/misc/pbomb2/hit12.png
frame data/chars/misc/pbomb2/hit13.png
frame data/chars/misc/pbomb2/hit14.png
frame data/chars/misc/pbomb2/hit15.png
frame data/chars/misc/pbomb2/hit16.png
frame data/chars/misc/pbomb2/hit17.png
frame data/chars/misc/pbomb2/hit18.png
frame data/chars/misc/pbomb2/hit19.png
frame data/chars/misc/pbomb2/hit20.png
frame data/chars/misc/pbomb2/hit21.png
frame data/chars/misc/pbomb2/hit22.png
frame data/chars/misc/pbomb2/hit23.png
frame data/chars/misc/pbomb2/hit24.png
frame data/chars/misc/pbomb2/hit25.png
frame data/chars/misc/pbomb2/hit26.png
frame data/chars/misc/pbomb2/hit27.png
frame data/chars/misc/pbomb2/hit28.png
frame data/chars/misc/pbomb2/hit29.png
spawnframe data/chars/misc/pbomb2/hit30.png 68
subentity drum

anim attack2
loop 0
delay 3
offset 15 116
bbox 0 0 0 0
frame data/chars/misc/pbomb2/hit1.png
frame data/chars/misc/pbomb2/hit2.png
frame data/chars/misc/pbomb2/hit3.png
frame data/chars/misc/pbomb2/hit4.png
frame data/chars/misc/pbomb2/hit5.png
frame data/chars/misc/pbomb2/hit6.png
frame data/chars/misc/pbomb2/hit7.png
frame data/chars/misc/pbomb2/hit8.png
frame data/chars/misc/pbomb2/hit9.png
frame data/chars/misc/pbomb2/hit10.png
frame data/chars/misc/pbomb2/hit11.png
frame data/chars/misc/pbomb2/hit12.png
frame data/chars/misc/pbomb2/hit13.png
frame data/chars/misc/pbomb2/hit14.png
frame data/chars/misc/pbomb2/hit15.png
frame data/chars/misc/pbomb2/hit16.png
frame data/chars/misc/pbomb2/hit31.png
frame data/chars/misc/pbomb2/hit32.png
frame data/chars/misc/pbomb2/hit33.png
frame data/chars/misc/pbomb2/hit34.png
frame data/chars/misc/pbomb2/hit35.png
frame data/chars/misc/pbomb2/hit36.png
frame data/chars/misc/pbomb2/hit37.png
frame data/chars/misc/pbomb2/hit38.png
frame data/chars/misc/pbomb2/hit39.png
frame data/chars/misc/pbomb2/hit40.png
frame data/chars/misc/pbomb2/hit41.png
frame data/chars/misc/pbomb2/hit42.png
frame data/chars/misc/pbomb2/hit43.png
frame data/chars/misc/pbomb2/hit44.png
sound data/sounds/drum2.wav
frame data/chars/misc/pbomb2/hit45.png
frame data/chars/misc/pbomb2/hit46.png
frame data/chars/misc/pbomb2/hit47.png
frame data/chars/misc/pbomb2/hit48.png
frame data/chars/misc/pbomb2/hit49.png
frame data/chars/misc/pbomb2/hit50.png
frame data/chars/misc/pbomb2/hit51.png
frame data/chars/misc/pbomb2/hit52.png
frame data/chars/misc/pbomb2/hit53.png
frame data/chars/misc/pbomb2/hit54.png
frame data/chars/misc/pbomb2/hit55.png
frame data/chars/misc/pbomb2/hit56.png
frame data/chars/misc/pbomb2/hit57.png
frame data/chars/misc/pbomb2/hit58.png
frame data/chars/misc/pbomb2/hit59.png
frame data/chars/misc/pbomb2/hit60.png
frame data/chars/misc/pbomb2/hit61.png
frame data/chars/misc/pbomb2/hit62.png
frame data/chars/misc/pbomb2/hit63.png
frame data/chars/misc/pbomb2/hit64.png
frame data/chars/misc/pbomb2/hit65.png
frame data/chars/misc/pbomb2/hit66.png
frame data/chars/misc/pbomb2/hit67.png
frame data/chars/misc/pbomb2/hit68.png
frame data/chars/misc/pbomb2/hit69.png
frame data/chars/misc/pbomb2/hit70.png
frame data/chars/misc/pbomb2/hit71.png
frame data/chars/misc/pbomb2/hit72.png
frame data/chars/misc/pbomb2/hit73.png
frame data/chars/misc/pbomb2/hit74.png
spawnframe data/chars/misc/pbomb2/hit75.png 167
subentity barrel

anim idle
loop 1
delay 15
offset 15 43
bbox 0 0 0 0
hitfx data/sounds/drum.wav
frame data/chars/misc/barrel/8.png
frame data/chars/misc/barrel/9.png
delay 4
attack 0 0 30 38 20 1
frame data/chars/misc/barrel/6.png
frame data/chars/misc/barrel/6.png
frame data/chars/misc/barrel/6.png
attack 0 0 0 0
delay 15
frame data/chars/misc/barrel/7.png

What's weird is that spawnframe with the path does not crash.

EDIT:
This is the frames and the offset for the pbomb2 (barrel):
11_23_14_2_07_06_PM.png
 
Back
Top Bottom