HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: 1 ... 5 6 [7] 8

Author Topic: How to make a simple scrollable chat window  (Read 51328 times)

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #90 on: Dec 30, 12, 01:19:20 AM »

Very nice tutorial, thanks.
Only error was the children() set to function. Easy fix.
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685

Drilikath

  • World Owners
  • ****
  • Posts: 1
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #91 on: Dec 30, 12, 06:08:06 PM »

Starting out fresh with this engine it is nice to read through a lot of this stuff and learn from others.
Logged

feredfn

  • General Accounts
  • *
  • Posts: 154
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #92 on: Jan 02, 13, 06:57:10 AM »

Yeah indeed ,

I didn't try this good tutorial yet , but i have to say thanks for sharing what you have learnt so far ..
Hope i be able to do the same soon .
Logged

Thierry

  • General Accounts
  • *
  • Posts: 9
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #93 on: Jan 03, 13, 08:07:39 AM »

Hi, im a beginner and tryed this tutorial, just for learning. Im getting the following errors:

At "TMP_ChatWindowClassMethods(CLIENTSIDE)"
Line 3, col 9: Function 'CreateNodFromPrototype' not found in local script or as external function
Line 7, col 22: Field 'Chat_GetClientarea' not found in database:GOM::lookupClassDefID (801): definition not found: Chat_GetClientarea

Code from line 1 to line 13:
Code: [Select]
method AddChatMessage ( message as String, channel as String )
  msg as NodeRef of Class E_ChatLabel
  msg = CreateNodFromPrototype("E_ChatLabel")
  msg.build = true
  msg.dockMode = TOP
 
  var clientArea = me.Chat_GetClientarea
  add back msg to clientArea.children()
  msg.text = message
  //myLabel.E_ChatMsgTime = SYSTEM.TIME.NOW
  me.SetColorForChannel( msg, channel )
 
.

At "E_ChatHandlerClassMethods(CLIENTSIDE)"
Line 9, col 22: Method 'SetChatFocus' not found.
Line 49, col 9: Node variable does not specify a class that contains the field value
Line 54, col 25: Node variable does not specify a class that contains the field value


Code from line 8 to line 19:
Code: [Select]
method OpenChatInput(command as Boolean)
  me.GetChatWindow().SetChatFocus(command)
    //  if input == None
     //    input = CreateNodeFromPrototype("E_ChatInputBox" )
     //    input.build = true
     //  .
     //  input.visible = true
     //SetKeyboardFocus( input )
.
     //
     //  Restrict displayed chat messages to limited,well-known channels.
     //

Code from line 43 to 71:
Code: [Select]
method OnKeyDown( args references Class GUIKeyboardEvent )
 
  when args.keyCode
    is 27 //esc toets
      SetKeyBoardFocus( None )
      //me.visible = false
      me.value = ""
      args.handled = true
    .
    is 13 //enter toets
      args.handled = true
      msg as String = me.value
      while FindString( msg, " " ) == 1 and msg.length >1
        msg = subString( msg, 2, msg.length )
      .
      if msg.length > 0
        first as String = SubString(msg, 1, 1 )
        if first == "/"
          if msg.length > 1
            SendCommand ( msg)
          .
        else
          SendChat( msg, "game" )
        .
      .
      SetKeyboardFocus( None )
    .
  .
.

At "Input_Command(CLIENTSIDE)"
Line 26, col 27: Expected 0 function arguments but found 1
Line 29 col 26: Expected 0 function arguments but found 1.


Code from line 25 to 34:
Code: [Select]
   is "Chat"
      $Chat.OpenChatInput(false)
   .
   is "SlashChat"
     $Chat.OpenChatInput(true)
     //var box = $Chat.GetChatInputBox()
     //box as NodeRef of Class E_ChatInputBox = $Chat.GetChatWindow() // Accesses the input box
     //box.value = "/"
     //SetCaret( box, 2, 2 )
   .

Can someone help me please? Im just eleven years old (almost 12 ;D ;D), so if i made some noobish mistakes... Have a nice day! :)
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #94 on: Jan 04, 13, 10:39:49 PM »

Line 3, col 9: Function 'CreateNodFromPrototype'    <--- spelling Node

Line 9, col 22: Method 'SetChatFocus' not found.
With 1 script not compiling, other scripts that depend on that scrip for info/data will also get compile errors.

Line 26, col 27: Expected 0 function arguments but found 1
Line 29 col 26: Expected 0 function arguments but found 1.
With the uncomplied script these lines are still looking at the old code which uses function -> method OpenChatInput() which is missing the (command as Boolean) in side.
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685

Thierry

  • General Accounts
  • *
  • Posts: 9
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #95 on: Feb 02, 13, 07:19:07 AM »

Thankyou  :) Late reaction.. Sorry!

Can you also solve the problem from line 7 col 22?
Logged

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #96 on: Feb 02, 13, 03:01:55 PM »

Thankyou  :) Late reaction.. Sorry!

Can you also solve the problem from line 7 col 22?
Code: [Select]
Line 7, col 22: Field 'Chat_GetClientarea' not found in database:GOM::lookupClassDefID (801): definition not found: Chat_GetClientareaYou forgot the "( )"
Code: [Select]
var clientArea = me.Chat_GetClientarea
Without them, the compiler is looking for the field in the dom.
Which is why there is an error.
Logged

Viper155

  • World Owners
  • ****
  • Posts: 73
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #97 on: Feb 03, 13, 12:07:34 AM »

Anyone know how to stop it from creating more than 1 chat box each time I switch areas?  If i switch to 3 areas I will end up with 3 chat windows...
Logged

OblivionMMO

  • General Accounts
  • *
  • Posts: 37
  • Hey all, How do I....
    • View Profile
    • Oblivion Entertainment
Re: How to make a simple scrollable chat window
« Reply #98 on: Feb 04, 13, 06:41:07 PM »

Anyone got an idea how to make it autoscroll?  It's obnoxious to have to click down every time.
Logged
Joshua Clay - Owner
Oblivion Entertainment
http://oblivionent.com

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #99 on: Feb 04, 13, 07:19:11 PM »

I believe it was mentioned above.

from XCalPro
Quote
"Yes, in the GUI Editor, in the clientarea's Misc properties, set AllowStickyBottom to TRUE."
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685

SilverDK

  • World Owners
  • ****
  • Posts: 15
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #100 on: Mar 01, 13, 04:28:19 PM »

Hey, first of all, thank you very much for sharing this tutorial, I'm new and it was easy to follow along..

Though I did run into a problem, I have been looking after the error for an half an hour, but I cannot seem to find it..

This is the error I get:
Code: [Select]
Client Script Error
SCRIPT ERROR: Node 0 not found to call method SETCHATFOCUS
03/01/2013 23:27:34
Call trace:
  Script E_ChatHandlerClassMethods line 8 me[id=1000000179 class=_ChatHandler,E_ChatHandler]
  Script Input_Command line 26 me[9223372056440021575]
starting method/function ONCMDSTOP
starting me[id=9223372056440021575 class=E_playerAccount,HBNode,CharacterNode,_ACCControllerOwner]

Here is the area around E_ChatHandlerClassMethods:
Code: [Select]
method OpenChatInput(command as Boolean)
  me.GetChatWindow().SetChatFocus(command)
.

EDIT: I have found out that the code:
Code: [Select]
me.GetChatWindow() returns 0, if that helps.

EDIT 2: I have tried to add a few lines of code, and it stops the error but I just get a red box instead of the GUI.. Below is the changed method.
Code: [Select]
method OpenChatInput(command as Boolean)
  chatWindow as NodeRef = me.GetChatWindow()
  if (chatWindow == 0)
    chatWindow = CreateNodeFromPrototype( "KNA_ChatWindow" )
  .
  chatWindow.SetChatFocus(command)
.
I will attach a screenshot that shows what gets rendered.


Here is the area around Input_Command
Code: [Select]
    is "Chat"
      $CHAT.OpenChatInput(false)
    .
    is "SlashChat"
      $CHAT.OpenChatInput(true)
//      var box = $CHAT.GetChatInputBox()
//      box.value = "/"
//      SetCaret( box, 2, 2 )
    .

Here is the GetChatWindow method:
Code: [Select]
method GetChatWindow() as NodeRef of Class KNA_ChatWindow
  return FindGUIControlByName( None, "KNA_ch_ChatWindow" )
.


I would really appreciate some help here.. Let me know if I need to post other things..

Best Regards
« Last Edit: Mar 01, 13, 05:44:14 PM by SilverDK »
Logged
Kim Andersen

Lead Programmer @ Happy Mares Studio

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #101 on: Mar 01, 13, 05:45:42 PM »

It could be that the chat window is in the "game" layer
IF so, you need to add "game."

Like so:

Code: [Select]
method GetChatWindow() as NodeRef of Class KNA_ChatWindow
  return FindGUIControlByName( None, "game.KNA_ch_ChatWindow" )
.
Logged

SilverDK

  • World Owners
  • ****
  • Posts: 15
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #102 on: Mar 01, 13, 05:55:21 PM »

Hey Jrome..

Thanks for your suggestion, but I've tried adding game as you suggested, but it still prints out the error..

Is there anyway to see what layer the different gui objects are on ?
Logged
Kim Andersen

Lead Programmer @ Happy Mares Studio

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #103 on: Mar 01, 13, 06:17:58 PM »

Hey Jrome..

Thanks for your suggestion, but I've tried adding game as you suggested, but it still prints out the error..

Is there anyway to see what layer the different gui objects are on ?

While hovering over a gui control, you can press "CTRL + SHIFT + T"
And a menu will popup. From there you can get info about the gui control.

Or you can open up the GUI prototype in the gui editor.
Logged

SilverDK

  • World Owners
  • ****
  • Posts: 15
    • View Profile
Re: How to make a simple scrollable chat window
« Reply #104 on: Mar 01, 13, 06:18:51 PM »

Thank you very much Jrome for the tips.
Logged
Kim Andersen

Lead Programmer @ Happy Mares Studio
Pages: 1 ... 5 6 [7] 8