Chaosforge Forum
DoomRL => Modding => Topic started by: SPTX on April 28, 2013, 06:38
-
I tried using
if player.eq.weapon.group == "weapon-melee"
But does the following error
Unknown property "group" requested on object of type TItem!
Why is that so? the property works when creating a new weapon, it's also there using the table logger from there (http://forum.chaosforge.org/index.php/topic,6233.msg54120.html#msg54120), so it definitely exists. I am really confused.
-
That's on prototypes, not items themselves. The way to access it is items[item_id].group
I don't know why it isn't be exposed as a read-only item property but it's not. I just mod here.
-
I don't understand what you mean by "items[item_id].group".
Not to mention that I need to compare my equipped item to a particular group. ie : if the player has a shotgun or a melee weapon equipped, function doesn't happen.
I really need to do it from the equipped weapon.
-
The weapon will have an item ID.
items[ self.eq.weapon.id ].group
-
And and I was going to use variables... stupid me.