So TheNiceOne ....you are so
!THE MAN!
No one can deny that.
(JUST LET ANYONE EVEN TRY TO!) :toughninja:
But why the extra long code to just use the
CreateTempRef idea?
After you pointed out to me the idea to use CreateTempRef I did this:
let TmpRef := CreateTempRef TmpWeaponTmpRef.setWeaponSpeed NewSpeedFloatlet TmpRef := 0
IT SEEMS TO BE WORKING GREAT!
No more forced playgroup sheath the weapon sillyness.
The way you had done it with the extra array use and loops?
I already have 2 interacting arrays running to first go thru a list of previously adapted weapons and then break from that loop to another that did more work then came back to the first loop...and so on. :banghead:
So putting in another set of loop arrays was intimidating me enough to just stay with the silly playgroup sheath method.
But after reading about CreateTempRef I thought why not try "the easy way".
I am asking because I am worried I may be in ignorance of a good reason to go the "long way" as you suggested. Or maybe I am just missing the point of what you were trying to communicate with the extra array and loop?
Can you explain why you think this temp ref thing works? Why would it not work using the Obj reference?
Just a wild, untested idea, but if you create an http://obse.silverlock.org/obse_command_doc.html#Inventory_Reference to the equipped weapon and call SetAttackDamage (or any similar function) directly on that reference, maybe it will work immediately.
E.g. something like:
ref actorref weaponBaseObjectref weaponRefshort newDamagearray_var intventoryWeaponsarray_var weaponStack...SetAttackDamage newDamage weaponBaseObject ; Changes the stat for all weapons of type weaponBaseObject, except the equipped one?let intventoryWeapons := actor.GetInvRefsForItem weaponBaseObject ; Creates an array of all stacks of that weapon in the actor's inventoryForEach weaponStack <- intventoryWeapons ; Iterates over the array, and assigns each stack to weaponStack in turn let weaponRef := *weaponStack ; Sets weaponRef to the inventory reference for one weapon stack weaponRef.SetAttackDamage newDamage ; Sets damage for each stack in the inventory including the equipped oneLoop