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 08-25-2006, 09:29 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
NPCS not updating?

Okay this has to be the MOST ANNOYING thing in the world.

I have a public function being called from a localnpc via findNPC() which works and all then it would message("") whatever the outcome is blah blah.

Well for some reason the message only will change if I say something, reconnect, or a player enters.

PHP Code:
function onCreated()
{
  
setimg("block.png");
}

function 
onActionGrab()
{
  
findNPC("localnpc_g_kuji-testlvl_35088589_0").message("wtf");

The above code should work, but it doesn't. If I grab the block that changes the message, then say something it'll change.
nothing works

Last edited by KuJi; 08-25-2006 at 06:49 PM..
Reply With Quote
  #2  
Old 08-25-2006, 09:36 PM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
I have noticed that npcs do not update clientside unless you reconnect for some odd reason.
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #3  
Old 08-25-2006, 09:46 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
It may be that you're trying to overload the message function. Did you try naming the function something different?
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #4  
Old 08-25-2006, 09:51 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Well this is totally a serverside npc - I tried making a regular function which called the message function which didnt do much. It seems that only message this happens too
Reply With Quote
  #5  
Old 08-25-2006, 10:03 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Okay, my solution was to triggeraction to itself on the clientside to do displaying of msg whatever :o
Reply With Quote
  #6  
Old 08-26-2006, 01:47 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
When you modify some other npc then it will not be updated, since it is inactive. Best way is to activate it afterwards by triggering it:

PHP Code:
function onActionGrab() {
  
with (findNPC("localnpc_g_kuji-testlvl_35088589_0")) {
    
message("wtf");
    
trigger("update","");
  }

Since might sound strange, but the npcserver is just not caring about inactive npcs, because the total number of npcs is often 100 times bigger than the number of active npcs, so checking all npcs for updates would slow down the server. It could be possible to let the npc activate itself though, will check sometime if that is possible.
Reply With Quote
  #7  
Old 08-26-2006, 07:55 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Stefan
When you modify some other npc then it will not be updated, since it is inactive. Best way is to activate it afterwards by triggering it:

PHP Code:
function onActionGrab() {
  
with (findNPC("localnpc_g_kuji-testlvl_35088589_0")) {
    
message("wtf");
    
trigger("update","");
  }

Since might sound strange, but the npcserver is just not caring about inactive npcs, because the total number of npcs is often 100 times bigger than the number of active npcs, so checking all npcs for updates would slow down the server. It could be possible to let the npc activate itself though, will check sometime if that is possible.
Yeah, my solution was to trigger an action to itself :o
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:59 PM.


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