Change health spawn enemy with weapon

dantedevil

Well-known member
I just realized that when you spawn an enemy with a weapon, the system not take into account the health that you put and always leave the one you have in the header of their txt.

Here enemy header txt:
Code:
name	SLICER
health	60
speed	10
type	enemy
risetime -200 -200 
gfxshadow  1
aggression -30
falldie 2
projectilehit   enemy obstacle
hmap 1 5
fmap 2
noquake 1

aimove Avoidz

weapons  none SLICER2 SLICER 

icon	data/chars/gang1/slicer/icon.png 1
animationscript data/scripts/escript.h 

palette data/chars/gang1/slicer/idle0.png
alternatepal data/chars/gang1/slicer/map.png
alternatepal data/chars/gang1/slicer/map2.png 
alternatepal data/chars/gang1/slicer/map3.png 
alternatepal data/chars/gang1/slicer/map4.png 
alternatepal data/chars/gang1/slicer/map5.png 
alternatepal data/chars/gang1/slicer/map6.png 
alternatepal data/chars/gang1/slicer/map7.png

Here enemy weapon header txt:
Code:
name	SLICER2
health	60
speed	10
type	none
risetime -200 -200 
gfxshadow  1
aggression -30
dust		dust
hmap 1 5
fmap 2
aimove avoid

load knife2

typeshot      0
weaploss      0 
modelflag     1

icon	data/chars/gang1/slicer/icon.png 1

animationscript data/scripts/escript.h 

palette data/chars/gang1/slicer/idle0.png
alternatepal data/chars/gang1/slicer/map.png
alternatepal data/chars/gang1/slicer/map2.png 
alternatepal data/chars/gang1/slicer/map3.png 
alternatepal data/chars/gang1/slicer/map4.png 
alternatepal data/chars/gang1/slicer/map5.png 
alternatepal data/chars/gang1/slicer/map6.png 
alternatepal data/chars/gang1/slicer/map7.png

In their Slicer txt have health  60, and always spawn with this health, when spawn the weapon.
Is this true or is it a bug?
And if so, is there a way to allocate more health?

Here in the example I put health 200, but always spawn with 60 health, as it is designated in the header txt. It would be important to find the solution to be able to manually designate the energy for 1p, 2p or 3p, as we normally do.

Code:
spawn  slicer
health   200
2phealth 230
3phealth 260
weapon knife
coords  362 242 0
at      0


I try this script by O Ilusionista (http://www.chronocrash.com/forum/index.php?topic=3980.msg55051#msg55051)
, but not work:
Code:
spawn  slicer
@script void main() {
void self = getlocalvar("self"); // get caller
int iLife = 300;
changeentityproperty(self, "maxhealth",iLife );
changeentityproperty(self, "health",iLife );
} @end_script
weapon knife 0
coords  362 242 0
at      0
 
I'm thinking on how to solve this problem
nokill is declared in attacker's text so it would be complex to include the attacker in the solution UNLESS attackboxes using nokill use specific type

If they were, I could check the type and apply the nokill effect in takedamagescript
 
It seems that this has complicated my friend.

In the worst case scenario, if we do not find a viable solution, I will remove the takedamage script and assign a unique higher energy to the enemies that use weapons. I do not see another solution, unless you can do it.
 
Okay, let me ask these:
- Is it possible to use certain attacktype for attacks with nokill?
- If not, is it possible to use certain attacktype for attacks without nokill?
 
Bloodbane said:
Okay, let me ask these:
- Is it possible to use certain attacktype for attacks with nokill?
- If not, is it possible to use certain attacktype for attacks without nokill?

- Is it possible to use certain attacktype for attacks with nokill?
No.

Code:
- If not, is it possible to use certain attacktype for attacks without nokill?
As far as I know, I never saw anything about it
 
You know, I was going to suggest you to use certain attacktype for attackboxes with nokill 1 . However I realized that effort might not be better than doing your worst case scenario

Sorry, that's what I can think of ATM  :-[
 
Bloodbane said:
You know, I was going to suggest you to use certain attacktype for attackboxes with nokill 1 . However I realized that effort might not be better than doing your worst case scenario

Sorry, that's what I can think of ATM  :-[

Do not worry dear friend, you have done everything possible, but sometimes there are problems that escape us. Thank you very much for all the time you have spent helping me one more time.
 
Back
Top Bottom