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 05-11-2007, 05:20 PM
doomboy00 doomboy00 is offline
Registered User
doomboy00's Avatar
Join Date: Jan 2004
Posts: 45
doomboy00 is on a distinguished road
Dynamic Framesets?

I've recently been playing around with gui's and came across something that no matter how much trial and error i attempt i cannot get this to work.

Basically it's a gui with a dynamic number of tabs depending on a string being set. With a pane for each of these tabs, but for the life of me I cannot get the pane to show.

Any help would be greatly appreciated:

NPC Code:

function onSetup()
{
new GuiWindowCtrl("testWindow")
{
profile = "GuiBlueWindowProfile";
useownprofile = true;
extent = "400 600";
position = "30 30";
text = "testWindow";
destroyonhide = false;
canmaximize = false;
canresize = false;

new GuiTextCtrl("testTitle")
{
profile = "GuiBlueTextProfile";
useownprofile = true;
position = "120 25";
profile.fontsize = 20;
profile.fontcolor = {255,255,255};
profile.fontType = "Verdana";
text = "Dynamic Tabbing";
}

frameInd=1;
while(clientr.("imgstore"@frameInd))
{
new GuiFrameSetCtrl("mainFrame"@frameInd)
{
position = "20 80";
extent = "350 400";
rowcount = 5;
columncount = 4;
visible=false;
bordermovable="alwaysOff";
totalcount = rowcount*columncount;

for(imgInd=0;imgInd<totalcount;imgInd++)
{
new GuiControl("imgBox"@imgInd)
{
profile = "GuiBlueScrollProfile";
useownprofile = true;
hscrollbar = "dynamic";
vscrollbar = "dynamic";

new GuiShowImgCtrl("img"@imgInd)
{
position = "15 10";
extent = "48 48";
image = clientr.("imgstore"@frameInd)[imgInd]@".png";
offsetx = "-96";
thiso.catchevent(name,"onMouseDown","onImgSelect") ;
}
}
}
frameInd++;
}
}

new GuiTabCtrl("testTab")
{
profile = "GuiBlueTabProfile";
useownprofile = true;
position = "20 60";
extent = "380 20";
tabwidth = "70";

clearrows();
tabInd=1;
while(clientr.("imgstore"@tabInd))
{
with(addrow(tabInd-1,"Set " @tabInd))
{
this.pane="mainFrame"@tabInd;
}
tabInd++;
}

thiso.catchevent(name, "onSelect", "onTabSelect");
}
}
testTab.setSelectedById(0);
graalControl.addControl(testWindow);
}

function onTabSelect(tabs)
{
tabs.selected.pane.show();
}

Reply With Quote
  #2  
Old 05-11-2007, 06:33 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
hmm easier to do
HTML Code:
//Do the basic row thing stuff here

temp.itemAmount = getstringkeys("clientr.imgstore").size();
for (temp.currentItem: temp.itemAmount)
{
  addrow(w/e here, true);
}
Hope this helps!
Reply With Quote
  #3  
Old 05-11-2007, 06:37 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chandler View Post
HTML Code:
//Do the basic row thing stuff here

temp.itemAmount = getstringkeys("clientr.imgstore").size();
for (temp.currentItem: temp.itemAmount)
{
  addrow(w/e here, true);
}
Why do you do:

PHP Code:
for (temp.currentItemtemp.itemAmount)
{
  
addrow(w/e heretrue);

when this is the exact same thing?

PHP Code:
for (currentItemtemp.itemAmount)
{
  
addrow(w/e heretrue);

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 05-11-2007, 06:43 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Why would you want to keep the VARIABLE data?
Here:
HTML Code:
function onCreated()
{
  temp.myList = {"hey", "hi", "lol"};
  for (currentItem: temp.myList)
    echo(currentItem);
  echo(currentItem);
  scheduleevent(3, "Repeat", "");
}
function onRepeat()
{
  echo(currentItem);
}
using temp. prefix's won't STORE the VARIABLE data.
Reply With Quote
  #5  
Old 05-11-2007, 06:47 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chandler View Post
Why would you want to keep the VARIABLE data?
Here:
HTML Code:
function onCreated()
{
  temp.myList = {"hey", "hi", "lol"};
  for (currentItem: temp.myList)
    echo(currentItem);
  echo(currentItem);
  scheduleevent(3, "Repeat", "");
}
function onRepeat()
{
  echo(currentItem);
}
using temp. prefix's won't STORE the VARIABLE data.
You obviously don't know how those kind of loops work.

temp.str is set (temporary variable)
PHP Code:
for (temp.strthis.strlist) { ... } 
When not using a prefix in these kind of loops, a TEMP. variable is set.
PHP Code:
for (strthis.strlist) { ... } 
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 05-11-2007, 06:47 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by xXziroXx View Post
When not using a prefix in these kind of loops, a TEMP. variable is set.
PHP Code:
for (strthis.strlist) { ... } 
Balls, you speak lies.

You obviously don't know gscript two.

Try the script that I posted.
Reply With Quote
  #7  
Old 05-11-2007, 06:49 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chandler View Post
Balls, you speak lies.
Yeah, sure.. Whatever you say. That's the way they work though, perhaps you should try if your script works before you post it.



PHP Code:
function onCreated()
{
  
temp.myList = {"hey""hi""lol"};
  for (
currentItemtemp.myList)
    echo(
currentItem);
  echo(
currentItem);
  
scheduleevent(3"Repeat""");
}
function 
onRepeat()
{
  echo(
currentItem);

When onRepeat() is called, it will echo absolutely nothing!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 05-11-2007, 06:51 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Ok, I've lost alot of respect for you.
Reply With Quote
  #9  
Old 05-11-2007, 06:54 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chandler View Post
Ok, I've lost alot of respect for you.
You're a script idiot. Idiot scripter.
Whatever man. It's not like I like you anyways.

Just don't say anything when someone more "respected" tell you how they work.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #10  
Old 05-11-2007, 06:56 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Did you even try the script?
Reply With Quote
  #11  
Old 05-11-2007, 07:10 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
No, I didn't, and.. Oh bugger. Guess I'll have to apologize for being narrow sighted. I just realized that I'm bull****ting myself. Of course it's not cleared afterwards. Don't know why I was thinking it would, must've confused myself there.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #12  
Old 05-12-2007, 01:21 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Chandler: When you specify a variable without a prefix that isn't an existing variable of the current object, it automatically gets headed with "temp."

If it DOES exist on the current object, it automatically gets headed with "this."
You can't just have random variables floating around with no heading...Graal will automatically assign every variable to some object or another (with the assumption that "temp" is an object in this case)
__________________
Do it with a DON!
Reply With Quote
  #13  
Old 05-12-2007, 07:36 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
It's still setting it to the object, which can be called from a different function too. To me, that isn't a TEMP. prefix.
Reply With Quote
  #14  
Old 05-12-2007, 02:31 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
What would be the point of a variable without a prefix? I always use temp.i, except for params, and that's just from habit. If you needed something that was global on the client, client. variables (clientside). If you want something global to the NPC, this./thiso., if you want something global on the server, server. or serverr.

Someone care to explain what it is used for?
__________________
Reply With Quote
  #15  
Old 05-12-2007, 06:20 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Explain what?
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 10:21 AM.


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