pawn death

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

pawn death

Post by creekmonkey »

Hello!
I am new to RF and its scripting language. What scripting knowledge I have is in flash and actionscripting. I have created an enemey pawn and am using the genericmelee script. Problem is the only weapon that will kill my pawn is the gernade launcher. No other weapons seem to affect the pawn. Is there some place that I must define what weapons will damage the pawn?
User avatar
QuestOfDreams
Site Admin
Posts: 1525
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams »

In this script the pawn uses health as its health attribute. The attribute that is damaged by a weapon is set in the weapon.ini file (located in the install folder). Most of the weapons have this attribute set to enemy_health (since the player's health attribute is also health he could damage himself otherwise). Either change health to enemy_health in the pawn script or the attribute in the weapon.ini file from enemy_health to health.
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Post by creekmonkey »

Thanks QOD!
That did the trick!
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Post by creekmonkey »

Well I thought it did the trick.
Ater I changed the attribute from health to enemy_health I am able to kill the pawn. But the pawn can not kill me?
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Post by bernie »

Maybe you changed the damage attribute too see below how it should be.
{
//Script for Ben

// Perfect AI
// by Peter Coleman
// Modified by Bernard Parkin 2006
// monster will melee if close enough
// Changes to ai-run and Check-Any-Attack
TRIGGER_NAME [wsword] //Add name of the trigger for attribute
COORDX [0] // For storing X position of THIS pawn at death
COORDY [0] // For storing Y position of THIS pawn at death
COORDZ [0] // For storing Z position of THIS pawn at death
MAXPOINTS [27] //Number of Scriptpoints in level for THIS pawn
SCALE [1] // scale of actor
GROUP [soldier] // name of monster group
BOXWIDTH [25] // width and depth of bounding box
HOSTILEPLAYER [true] // hostile to player
HOSTILEDIFFERENT [false] // hostile to different Pawn group
HOSTILESAME [false] // hostile to same Pawn group
HEALTHATTRIBUTE [enemy_health] // name of health attribute HEALTH [50] // initial amount of health
SIGHTDIST [200] // max distance monster can see at idle
ALERTSIGHTDIST [150] // max distance monster can see when alert
FOV [160] // field of view in degrees
ATTACKFOV [360] // attacking field of view
YAWSPEED [360] // speed of rotation in deg/sec
DAMAGEATTRIBUTE [health] // attribute damaged by attack ALERTTRIGGER [AlertG] // name of alert trigger
User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Post by creekmonkey »

Thanks Bernie, that was it, I had actually already found the problem after hours of trial and error.
Post Reply