Player Resource Consortium

 

Author Topic: Two Shifter (PnP) issues I'd like to fix  (Read 4418 times)

0 Members and 1 Guest are viewing this topic.

October 01, 2009, 03:48:45 PM
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

1) When you shift to a form that has different STR, DEX, or CON values than your base form, these values are adjusted up or down by adding appropriate item properties to the creature weapons or hide. This is done by calling the PRC SetCompositeBonus function, which ultimately calls either

    AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(...), ...)

or

    AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDecreaseAbility(...), ...);

The problem here is that, although I believe I've verified that the 2nd function is being called with the correct parameters when an ability needs to be adjusted downward, the item property to decrease the ability is never added (I've verified this by forcing the creature weapons to be unequipped and looking at their proerties). Any ideas why? I'm almost certain this was working not long ago.

2) The PRC code that determines what weapons should be equippable takes into account the size of the creature. Thus, if I'm in the form of a large enough creature, I can wield a greatsword in one hand and a shield in another, but cannnot use a dagger; on the other hand, if I'm smaller, I can use a dagger but a greatsword requires two hands. The problem is that this code apparently only runs when I load a saved game. So if I save a game with a large shape, reload it, and shift into a small shape, I can be, for instance, a rat wielding a greatsword and a tower shield. I haven't even looked for this yet, thinking I would ask first: is there any way for me to re-run this code whenever the Shifter changes form?


October 01, 2009, 05:14:41 PM
Reply #1

Quote from: CapnQ

1) When you shift to a form that has different STR, DEX, or CON values than your base form, these values are adjusted up or down by adding appropriate item properties to the creature weapons or hide. This is done by calling the PRC SetCompositeBonus function, which ultimately calls either

    AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(...), ...)

or

    AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDecreaseAbility(...), ...);

The problem here is that, although I believe I've verified that the 2nd function is being called with the correct parameters when an ability needs to be adjusted downward, the item property to decrease the ability is never added (I've verified this by forcing the creature weapons to be unequipped and looking at their proerties). Any ideas why? I'm almost certain this was working not long ago.


Those would be set on the hide for abilities. The unequip script is one place where these things are checked, so you might end up removing the itemproperties at the same time as unequipping, depending on how you did it.

Quote

2) The PRC code that determines what weapons should be equippable takes into account the size of the creature. Thus, if I'm in the form of a large enough creature, I can wield a greatsword in one hand and a shield in another, but cannnot use a dagger; on the other hand, if I'm smaller, I can use a dagger but a greatsword requires two hands. The problem is that this code apparently only runs when I load a saved game. So if I save a game with a large shape, reload it, and shift into a small shape, I can be, for instance, a rat wielding a greatsword and a tower shield. I haven't even looked for this yet, thinking I would ask first: is there any way for me to re-run this code whenever the Shifter changes form?


Unequip a weapon, re-equip it. The code is run in equip and unequip scripts as well as a few other places (level up and client enter, i think).


October 02, 2009, 09:54:55 AM
Reply #2
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

Quote from: fluffyamoeba

Quote from: CapnQ

1) When you shift to a form that has different STR, DEX, or CON values than your base form, these values are adjusted up or down by adding appropriate item properties to the creature weapons or hide. This is done by calling the PRC SetCompositeBonus function, which ultimately calls either

    AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(...), ...)

or

    AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyDecreaseAbility(...), ...);

The problem here is that, although I believe I've verified that the 2nd function is being called with the correct parameters when an ability needs to be adjusted downward, the item property to decrease the ability is never added (I've verified this by forcing the creature weapons to be unequipped and looking at their proerties). Any ideas why? I'm almost certain this was working not long ago.


Those would be set on the hide for abilities. The unequip script is one place where these things are checked, so you might end up removing the itemproperties at the same time as unequipping, depending on how you did it.


Actually, because of changes I made for the 3.3g release, the properties are set on the creature weapons, if any, rather than the hide (this prevents them from disappearing when the hide is scrubbed--e.g. when sleeping).

I unequipped them by making a script that unequips the creature weapons when I call it using the runscript command. I'm pretty sure the property isn't being added and later removed because all the other Shifter-related properties are still there: only the ItemPropertyDecreaseAbility is missing, which seems to indicate that it's failing to be added in the first place.

Quote
Quote

2) The PRC code that determines what weapons should be equippable takes into account the size of the creature. Thus, if I'm in the form of a large enough creature, I can wield a greatsword in one hand and a shield in another, but cannnot use a dagger; on the other hand, if I'm smaller, I can use a dagger but a greatsword requires two hands. The problem is that this code apparently only runs when I load a saved game. So if I save a game with a large shape, reload it, and shift into a small shape, I can be, for instance, a rat wielding a greatsword and a tower shield. I haven't even looked for this yet, thinking I would ask first: is there any way for me to re-run this code whenever the Shifter changes form?


Unequip a weapon, re-equip it. The code is run in equip and unequip scripts as well as a few other places (level up and client enter, i think).


Unequipping and re-equipping a weapon doesn't seem to make any difference. To illustrate exactly what I'm seeing: I save the game as a large shape (say, Demonflesh Golem) equppied with a large weapon (scythe) and a tower shield. I load the saved game and shift to a rat. I can still unequip and re-equip the scythe and shield at will, and after doing so I still can't equip any dagger (when I hover the mouse over a dagger, it turns red indicating that I can't use it).