SOLVED Enemy doesn't attack on 4.0 alpha

Toranks

Active member
There is an enemy that behaves correctly in his behavior of following me all the time, but never attacks me. That did not happen on Openbor 4XXX or 6XXX, but yes on 4.0 alpha.

I will report it on GitHub if it is not a known error or any change in the entity parameters. Maybe range/rangea/rangez?

Code:
name		steel
type		enemy
subtype		chase
speedf		1.1
facing		1
nomove		0 1
health		100
mp		100
jumpheight	0
nopain		1
nolife		1
falldie		1
nodieblink	3
makeinv		3
shadow		6
nodrop		1
antigrab	10
subject_to_platform 0
subject_to_wall	    0
hostile				player
candamage			player enemy
animationscript data/scripts/escript.c

palette		data/chars/3jackballs/allpal2.gif

load	grdbrk






anim	attack
	loop	0
	delay	9
	offset	175 540
	bbox	0 0 0 0
	range	-90 90
	rangea	-150
	rangez	-15 15
	quakeframe	9 3 15
	@cmd	leaper 0 3 0
	frame	data/chars/3jackballs/steelatk01.gif
	sound	data/sounds/punch3.wav
	attack5	90 440 190 80 30 1 0 0 40 20
	dropv	4 3
	frame	data/chars/3jackballs/steelatk02.gif
	frame	data/chars/3jackballs/steelatk03.gif
	delay	15
	frame	data/chars/3jackballs/steelatk04.gif
	frame	data/chars/3jackballs/steelatk05.gif
	delay	9
	frame	data/chars/3jackballs/steelatk06.gif
	frame	data/chars/3jackballs/steelatk07.gif
	frame	data/chars/3jackballs/steelatk08.gif
	sound	data/sounds/steel2.wav
	frame	data/chars/3jackballs/steelatk09.gif
	@cmd	spawn01 "grdbrk" 0 0 5
	frame	data/chars/3jackballs/steelatk10.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk09.gif
	attack5	0 0 0 0
	frame	data/chars/3jackballs/steelatk10.gif
	delay	100
	frame	data/chars/3jackballs/steelatk08.gif
	delay	5
	movea	5
	frame	data/chars/3jackballs/steelatk08.gif
	sound	data/sounds/steel3.wav
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	sound	data/sounds/mhmh.wav
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	movea	0
	seta	130
	frame	data/chars/3jackballs/steelatk08.gif
	@cmd	beidle
	frame	data/chars/3jackballs/steelatk08.gif
		
anim	death
	loop	0
	delay	10
	offset	175 540
	bbox	0 0 0 0
	quakeframe	5 3 9
	@cmd	leaper 0 4 -1
	frame	data/chars/3jackballs/steelatk01.gif
	frame	data/chars/3jackballs/steelatk02.gif
	frame	data/chars/3jackballs/steelatk03.gif
	frame	data/chars/3jackballs/steelatk04.gif
	delay	60
	frame	data/chars/3jackballs/steeldeath.gif
	delay	7
	frame	data/chars/3jackballs/steeldeath.gif
	@cmd	spawn01 "dust" -100 0 5
	frame	data/chars/3jackballs/steeldeath.gif
	@cmd	spawn01 "dust" -70 0 5
	frame	data/chars/3jackballs/steeldeath.gif
	@cmd	spawn01 "dust" -40 0 5
	frame	data/chars/3jackballs/steeldeath.gif
	@cmd	spawn01 "dust" 0 0 5
	frame	data/chars/3jackballs/steeldeath.gif
	@cmd	spawn01 "dust" 100 0 5
	frame	data/chars/3jackballs/steeldeath.gif
	@cmd	spawn01 "dust" 70 0 5
	frame	data/chars/3jackballs/steeldeath.gif
	@cmd	spawn01 "dust" 40 0 5
	frame	data/chars/3jackballs/steeldeath.gif
	delay	500
	frame	data/chars/3jackballs/steeldeath.gif

		
anim	idle
	loop	1
	delay	9
	offset	175 540
	bbox	0 0 0 0
	seta	130
	frame	data/chars/3jackballs/steel1.gif
	@cmd	clearL
	frame	data/chars/3jackballs/steel2.gif
	frame	data/chars/3jackballs/steel3.gif
	frame	data/chars/3jackballs/steel4.gif
	frame	data/chars/3jackballs/steel5.gif
	frame	data/chars/3jackballs/steel6.gif
	sound	data/sounds/steel.wav
	frame	data/chars/3jackballs/steel7.gif
	frame	data/chars/3jackballs/steel8.gif
	frame	data/chars/3jackballs/steel9.gif
	frame	data/chars/3jackballs/steel10.gif
	frame	data/chars/3jackballs/steel11.gif
	frame	data/chars/3jackballs/steel12.gif
	frame	data/chars/3jackballs/steel13.gif
	frame	data/chars/3jackballs/steel14.gif
	sound	data/sounds/steel.wav
	frame	data/chars/3jackballs/steel15.gif
		
anim	pain
		
anim	spawn
	loop	0
	delay	5
	offset	175 540
	bbox	0 0 0 0
	seta	90
	frame	data/chars/3jackballs/steelatk08.gif
	move	-6
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	move	-3
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif

	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif

	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	move	0
	delay	70
	frame	data/chars/3jackballs/steelatk08.gif
	delay	5
	seta	95
	frame	data/chars/3jackballs/steelatk08.gif
	sound	data/sounds/steel3.wav
	seta	100
	frame	data/chars/3jackballs/steelatk08.gif
	seta	105
	frame	data/chars/3jackballs/steelatk08.gif
	seta	110
	frame	data/chars/3jackballs/steelatk08.gif
	seta	115
	frame	data/chars/3jackballs/steelatk08.gif
	seta	120
	frame	data/chars/3jackballs/steelatk08.gif
	seta	125
	frame	data/chars/3jackballs/steelatk08.gif
	seta	130
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	@cmd	beidle
	frame	data/chars/3jackballs/steelatk08.gif


		
#|edited by openBor Stats v 0.53
 
Not sure but i think that the "rangea -150" might be the problem. More specific, it actually should have be a problem on previous OpenBOR versions too with this setting. This because you only did set one value instead of too and the engine can't tell  if it supposed to be the "min" value or the "max".
So just try with "rangea -150  0" since this is an airial enemy if i'm getting this correctly.
 
You have an improper vertical range setting, and it shouldn't work on any OpenBOR.

Edit: ninja'd by magggas!

DC
 
One more thing about it, keep in mind that both "min" and "max" values can be negative like "rangea  -150  -80", so this is why the engine can't tell them apart if you only add one of them like in your case.
 
Unfortunately it still doesn't work  :-\. Nor with -150 0 or -150 -80. In 4XXX and 6XXX as I said, it does work with a single parameter in rangea...
 
I have tried multiple combinations and I have verified that removing rangea completely, leaving only range -100 100 and rangez -15 15, it continues to work in 4XXX and 6XXX but not in 4.0.

So the problem cannot be rangea...
 
well seting range can be a bit tricky some times, for example range  -100 100 would extend the range box from the center offset to the back of your enemy, never done that so cant tell if would mess ai behavior in some way, i see you set nomove so it doesnt turn around, are you spawning it infront of you? are you spawning on level as a static enemy? have in mind that antigravity 100 prevent enemies from doing anything otter than been idle i think, though not sure about the 10 value you set, perhaps you allready know about but just in case old openborstats build is the best  way to set range/bbox/attack boxes and offset, try it out if havent, also what kind of enemy are you tring to create? more info about how you want it to behave would be useful.
 
It's not "antigravity", it's "antigrab", hehehe, is to prevent to be grabbed.
A video is the best way to show it. Both videos are been recorded without rangea parameter, only range and rangez

Incorrect behavior on 4.0 alpha:

Correct behavior on 4XXX and 6XXX:
 
my mistake ;p, your game looks quite nice man, if indeed is a bug i dont think i can be of any help, try enabling range box display on debuging seting to see if there is a diferent behavior on the 4.0 build.
 
Maybe you are right.
First image Openbor 6XXX
Second image Openbor 4.0alpha

In the second image you can't even see the attack range of the demolition balls

Both, again, with range -100 100 and rangez -15 15 (I deleted rangea)

PD: It's not my game, I'm only updating this with the original author permission. Now you can download it from my YouTube channel, it works perfectly with 4XXX and probably also 6XXX
 

Attachments

  • aof - 0000.png
    aof - 0000.png
    151 KB · Views: 5
  • aof - 0001.png
    aof - 0001.png
    160.1 KB · Views: 5
testing 4.0 now, geting similar behaviors.


imagedata.php


the monk standing on the post use to fire a projectile, now with 4.0 it doesnt until you stand on the same altitude/Y seem like default range behavior changed about altitude, it doesnt fire ither if your airbone/jump, just when you stand on the ground/same altitude, the monk doesnt have rangeA, maybe is required now and intended beahvior, will test futher later on.
 
hey nsw25, read your post at gitup, this in particular you described below hapens in older build too, thought was normal.

enemy AI has been affected. they now instantly walk away from a player as soon as there is no bbox in a frame of animation
 
enemy AI has been affected. they now instantly walk away from a player as soon as there is no bbox in a frame of animation

Gurtag
Hm.. no, this is not true.  What he is describing is only happening because he is using the stealth command. Make an entity stealth is not the same as adding an bbox 0 on some animations. With just bbox 0 the enemy AI will keep follow you but not attack, but with stealth, for enemy AI is like the player does not exist at all. So stealth should be used with caution and really know what you are doing in order to avoid such stuff.

I do use both stealth and bbox 0 on my mod and they all work as intended on all OpenBOR versions. By the way, i can also confirm that there is no any problem with all the rage commands or the AI on the OpenBOR 4.0 alpha. Now on Toranks case i'm pretty sure that the problem must be something other than the AI or the range commands. A good place to look i would say is the fact that the entity is in the air, does not have a walk aninm and is  actually moving via script. So, somewhere in there must be the problem.

 
Gurtag said:
testing 4.0 now, geting similar behaviors.


imagedata.php


the monk standing on the post use to fire a projectile, now with 4.0 it doesnt until you stand on the same altitude/Y seem like default range behavior changed about altitude, it doesnt fire ither if your airbone/jump, just when you stand on the ground/same altitude, the monk doesnt have rangeA, maybe is required now and intended beahvior, will test futher later on.

Most of the stuff in this thread is author error - but this one is legit. I am experimenting with different range defaults. The old vertical Range default (-1000 to 1000) is ridiculous and wasteful, so I'm working to find something more reasonable. I guess the one I used is a bit too tight. Or is it... do you really want the guys on that pole to stupidly throw fireballs over your head by default?

I should point out too, that there is not and will never be a perfect default range behavior, because there is simply no way to know what a good set of ranges is for every move. The defaults are designed around standard BOR clone modules for backward compatibility. You need to experiment and adjust ranges for special moves and situations, like guy on the pole. That's why we provide range adjustments.

Also, don't forget don't forget there's a range for Base too (rangeb). It's the same as vertical range and has the same default values, but compares your Base position rather than current altitude. Gurtag I'm guessing that's your problem, and why he won't attack even when you jump. His base is whatever the platform height of that pole is. Yours is 0. Jumping does not change your base position until you land on something with a different base than you started with. So even though you jump into his vertical range, you are probably still outside of his base range. Try widening the rangeb some and I bet he'll start attacking as you jump.

Anyway, do keep in mind everything in Alpha is subject to change. That's the whole point. I'll be monitoring and making adjustments up until the official release.

DC

 
do you really want the guys on that pole to stupidly throw fireballs over your head by default?

well yes actually, i know it looks kind of silly but does added a bit of difulty to jump on there, anyway glad to know you adjusted that, so i can now fix the monk and it really a minor thing, btw i think it is way better now as enemies on lower platforms dont fight with the wind anymore ;p
 
Toranks said:
Damon Caskey said:
Most of the stuff in this thread is author error

So why isn't it working in my case? I have included a rangea -1000 1000 and still not attacking me

was adjusting min ago, it seems you need both rangea -1000 1000 and rangeb -1000 1000 to work as before.
 
It's true you don't want to forget Base. But you don't need outlandish values like that, it increases CPU. Try something more reasonable like -50 100.

DC
 
Gurtag said:
hey nsw25, read your post at gitup, this in particular you described below hapens in older build too, thought was normal.

enemy AI has been affected. they now instantly walk away from a player as soon as there is no bbox in a frame of animation

This is not a bug and, as far as I remember, had worked that way since I started with OpenBOR at least (2013).
If there is no bbox, the enemy won't try to attack you. If the enemy uses a CHASE ai, he will still be close to you and then stops. If its not a chase type ai, the enemy will walk away.

And its one of the cleaver things about OpenBOR that I like.
 
Back
Top Bottom