Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-02-2010, 07:27 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Detecting if the chatbox/chat field is open.

You know how UN has that typewriter script? I'm trying to create a script that detects if the chat box is open and the player is typing (anything), and displays an emote to show that the player is typing. though i cant seem to find the functions that detect this. anyone know where i could find a list of functions or whatever that check for these? or if youve found them somewhere in the wiki, could you link me to it?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 05-02-2010, 09:24 AM
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
ChatBar is the GuiTextEditCtrl; you can use events like onShow to display the bubble.
__________________
Reply With Quote
  #3  
Old 05-02-2010, 09:52 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
ChatBar.visible = true;

I used something like this to detect if it's open
HTML Code:
//#CLIENTSIDE
function onKeyPressed(code) {
  if (keydown(8) || temp.code == 9) setTimer(0.05);
}

function onTimeout() {
  if (ChatBar.visible) {
    temp.text = ChatBar.text; //or ChatBar.getText()
    if (temp.text != null) {
      [Do your animation]
    }
    setTimer(0.1);
  }
}
__________________
Reply With Quote
  #4  
Old 05-02-2010, 06:00 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
I believe that I used ChatBar.visible on N-Pulse a while back when I added the emote-chat bubble there. Some people don't like these types of things, but I personally think it's a nice little feature; sort of like how most instant messengers tell you when the person you're conversing with is typing.
Reply With Quote
  #5  
Old 05-02-2010, 06:19 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
cbk already said but what it comes down to is:

PHP Code:
//#CLIENTSIDE
function ChatBar.onShow() {
  
// I have been made visible.

All GUI controls have that kind of functionality, you can find the list here:

http://wiki.graal.net/index.php/Crea...ent/GuiControl
__________________
Quote:
Reply With Quote
  #6  
Old 05-02-2010, 06:29 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by fowlplay4 View Post
cbk already said but what it comes down to is:

PHP Code:
//#CLIENTSIDE
function ChatBar.onShow() {
  
// I have been made visible.

All GUI controls have that kind of functionality, you can find the list here:

http://wiki.graal.net/index.php/Crea...ent/GuiControl

ChatBar.onShow() is only evoked once each time that the ChatBar becomes visible. This can lead to the emote glitching in cases where the player is warped around while chatting (could be that they are waiting for an event to start and the ET warps everyone to the event while some are mid-chat), and probably other instances as well (like spar waiting queues and such).
Reply With Quote
  #7  
Old 05-02-2010, 07:30 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Gambet View Post
I believe that I used ChatBar.visible on N-Pulse a while back when I added the emote-chat bubble there. Some people don't like these types of things, but I personally think it's a nice little feature; sort of like how most instant messengers tell you when the person you're conversing with is typing.
Mhm, you're right, that's really all it takes. You can use Andy's example as well if you want a more event oriented approach.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #8  
Old 05-03-2010, 08:14 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Thanks guys. i got it working last night using andy's example. and thanks for the link jer now all i need to do is find out how to make the emote image i made act like an actual emote instead of making a seperate gani for each gani the player triggers it in
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #9  
Old 05-03-2010, 08:23 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Set player.attr[30] to whatever gani you would like to show. You can choose any number up to 30 but make sure none of your ganis are using the attribute that you set it to.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:19 PM.


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