meelee pawn script
-
- Posts: 2
- Joined: Mon Jan 16, 2012 11:06 pm
meelee pawn script
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?
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: meelee pawn script
There is a sample script genericmelee.s in the scripts/sample folder that should get you started.
-
- Posts: 2
- Joined: Mon Jan 16, 2012 11:06 pm
Re: meelee pawn script
I used that, but now they are invincible. How do you fix this?
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: melee pawn script
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
to
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.
In the genericmelee script this means changing
Code: Select all
HEALTHATTRIBUTE [health] // name of health attribute
Code: Select all
HEALTHATTRIBUTE [enemy_health] // name of health attribute