Barrel cant fall into holes

oldyz

Well-known member
this barrel entity appears right after the throw :
Code:
name brlknf2
type enemy
health 1
speed 10
noatflash 1
flash bflash
noquake 1
bounce 1
nolife 1
jumpheight 2
load dust
remove 0
candamage enemy obstacle npc
subject_to_gravity 1
anim spawn
	offset  47 60
	bbox 29 0 45 61
	delay 10
	jumpframe 0 2 1 0
	landframe 8
	hitflash flashb
	sound data/sounds/drum.wav
	attack3 29 0 45 61 40 1 1 0 0 20
	otg 1
	dropv 3 2
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
	delay 1
	throwframe 0 -1
	custknife dust
	frame data/chars/chris/chrbrl/a3
anim idle
	loop 1
	offset  47 60
	bbox 29 0 45 61
	delay 10
	hitflash flashb
	sound data/sounds/drum.wav
	attack3 29 0 45 61 40 1 1 0 0 20
	otg 1
	dropv 3 2
	throwframe 0 -1
	custknife dust
	quakeframe 0 4 1
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
anim fall
	delay 30
	offset  47 60
	bbox 0 0 0 0
	sound data/sounds/drum.wav
	frame data/chars/chris/chrbrl/a7

it wont fall to holes, it just keeps rolling
 
try this

Code:
name brlknf2
type enemy
subtype biker
health 1
speed 10
noatflash 1
flash bflash
noquake 1
bounce 1
nolife 1
jumpheight 2
load dust
remove 0
candamage enemy obstacle npc player
subject_to_gravity 1


anim spawn
	offset  47 60
	bbox 29 0 45 61
	delay 10
	jumpframe 0 2 1 0
	landframe 8
	hitflash flashb
	sound data/sounds/drum.wav
	attack3 29 0 45 61 40 1 1 0 0 20
	otg 1
	dropv 3 2
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
	delay 1
	throwframe 0 -1
	custknife dust
	frame data/chars/chris/chrbrl/a3
	

	
anim idle
	@script
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int z = getentityproperty(self, "z");
    int y = getentityproperty(self, "a");
    int Dir = getentityproperty(self, "direction");
	int sped = getentityproperty(self, "speed");
    int b = getentityproperty(self, "base");
if(Dir==0){
  changeentityproperty(self, "velocity", -1.5, 0, 0);
    }
if(Dir==1){
  changeentityproperty(self, "velocity", 1.5, 0, 0);
    }
	if(y > b){
	  changeentityproperty(self, "aiflag", "jumping", 1);
	  changeentityproperty(self, "aiflag", "idling", 0);
      changeentityproperty(self, "takeaction", "common_jump");
      changeentityproperty(self, "animation", openborconstant("ANI_walkoff"));
    }
@end_script
	loop 1
	offset  47 60
	bbox 29 0 45 61
	delay 10
	hitflash flashb
	sound data/sounds/drum.wav
	attack3 29 0 45 61 40 1 1 0 0 20
	otg 1
	dropv 3 2
	throwframe 0 -1
	custknife dust
	quakeframe 0 4 1
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6	

anim fall
	delay 30
	offset  47 60
	bbox 0 0 0 0
	sound data/sounds/drum.wav
	frame data/chars/chris/chrbrl/a7


anim walkoff
	loop 1
	offset  47 60
	bbox 29 0 45 61
	delay 10
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
 
danno

it does not work , it seems that the method in which the entity is spawned is what gives it the weird behavior.
this is the entity that generates it after it hits the ground:
Code:
name brlknf
type pshot
health 1
speed 13
noatflash 1
flash bflash
noquake 1
bounce 1
nolife 1
jumpheight 1
load brlknf2
load brlknf3
remove 0
candamage enemy obstacle npc
anim idle 
	loop 1
	offset  47 60
	bbox 0 0 0 0
	delay 10
	hitflash flashb
	attack5 14 13 71 48 40 1 1 0 0 20
	otg 1
	dropv 3 2
	frame data/chars/chris/chrbrl/a1 
	frame data/chars/chris/chrbrl/a2
	frame data/chars/chris/chrbrl/a3
	attack2 29 0 45 61 40 1 1 0 0 20
	otg 1
	dropv 3 2
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
anim attack2
	offset  47 60
	bbox 0 0 0 0
	delay 1
	tossframe 0 1
	custbomb brlknf3
	hitflash flashb
	frame data/chars/misc/empty
anim attack1
	offset  47 60
	bbox 0 0 0 0
	delay 1
	throwframe 0 -1
	custknife brlknf2
	hitflash flashb
	quakeframe 0 1 -2
	frame data/chars/misc/empty
 
danno , pick up the one in the ground & throw it, it will roll but not fall,

i cant focus anymore - but i think that instead of "custknife brlknf2"

the "rolling " model will have to be a summon or spawned instead - because the custknife brlknf2 is the thing that may be affecting it
its weird because i read in the manual that you can make "knives" that can fall into holes, but in this case something is off

if i replace "idle" with walk the thing gets stuck in the edge with the original file.


 
https://www.youtube.com/watch?v=U49tPpA07Cs

yes, spawn it

Code:
name brlknf
type pshot
health 1
speed 13
noatflash 1
flash bflash
noquake 1
bounce 1
nolife 1
jumpheight 1
remove 0
candamage enemy obstacle npc

animationscript data/scripts/player.c

anim idle 
	loop 1
	offset  47 60
	bbox 0 0 0 0
	delay 10
	hitflash flashb
	attack5 14 13 71 48 40 1 1 0 0 20
	otg 1
	dropv 3 2
	frame data/chars/chris/chrbrl/a1 
	frame data/chars/chris/chrbrl/a2
	frame data/chars/chris/chrbrl/a3
	attack2 29 0 45 61 40 1 1 0 0 20
	otg 1
	dropv 3 2
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
	frame data/chars/chris/chrbrl/a3
	frame data/chars/chris/chrbrl/a4
	frame data/chars/chris/chrbrl/a5
	frame data/chars/chris/chrbrl/a6
	
anim attack2
	offset  47 60
	bbox 0 0 0 0
	delay 1
	hitflash flashb
	@cmd spawner "brlknf3" 0 0 0 0
	frame data/chars/misc/empty
	
anim attack1
	offset  47 60
	bbox 0 0 0 0
	delay 1
	hitflash flashb
	quakeframe 0 1 -2
	@cmd spawner "brlknf2" 0 0 0 0
	frame data/chars/misc/empty
 
danno
problem with "biker", in other levels the barrels roll form one side of the screen to the other,  & spawning the entity also had some weird effects.
I changed it to subtype arrow, but there is weird effects, i will write the pros & cons of the methods:

when you use "throwframe" & "custknife brlknf2" these things happen:
Pros
object "rolls" and makes noise all the time
object  hits walls, obstacles or platforms & it displays a "crumpled" barrel animation
Cons
the blasted entity will not fall into a hole

when you use @cmd spawner "brlknf2"
Pros
Object can fall into a hole
Cons
if its a biker, it will go around the level back & forth
after it hits its first enemy, the barrel stops making noise
if it hits a wall it disappears
if it encounters a platform or obstacle it just goes trough it

i came up with a model change method here are the text files:

  Launch phase

name brlknf
type enemy
subtype arrow
health 1
speed 13
noatflash 1
flash bflash
noquake 1
bounce 1
nolife 1
jumpheight 1
load brlknf2
load brlknf3
remove 0
candamage enemy obstacle npc
weapons brlknf2 brlknf
weaploss 3
modelflag 3

no_adjust_base 0
subject_to_basemap 1
subject_to_wall 1
subject_to_hole 1
subject_to_gravity 1
subject_to_platform 1
subject_to_obstacle 1 #1 effects


anim idle
loop 1
offset  47 60
bbox 29 0 45 61
delay 10
hitflash flashb
attack5 14 13 71 48 40 1 1 0 0 20
otg 1
dropv 3 2
frame data/chars/chris/chrbrl/a1
frame data/chars/chris/chrbrl/a2
frame data/chars/chris/chrbrl/a3
attack2 29 0 45 61 40 1 1 0 0 20
otg 1
dropv 3 2
frame data/chars/chris/chrbrl/a4
frame data/chars/chris/chrbrl/a5
frame data/chars/chris/chrbrl/a6
frame data/chars/chris/chrbrl/a3
frame data/chars/chris/chrbrl/a4
frame data/chars/chris/chrbrl/a5
frame data/chars/chris/chrbrl/a6

anim HITWALL
delay 30
offset  47 60
bbox 0 0 0 0
sound data/sounds/drum.wav
frame data/chars/chris/chrbrl/a7

anim attack2
offset  47 60
bbox 29 0 45 61
delay 1
tossframe 0 1
custbomb brlknf3
hitflash flashb
frame data/chars/misc/empty
anim attack1
@script
void self = getlocalvar("self");
if(frame == 0){
changeentityproperty(self, "model", "brlknf2", 0);
}
@end_script
offset  47 60
bbox 29 0 45 61
delay 1
#throwframe 0 1
#custknife brlknf2
hitflash flashb
quakeframe 0 1 -2
frame data/chars/misc/empty


  Rolling phase

name brlknf2
type enemy
#subtype biker
subtype arrow
health 1
speed 10
noatflash 1
flash bflash
noquake 1
bounce 1
nolife 1
jumpheight 2
load dust
remove 0
candamage enemy obstacle npc player
weapons  brlknf brlknf2
weaploss 3

no_adjust_base 0
subject_to_basemap 1
subject_to_wall 1
subject_to_hole 1
subject_to_gravity 1
subject_to_platform 1
subject_to_obstacle 1 #1 effects




anim idle
@script
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int z = getentityproperty(self, "z");
    int y = getentityproperty(self, "a");
    int Dir = getentityproperty(self, "direction");
int sped = getentityproperty(self, "speed");
    int b = getentityproperty(self, "base");
if(Dir==0){
  changeentityproperty(self, "velocity", -1.5, 0, 0);
    }
if(Dir==1){
  changeentityproperty(self, "velocity", 1.5, 0, 0);
    }
if(y > b){
  changeentityproperty(self, "aiflag", "jumping", 1);
  changeentityproperty(self, "aiflag", "idling", 0);
      changeentityproperty(self, "takeaction", "common_jump");
      changeentityproperty(self, "animation", openborconstant("ANI_walkoff"));
    }
@end_script
loop 1
offset  47 60
bbox 29 0 45 61
delay 10
hitflash flashb
sound data/sounds/drum.wav
attack3 29 0 45 61 40 1 1 0 0 20
otg 1
dropv 3 2
throwframe 0 -1
custknife dust
quakeframe 0 4 1
frame data/chars/chris/chrbrl/a3
frame data/chars/chris/chrbrl/a4
frame data/chars/chris/chrbrl/a5
frame data/chars/chris/chrbrl/a6

anim fall
delay 30
offset  47 60
bbox 0 0 0 0
sound data/sounds/drum.wav
frame data/chars/chris/chrbrl/a7


anim walkoff
loop 1
offset  47 60
bbox 29 0 45 61
delay 10
frame data/chars/chris/chrbrl/a3
frame data/chars/chris/chrbrl/a4
frame data/chars/chris/chrbrl/a5
frame data/chars/chris/chrbrl/a6


the pros
it makes the constant noise
it falls off the stage
it hits walls & crumples
it hits obstacles & platforms & crumples
cons
the wall hit crumple is hit & miss
i experienced a couple of engine freezes while testing - on the hole stage when it falls at some locations.

to test the "crumples" you have to use this level:
z 126 240 180
file data/levels/lv7aX.txt

it features the plane platform/obstacle.

the only detail left now is to fix how the "launch" entity & the "roll" entity react to walls
as you can see i tried with "anim hitwall" but it does not seem to work for the launch entity
(try picking up the barrel & throw it near a wall)

now that i think about it, the barrel may be teleporting to the top of the wall....
 
Back
Top Bottom