meelee pawn script

Topics regarding Scripting with Reality Factory
Post Reply
NumberThree
Posts: 2
Joined: Mon Jan 16, 2012 11:06 pm

meelee pawn script

Post by NumberThree » Mon Jan 16, 2012 11:25 pm

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?

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: meelee pawn script

Post by QuestOfDreams » Wed Jan 25, 2012 11:45 am

There is a sample script genericmelee.s in the scripts/sample folder that should get you started.

NumberThree
Posts: 2
Joined: Mon Jan 16, 2012 11:06 pm

Re: meelee pawn script

Post by NumberThree » Thu Feb 02, 2012 5:44 am

I used that, but now they are invincible. How do you fix this?

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: melee pawn script

Post by QuestOfDreams » Wed Feb 08, 2012 2:03 pm

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.

Post Reply