Enemy + weapon

Enemy (model1) can grab weapon. He become another model (model2)- it is ok.
He is attacking and dying as usual. Droping weapon on death.

But next spawned same enemies (model1) trying attack using animations from model2 but they are not took any weapons.
Why that?
 
You might be using the wrong modelflag, which modelflag are you using?

modelflag {int}

Determines how weapon model copies animation and weaponlist from original model.
0 = Animation and weaponlist are copied
1 = Animation aren't copied but weaponlist are still copied
3 = Animation and weaponlost aren't copied
Use this with weapon models of course.
 
When enemy with weapon  (model2) dying - all around similar enemies without weapon (model1) [spawned or not] imideatly trying to use attacks from model2!
Enemies trying to shot (like they have weapon)- but anly animation plays without projectiles.

Removing weapons from level - do nothing. Enemy must grab weapon from ground.

When modelflag sets to 1 or 3 bug is not shown! But enemies stops moving right after grabbing weapon and  doing something only after pain.

Enemie's weaploss sets to 2 - drop weapon on death. But weaploss 3 is stoping the bug. But i want that enemies drops their weapons on death.
 
After >Lose weapon> enemy still using animations  Atak4 and Atak5. And all around same enemies trying this. And all same enemies that will be spawned then will try to use Atak4 and Atak5. I dont wnow how it works inside - but its looking like prototype-entity of enemy changed after >Lose weapon>.

modelflag 0

Model1
Idle
Walk
Run
Atak1
Atak2
Atak3
---
---



> Take weapon>
Model2
Idle
Walk
Run
Atak1
Atak2
Atak3
Atak4
Atak5




> Lose weapon>

Model1
Idle
Walk
Run
Atak1
Atak2
Atak3

Atak4
Atak5



There all is ok:
modelflag 1

Model1
Idle
Walk
Run
Atak1
Atak2
Atak3
---
---



> Take weapon>
Model2
Idle
Walk
Run
Atak1
Atak2
Atak3
Atak4
Atak5




> Lose weapon>

Model1
Idle
Walk
Run
Atak1
Atak2
Atak3
---
---

If set modelflag 1 in model2 - enemy will stop moving after grabing weapon.
 
Ah right, I should've suggested modelflag 1 instead of 0. Sorry about that  :-[

If you don't want model1 to copy model2's weapon list and scripts, you can set modelflag 7.
 
Try adding attack 4 and 5 to model 1 as blank animations just the title like

anim attack4

anim attack5

It would really help if you post both the enemy and weapon files here.
 
Ok after looking over the files I suggest to remove "fr_sold_puncher" from his own weapon list see if that helps if not remove the animation script and any @cmd lines to see if the script is causing the problem you need to try to narrow down the possible causes of the odd behaviour.

fr_sold_shotgun.txt
Code:
name	fr_sold_shotgun
health	50
speed 18
type	none
aimove chase
aimove wander
aimove normal
aiattack dodgemove
shadow	3
noquake 1
score	0  -1
falldie 1
nodieblink 3
throwdamage	20
paingrab 1
grabdistance 24
nolife 1
running  42 4 2 1 0
gfxshadow 1
jumpheight 5.4
jumpspeed 13

hostile player 
candamage player npc obstacle
projectilehit   enemy obstacle npc

animationscript data/scripts/player.c
dust dust
height  1000
aggression -10
weaploss 1

palette data/chars/new/fr_sold_puncher/pallet.png
alternatepal data/chars/new/fr_sold_puncher/pallet2.png

fr_sold_puncher.txt
Code:
name	fr_sold_puncher
health	50
speed 18
type	enemy
aimove chase
aimove wander
aimove normal
aiattack dodgemove
shadow	3
noquake 1
score	0  -1
falldie 1
nodieblink 3
throwdamage	20
paingrab 1
grabdistance 24
nolife 1
running  42 4 2 1 0
gfxshadow 1
jumpheight 5.4
jumpspeed 13

hostile player 
candamage player npc obstacle
projectilehit   enemy obstacle npc

animationscript data/scripts/player.c
dust dust
height  1000
aggression -10


palette data/chars/new/fr_sold_puncher/pallet.png
alternatepal data/chars/new/fr_sold_puncher/pallet2.png
 modelflag 1
weapons none fr_sold_shotgun none none none none none none none none fr_sold_puncher

c_shotgun.txt
Code:
name	c_shotgun
type	item
subtype weapon
weapnum	2
counter	10
typeshot 0
shootnum 1
subject_to_screen 0


anim	fall
	delay	250
	bbox	28 17 89 19
	offset	73 35
	frame	data/chars/new/weapon/shotgun.png
		
anim	idle
	loop	1
	delay	10
	bbox	28 17 89 19
	offset	73 35
	frame	data/chars/new/weapon/shotgun.png
		
anim	spawn
	delay	30
		
		
	movez	-1
	bbox	28 17 89 19
	offset	73 35
	frame	data/chars/new/weapon/shotgun.png
		
#|edited by openBor Stats v 0.67
 
Back
Top Bottom