Greeting,
I have a question about displaying overlays. Can yuo help me with this? Here you can see small part of code, which is a check for weapon comparing to item returned from agent_get_wielded_item check.
Check creates overlay to help player understand which spell he can use. This works for equipped_item check, but equipped means placed in all slots of body, so its reserved for Aura spells which depends on item equipped in armor slot.
When i am running the game, overlays are created,as you can see.
True problem appears when the player have 2 magic items (checked by this script). Overlay is created not for currently wielded (in hands) but for an item which is last in this check.
I tried to divide checks into different triggers, use local variable instead of global, additionally check special global variable which would allow only 1 successful check etc. All fails.
The game started to display overlay which is currently in the hands of player (even if this is not last). In next, there are 2 variants - if following magic item is placed bellow in this check, the game will display overlay for second and if you will switch to first item, nothing will change. If the first taken item was last in the check, game will not change overlays.
Can you help with this? Probably, i should use another check or smth else?
P.S. Ofc, i can place these checks directly into scripts of magic casting. But this decision have single flaw - overlays will appear after first spellcast - not before.
I have a question about displaying overlays. Can yuo help me with this? Here you can see small part of code, which is a check for weapon comparing to item returned from agent_get_wielded_item check.
Code:
(agent_get_wielded_item,"$magicweapon",":playeragent"),
(try_begin),
(eq,"$magicweapon","itm_tpspmagic1"),
(create_mesh_overlay, "$smcspellview", "mesh_smccastspells1"),
(else_try),
(eq,"$magicweapon","itm_tpspmagic2"),
(create_mesh_overlay, "$smcspellview", "mesh_smccastspells2"),
(else_try),
(eq,"$magicweapon","itm_tpspmagic3"),
(create_mesh_overlay, "$smcspellview", "mesh_smccastspells3"),
(else_try),
(eq,"$magicweapon","itm_grspmagic1"),
(create_mesh_overlay, "$smcspellview", "mesh_smccastspells4"),
(else_try),
(eq,"$magicweapon","itm_grspmagic2"),
(create_mesh_overlay, "$smcspellview", "mesh_smccastspells5"),
(try_end),
(overlay_set_position, "$smcspellview", pos1),
Check creates overlay to help player understand which spell he can use. This works for equipped_item check, but equipped means placed in all slots of body, so its reserved for Aura spells which depends on item equipped in armor slot.
When i am running the game, overlays are created,as you can see.
True problem appears when the player have 2 magic items (checked by this script). Overlay is created not for currently wielded (in hands) but for an item which is last in this check.
I tried to divide checks into different triggers, use local variable instead of global, additionally check special global variable which would allow only 1 successful check etc. All fails.
The game started to display overlay which is currently in the hands of player (even if this is not last). In next, there are 2 variants - if following magic item is placed bellow in this check, the game will display overlay for second and if you will switch to first item, nothing will change. If the first taken item was last in the check, game will not change overlays.
Can you help with this? Probably, i should use another check or smth else?
P.S. Ofc, i can place these checks directly into scripts of magic casting. But this decision have single flaw - overlays will appear after first spellcast - not before.