ModifyAttribute...huh?

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

ModifyAttribute...huh?

Post by metal_head »

Well you all know that ModifyAttribute is the command for modifying a defined attribute, I got this attribute called "kill" in the player.ini file and I want it to get +1 every time I kill a person, ok, in the death order (it's High level) I've added

Code: Select all

ModifyAttribute("kill", 1);

What I want is to have an attribute that counts kills, but the attribute doesn't change, it stays on 0 no matter how pawns (with the same script) I kill.
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: ModifyAttribute...huh?

Post by QuestOfDreams »

For modifying the player's attribute you must use

Code: Select all

ModifyAttribute("kill", 1, "Player");
The line

Code: Select all

ModifyAttribute("kill", 1);
would try to modify the Pawn's attribute "kill", which you haven't given to the Pawn (via the AddAttribute method) and so it cannot be change.

(Note that this is different from Conversation and LevelController scripts)
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: ModifyAttribute...huh?

Post by metal_head »

Oh thanks, I though that if I don't define the entity name it will modify the player's kill attribute, but I've been wrong.
Post Reply