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 08-08-2007, 09:41 PM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Gui problem...

Ok, I am having problems with the gui tree ctrl.
I want to set an icon, but it wont let me...
I changed icon size to 32x32, and tried everything to set an icon. ><
How do you do it? x.x
Reply With Quote
  #2  
Old 08-08-2007, 11:56 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
with (addnodebypath("Parent/Child","/")) {
  
image selectedimage 2;

Something like that
__________________
Reply With Quote
  #3  
Old 08-09-2007, 12:11 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
But that just makes the image the txt document image thing...
And that doesnt work when you resize the icons anyway.
I need to make the image my own icon,. -.-
Reply With Quote
  #4  
Old 08-09-2007, 12:16 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
tried stuff like image = "bomb.png";?
__________________
Reply With Quote
  #5  
Old 08-09-2007, 12:34 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Yes, and it does not work.
Reply With Quote
  #6  
Old 08-09-2007, 12:40 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
closest stuff I could find was:

http://wiki.graal.net/index.php/Crea...uiTreeViewNode

so.. tried icon = "bomb.png";?
for example
PHP Code:
with (addnodebypath("Parent/Child","/")) {
  
icon "bomb.png";

If it doesn't help, I'm out of ideas
__________________
Reply With Quote
  #7  
Old 08-09-2007, 12:55 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Thanks for trying, but still no. x.x
Reply With Quote
  #8  
Old 08-09-2007, 02:39 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
The .icon is a TDrawingPanel I think; you might need to use something like:
PHP Code:
icon.drawimagerectangle(); 
There is info on the wiki about TDrawingPanels and their functions.
__________________
Skyld
Reply With Quote
  #9  
Old 08-09-2007, 04:10 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
Yes, first do seticonsize(w, h);
Then the icon variable is actually a TDrawingPanel object that you can use various functions such as:
  • icon.drawimage(int x, int y, str imagefilename)
  • icon.drawimagerectangle(int x, int y, str imagefilename, int sourcex, int sourcey, int sourcewidth, int sourceheight)
  • icon.drawimagestretched(int x, int y, int width, int height, str imagefilename, int sourcex, int sourcey, int sourcewidth, int sourceheight)

Here's an example:
NPC Code:
new GuiTreeViewCtrl("mytree") {
resize(0, 0, 50, 100); // sets x, y, w and h
seticonsize(32, 32);
clearnodes();
with (addnode("Category A")) {
icon.drawimagestretched(0, 0, 32, 32, "block.png", 0, 0, 32, 32);
with (addnode("Item A")) {
icon.drawimagestretched(0, 0, 32, 32, "head0.png", 0, 0, 32, 64);
}
with (addnode("Item B")) {
icon.drawimagestretched(0, 0, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
icon.drawimagestretched(16, 0, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
icon.drawimagestretched(16, 16, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
icon.drawimagestretched(0, 16, 16, 16, "bcalarmclock.png", 0, 0, 32, 32);
}
}
}

__________________
Do it with a DON!
Reply With Quote
  #10  
Old 08-09-2007, 11:27 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Then I was.. almost right ;O
__________________
Reply With Quote
  #11  
Old 08-10-2007, 04:07 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Ok, now I need some more help. lol
It has to do with guis also...
Ok, I have a gui scroll ctrl with text inside it.
Now, as the player chats, the text adds line to what the player is saying.
When the text reaches the bottom of the scroll box, I need the scroll to go to the bottom.
Currently, it hides 1 line...
Say, its starting to stretch the scroll, and you say 'Test'. It will not show up, cause its hidden.
Then you say 'Test2', and 'Test' will show up and 'Test2' will be hidden...
I currently have the script set to this
texth1.scrollto(0, text123.height);
So, what ese can I do so it doesnt hide that 1 line?
Reply With Quote
  #12  
Old 08-10-2007, 08:39 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
I told you this in your IM but you ignored me:

If it is a GuiMLTextCtrl that is inside the GuiScrollCtrl you can simple call the function scrolltobottom() for the GuiMLTextCtrl.

Also, I see chat history systems are becoming quite the fad ever since i made my first version on Maloria v3. ^_^
__________________
Do it with a DON!
Reply With Quote
  #13  
Old 08-10-2007, 12:03 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 zokemon View Post
I told you this in your IM but you ignored me:

If it is a GuiMLTextCtrl that is inside the GuiScrollCtrl you can simple call the function scrolltobottom() for the GuiMLTextCtrl.

Also, I see chat history systems are becoming quite the fad ever since i made my first version on Maloria v3. ^_^
I hope you are aware of that I made my version on Mythic way before you did yours on v3? And I bet someone made one before me.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #14  
Old 08-10-2007, 01:09 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by xXziroXx View Post
I hope you are aware of that I made my version on Mythic way before you did yours on v3? And I bet someone made one before me.
Pretty sure Thamhic had it way before as well. Possibly before Mythic.
Reply With Quote
  #15  
Old 08-10-2007, 01:36 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 Twinny View Post
Pretty sure Thamhic had it way before as well. Possibly before Mythic.
I dont think Thamic existed over a year ago, or?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #16  
Old 08-10-2007, 01:41 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by xXziroXx View Post
I hope you are aware of that I made my version on Mythic way before you did yours on v3? And I bet someone made one before me.
A chat system was one of the first things I prototyped when Rudora had GScript2-enabled back in the Graal 3 days, and that was quite some time before any of this.
__________________
Skyld
Reply With Quote
  #17  
Old 08-10-2007, 01:55 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by xXziroXx View Post
I dont think Thamic existed over a year ago, or?
http://forums.graalonline.com/forums...hlight=Thamhic

That's just the release. The server may have been up alot longer before that.
Reply With Quote
  #18  
Old 08-10-2007, 02:58 PM
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
I was more referring to an improved version of the ChatBar object and chat of the player's head type of system but meh, I'll stand corrected to avoid pointless arguing.
__________________
Do it with a DON!
Reply With Quote
  #19  
Old 08-10-2007, 03:51 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


<3 Zero, Skyld, Twinny
__________________
Follow my work on social media post-Graal:Updated august 2025.
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 11:12 PM.


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