Page 1 of 1
meelee pawn script
Posted: Mon Jan 16, 2012 11:25 pm
by NumberThree
I want to make a game with zombies, so I need a script that uses a meelee attack instead of firing a projectile. Can anyone tell me how to do this?
Re: meelee pawn script
Posted: Wed Jan 25, 2012 11:45 am
by QuestOfDreams
There is a sample script genericmelee.s in the scripts/sample folder that should get you started.
Re: meelee pawn script
Posted: Thu Feb 02, 2012 5:44 am
by NumberThree
I used that, but now they are invincible. How do you fix this?
Re: melee pawn script
Posted: Wed Feb 08, 2012 2:03 pm
by QuestOfDreams
You probably have to change the health attribute of the pawn from
health to
enemy_health. The latter is the attribute that the player's weapons will affect (as defined in the weapon.ini file).
In the genericmelee script this means changing
Code: Select all
HEALTHATTRIBUTE [health] // name of health attribute
to
Code: Select all
HEALTHATTRIBUTE [enemy_health] // name of health attribute
As the player's health attribute is
health, using a different attribute name for enemies is reasonable if you want to avoid that the player gets hurt by his own weapons. Alternatively you may change the weapon definitions to affect the attribute
health.