Larian Banner
Previous Thread
Next Thread
Print Thread
Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
When using ItemInsertRune, attempting to add a rune to an item that doesn't have a slot in the "_Slot" number specified will crash the editor.

For instance, the weapon "WPN_Cheat_Sword_1H_RuneSlot2" has 2 rune slots. Adding runes to slot 0 and 1 is fine, but attempting to add a rune to slot 2 (which it doesn't have) causes a crash.

This was traceable within osirislog.log, as the call was the last thing in the log:
Code
ItemInsertRune( (CHARACTERGUID)NULL_00000000-0000-0000-0000-000000000000, (GUIDSTRING)(ITEMGUID)WPN_Common_Sword_1H_A2_6b6ce679-75f5-4c24-9c05-955b9178c378, (STRING)"LOOT_Rune_Masterwork_Large_7e16d9af-6865-4f0f-a67a-144b8ef2da26", (INTEGER)2 )


The crash dump had this exception:
Code
Exception Code:	0xC0000005
Exception Information:	The thread tried to read from or write to a virtual address for which it does not have the appropriate access.


Likewise, trying to add a rune to equipment with no rune slots resulted in a crash.

Additionally, the runes were being added shortly after an item was created, so I'm not sure if that factors into it, since the wiki mentions (for ItemInsertRune):
Quote
This call does nothing if _Item is invalid, _Template is not an item root template for a rune, or if _Slot is >= the number of rune slots in _Item.

____________________________

I was able to work around this by making sure to apply an empty rune slot deltamod before inserting the rune, but adding some sort of crash-safety in the call would be ideal.

The workaround involved matching an item type (weapon, armor (upperbody, arms, lowerbody, gloves, legs, amulet) to an associated empty slot deltamod: Rune Crash Workaround

Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
Oh, I should mention - given that deltamods that add a rune also add the empty slot boost, like so:

Code
new deltamod "Boost_Weapon_Rune_LOOT_Rune_Venom_Large"
param "BoostType" "Rune"
param "MinLevel" "10"
param "MaxLevel" "14"
param "Frequency" "1"
param "ModifierType" "Weapon"
new boost "_Boost_Weapon_EmptyRuneSlot",1
new boost "LOOT_Rune_Venom_Large",1

It's reasonable to expect that the system requires an empty slot before a rune can be added, so having a query for retrieving the number of slots on an item would be useful. Something like this:
Code
query ItemGetRuneSlots([in](ITEMGUID)_Item, [out](INTEGER)_Slots)

Then we could check if an item has any rune slots at all before attempting to add a rune.

I sort of attempt this with ItemGetRuneItemTemplate, but that both fails if there's nothing in a slot, or if an item doesn't have a slot at all, so unfortunately it's not ideal for seeing if an item has an open slot available.

Joined: May 2017
enthusiast
OP Offline
enthusiast
Joined: May 2017
Small additional bug with inserting runes with deltamods:

While it works, I get these errors in the message log:

[CRPGStats_DeltaModifier_Manager::ModifyObject] Inserting rune "LOOT_Rune_Thunder_Small" in object "ARM_Amulet" failed!

[CRPGStats_DeltaModifier_Manager::ModifyObject] Inserting rune "LOOT_Rune_Masterwork_Small" in object "WPN_PrimitiveHarpoon" failed!

[CRPGStats_DeltaModifier_Manager::ModifyObject] Inserting rune "LOOT_Rune_Venom_Large" in object "WPN_Cheat_Sword_1H_RuneSlot2" failed!

Category: Code
Count: 2
Timestamp: 21-07-2018 14:22:17:619
Function: CRPGStats_DeltaModifier_Manager::ModifyObject
Location: EoCShared\Shared\rpgstats_deltamodifiers.cpp (365)


Despite these errors, the runes were inserted as expected:
[Linked Image]

The deltamods were added to items given to an NPC (a trader), so I'm not sure if that factors into it somehow.

The deltamods used are:
Sword: "Boost_Weapon_Rune_LOOT_Rune_Venom_Large"
Amulet: "Boost_Armor_Amulet_Rune_LOOT_Rune_Thunder_Small"
Spear: "Boost_Weapon_Rune_LOOT_Rune_Masterwork_Small"

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
What happens is that code goes over all boosts associated with a deltamod, and then for every one of those that is a rune, it will try to insert the rune. The error is printed if the item no longer has any empty rune slots when inserting the rune.

My guess is that code somehow tries to insert additional runes after you've inserted the runes with your Osiris call.


Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5