[FIXED] Archery Butte's bugged!

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Archery Butte's bugged!

Post by stranf »

the "onUse" function checks to see if a character is in range, because of this it is impossible to use an archery butte.

When clicking on the archery butte, the c++ code says "This item is too far away to use". When you get close enough (point blank range) the .js code says "This is too far away, back up".

Robin Hood eventually gets tired and collapses and dies while running back and forth to find where he is allowed to shoot.

I am not sure how to fix this bug. I'm going to switch the "onUse" to "onAttack" and maybe if you double click the butte while in War Mode, the script will fire.

What are your thoughts?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Known issue to me, and I'm not sure how to work around it. It started happening after some code was changed to make onUse work under the same conditions as the hardcoded double-clicking, i.e. can't use while dead, can't use while out of range, can't use rapidly (object-use-delay) - which in my own opinion sort of goes against the principle of the JS engine in the first place, seeing as it becomes (like in the case with the archery buttes) a limitation that you cannot work around without modifying the source code for UOX3.
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

maybe when Giwo or Grimson gets more time to code they can look into this.

I, like you, would like to have more power with the JS engine for onUse events.

I've thought of teleporting the PC to another remote area when dead and having different side quests (js scripted) available to ressurect the PC; however, this is impossible with the current hard-coded double click limitation.

Oh, and switching the code to <onAttack> does nothing, the c++ engine still thinks it is too far away.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

How about splitting "onUse" into "onUseChecked" and "onUseUnchecked"?
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

That sounds like a great idea to me. How hard would it be to implement?
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Give the new experimental build a try, but remember to change all occurences of the "onUse" event to "onUseChecked", or "onUseUnChecked" if you want to perform all checks in the script.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

I have a lot of custom scripts,

will the "onUse" default to an onUsedChecked, so I don't have to reopen and edit every one of my scripts?
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

stranf wrote:will the "onUse" default to an onUsedChecked, so I don't have to reopen and edit every one of my scripts?
Nope, "onUse" is gone. Use an editor that can do search and replace over files if you have many scripts.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Tbh, having the hardcoded one default to onUse would probably better, so we'd avoid bug reports dealing with onUse not working =P
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Archerybutte-script on CVS has been updated to use onUseUnchecked(), and works once more. Fixed.
-= Ho Eyo He Hum =-
Post Reply