Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-23-2006, 07:37 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
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.
Reply With Quote
  #2  
Old 12-23-2006, 03:27 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #3  
Old 12-23-2006, 06:32 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:55 AM.


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