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 12-02-2012, 05:38 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Send a message via Skype™ to sssssssssss
Problem displaying multiple arrays

the array is set up like this:
Graal Script Code:
client.system.messages="""[System Message]: Welcome To Armageddon."",1,1,1,pmbubble_admin.png","""[System Message]: Say /help for some commands!"",1,1,1,pmbubble_admin.png","""[System Message]: Say /news for the Main Info H 
Im trying to simply show any arrays that are already set up on onCreated and so forth, then simple add new ones in as they come. New ones do get added in, but ALL values are duplicated every time a new one is added.

Graal Script Code:
// set total size of all except system
  
temp.totalSize client.mass.messages.size() + client.tell.messages.size() + client.guild.messages.size() + client.system.messages.size();

  
// add new items to category all after init
  
while (this.tempChatSize temp.totalSize && this.active == "all")
  {
    if (
client.mass.messages.size() > 0)
    {
      
ChatBox_WindowText.addtext("<img src=" @client.mass.messages[this.tempChatSize][4]@ " id=sendImg" @client.mass.messages[this.tempChatSize]@ "/>" @client.mass.messages[this.tempChatSize][0] @ "<br>"false);
    }
    if (
client.tell.messages.size() > 0)
    {
      
ChatBox_WindowText.addtext("<img src=" @client.tell.messages[this.tempChatSize][4]@ " id=sendImg" @client.tell.messages[this.tempChatSize]@ "/>" @client.tell.messages[this.tempChatSize][0] @ "<br>"false);
    }
    if (
client.guild.messages.size() > 0)
    {
      
ChatBox_WindowText.addtext("<img src=" @client.guild.messages[this.tempChatSize][4]@ " id=sendImg" @client.guild.messages[this.tempChatSize]@ "/>" @client.guild.messages[this.tempChatSize][0] @ "<br>"false);
    }
    if (
client.system.messages.size() > 0)
    {
      
ChatBox_WindowText.addtext("<img src=" @client.system.messages[this.tempChatSize][4]@ " id=sendImg" @client.system.messages[this.tempChatSize]@ "/>" @client.system.messages[this.tempChatSize][0] @ "<br>"false);
    }
    
    
// add to total added
    
this.tempChatSize++;
    
    
// force scroll to bottom
    
ChatBox_WindowText.scrolltobottom();
  } 
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 12-02-2012, 06:03 AM
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
Re-script your system to use triggerclient (preferably via a player public function) and public functions for client-side messages instead of adding messages to client variables and looping on the client-side.
__________________
Quote:
Reply With Quote
  #3  
Old 12-02-2012, 06:05 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
Quote:
Originally Posted by fowlplay4 View Post
Re-script your system to use triggerclient instead of adding messages to client variables and looping on the client-side.
example of triggerclient for a similar system
__________________
Reply With Quote
  #4  
Old 12-02-2012, 03:29 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Send a message via Skype™ to sssssssssss
Thanks guys.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #5  
Old 12-02-2012, 06:25 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Send a message via Skype™ to sssssssssss
I still did need to use either client vars or a npc db to hold what has been since since the player was on, and to not worry about load I continued to use client vars.

However I completely eliminated any need for a time out for this system to work outside of a count down doing what you guys said along with the client vars so I appreciate it very much!
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #6  
Old 12-02-2012, 08:23 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
Quote:
Originally Posted by sssssssssss View Post
I still did need to use either client vars or a npc db to hold what has been since since the player was on, and to not worry about load I continued to use client vars.
There should be one central function where all messages go through on the client-side. You can just put script there to remember the last 10 or so messages.
__________________
Quote:
Reply With Quote
  #7  
Old 12-02-2012, 08:41 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Could always store the chat history in a txt file clientside and load on login and append on receive.
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 02:10 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.