Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-07-2010, 09:11 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
NPC setimg() from another NPC

It seems as though NPCs don't update their image on a player's screen until actually interacting with the NPC (onCreated(), onPlayer____()). At least, this is seen on Unholy Nation with their Event Doors. Is there any way to get the image to update with a (public) function called from another NPC?

Edit: Seems like they don't update anything (to the player) unless an interaction with the player is done.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 04-07-2010 at 10:02 PM..
Reply With Quote
  #2  
Old 04-07-2010, 09:35 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Maybe it's just asleep and you need to wake it by triggering an event?
Reply With Quote
  #3  
Old 04-07-2010, 09:50 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
All you need to do is..

this.trigger("Update", "");

Which will force an update (Any event will do not just Update)
__________________
Quote:
Reply With Quote
  #4  
Old 04-07-2010, 09:51 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by DrakilorP2P View Post
Maybe it's just asleep and you need to wake it by triggering an event?
It's triggering a function from the other NPC. The problem is that it won't update to the player, though is updated on the server, until player interaction occurs (onPlayerTouchsMe, onPlayerEnters).

Edit: Seems like having a timeout triggering (starting from onCreated) can update the NPC to the player.

Edit: That worked too, Jer, and will be more efficient, thanks. Still pretty weird that it needs this in the first place.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 04-07-2010 at 10:08 PM..
Reply With Quote
  #5  
Old 04-07-2010, 10:20 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by fowlplay4 View Post
All you need to do is..

this.trigger("Update", "");

Which will force an update (Any event will do not just Update)
No need for the second parameter now

PHP Code:
this.trigger("update"); 
__________________
Reply With Quote
  #6  
Old 04-07-2010, 10:51 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Another note to my post, originally Novo had stored clan data and so on in a DB but we experienced a random data loss when the server restarted/crashed. To counter this:

PHP Code:
function saveData() {
  
// Just setting a test variable
  
this.variable "lolwhatever";

  
// Forces the DB to update/save to the HDD (from what I understood from Stefan)
  
this.trigger("Update");

__________________
Quote:
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 08:28 AM.


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