/Liro
Advanced OT User
- Joined
- Jan 18, 2010
- Messages
- 465
- Reaction score
- 191
When aiming on battle list, if the creature is moving, the client often targets the floor tile where the creature was instead of the creature itself, which causes the server to return RETURNVALUE_CANONLYUSETHISRUNEONCREATURES if the rune requires a creature target.
I've tried offsetting to account for this but ultimately been unsuccessful (I think) due to variable creature speeds.
The code below executes when you manually aim a rune on the battle list.
I've tried changing this to work with the creatureId instead but get the same result:
The issue may also be heavily latency based. If the client is collecting and passing the creature pos according to the client (which may be 100+ ms behind server), there is more chance that when the server registers the action, the creature will no longer be at the position.
I've tried offsetting to account for this but ultimately been unsuccessful (I think) due to variable creature speeds.
The code below executes when you manually aim a rune on the battle list.
Code:
local creature = clickedWidget:getCreature()
if creature then
g_game.useWith(selectedThing, creature, selectedSubtype)
end
clickedWidget:getCreature() passes the position that the creature is in at the moment of clicking to g_game.useWith which uses that position.
I've tried changing this to work with the creatureId instead but get the same result:
Code:
local creature = clickedWidget:getCreature()
local creatureId = creature:getId()
if creature then
g_game.useWith(selectedThing, g_map.getCreatureById(creatureId), subType)
end
Last edited: