Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Major bug: NPC not allowing function calls? (https://forums.graalonline.com/forums/showthread.php?t=70952)

Yen 12-23-2006 07:37 AM

Major bug: NPC not allowing function calls?
 
I don't know how to describe this bug.
It's ruining Zodiac's Stealth skill.

Before I explain the bug, it should be noted that this bug just was noticed after the previous Graal update. A similar bug also exists, however, which was there before the update.

When a player uses Stealth, they become unable to unequip/equip/attack with weapons. One weapon, WeaponControl, controls all of these functions.
However, if I update the script of WeaponControl with my RC, the bug will stop effecting players who are already online.

It's hard to explain the problem, like I said.
This is the block to check if the player is attacking, found in WeaponControl:
PHP Code:

function onKeyPressed() {
  if (
keydown(5) && !this.keys) {
    
this.keys true;
    
setTimer(.05);
    if (
CanAttack()) {
      
onAttack();
    }
  }


The weapon doesn't catch the onKeyPressed function after Stealth has been used.

The weapon +System calls 'onEquip' and 'onUnEquip' on WeaponControl to equip/unequip weapons. After using stealth, the +System tries to call the functions in WeaponControl, but WeaponControl doesn't respond.
Yes, they are public.

However, I am able to call 'onEquip' and 'onUnEquip' from my debug NPC.
PHP Code:

findweapon(this.tokens[0]).(@this.tokens[1])(this.tokens[2],this.tokens[3],this.tokens[4]) 

When I call 'onEquip' through my debug NPC, the WeaponControl runs the function.
The +System calls them in the exact same way, but WeaponControl doesn't respond to it.

I find it really weird that WeaponControl isn't acknowledging built-in functions, like onKeyPressed(), though.


The similar, older, bug has to do with the Inventory. After using Stealth for a while, the Inventory stops responding to function calls (including built-in functions). I can't figure out the exact cause of the Inventory bug, though. It seems to just randomly happen.


I'd also like to note that the Stealth NPC has absolutely NO relation to the WeaponControl or Inventory. They have nothing in common, not even variables/flags they check for. Stealth has no relation to any other NPCs.

Admins 12-23-2006 03:27 PM

The new versions displays better error messages, you don't see any errors related to that in F2? I have seen several errors when connecting to Zodiac, but I am not sure if that has to do with this.
Function calls of other objects: the case of the name is important. For calling weapons you don't need to use findweapon though, you can directly call weaponname.function().
Events: events should not stop being received in any case. The only thing I could imagine is that you have another object of the same name, which then receives the events instead your weapon script.

Yen 12-23-2006 06:32 PM

No, I've double checked everything you said.. It shouldn't be happening. If another object had the same name, I don't think my debug NPC would be able to call events in the WeaponControl. Also, I didn't think that it was possible to have two weapon objects with the same name?

Like I said, it ONLY happens if a player uses the Stealth skill; if I make an update to WeaponControl, people who are online won't experience the bug unless they reconnect.

The error messages are from NPCs trying to destroy non-existant GUI controls and calling functions that are in joined classes before the class finishes joining.


All times are GMT +2. The time now is 07:35 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.