Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 01-22-2008, 07:32 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
What he needs to do is get the angle of the line, then draw the points half of thickness 90 degree's out to each side.
Reply With Quote
  #17  
Old 01-22-2008, 09:46 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004 Send a message via Skype™ to Tolnaftate2004
Quote:
Originally Posted by Inverness View Post
showimg() = GS1 >
As far as I'm concerned considering the way you can use findimg(), I consider showimg() to just be a remnant of GS1 existing for compatibility.
This is an awful way to think of it. showimg() is decidedly a function with a return value; it was not so in GS1.

It seems superfluous to me to use the with-findimg construct for (essentially) static images.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/

Last edited by Tolnaftate2004; 01-22-2008 at 10:01 PM..
Reply With Quote
  #18  
Old 01-22-2008, 10:47 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
Quote:
Originally Posted by DustyPorViva View Post
What he needs to do is get the angle of the line, then draw the points half of thickness 90 degree's out to each side.
yeah :o

well, getangle(xy1[0]-xy2[0], xy1[1]-xy2[1]); would do that, but, I haven't got to work on this little function as much, because I've been busy with other stuff
__________________
Reply With Quote
  #19  
Old 01-22-2008, 10:55 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
showimg() being GS1? Try to use findimg() serverside.
__________________
Reply With Quote
  #20  
Old 01-22-2008, 11:36 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
findimg() is listed in the serverside script functions.

I always use findimg() now because I don't want to alternate between two days of doing the same thing. findimg() works for the simple and the complex and is much more readable.
Quote:
Originally Posted by Tolnaftate2004 View Post
showimg() is decidedly a function with a return value; it was not so in GS1.
There would have been no point for it returning an object in GS1. Also making it return the image object in GS2 was a good move.

So theres now 3 ways to do the same thing:
Graal Script Code:
// GS1
showimg(1"light3.png"3.53);
changeimgcolor(110.400);
changeimgvis(13);
// Half GS2
with (showimg(1"light3.png"3.53)) {
  
red 1;
  
green 0.4;
  
blue 0;
  
alpha 0;
  
layer 3;
}
// Full GS2
with (findimg(1)) {
  
image "light3.png";
  
thiso.3.5;
  
thiso.3;
  
red 1;
  
green 0.4;
  
blue 0;
  
alpha 0;
  
layer 3;

__________________
Reply With Quote
  #21  
Old 01-23-2008, 01:06 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 Inverness View Post
code which says that things are gs1, half-gs2, and gs2]
How can you say GS1, half-GS2, and GS2? It's personal preference!

GS1 is

Graal Script Code:
showimg 200block.png1030
Half-GS2 is

Graal Script Code:
showimg 200block.png1030;
changeimgvis20020 ); 
GS2 is

Graal Script Code:
showimg200"block.png"1030 ); 
Just because something else was added does not mean previous functions were deprecated (though it may well be).
__________________
Reply With Quote
  #22  
Old 01-23-2008, 01:44 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by cbkbud View Post
<snip>
Okay, you're not understanding my point of view and I don't feel like explaining so lets just drop it.
__________________
Reply With Quote
  #23  
Old 01-23-2008, 02:35 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Invern is right, showImg(); was made just for compatibility with showimg; GS2 is technically not related to GS1. You should use findImg, it is more object oriented than showImg;
__________________
Deep into the Darkness peering...
Reply With Quote
  #24  
Old 01-23-2008, 03:00 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 Inverness View Post
Okay, you're not understanding my point of view and I don't feel like explaining so lets just drop it.
works4me
__________________
Reply With Quote
  #25  
Old 01-23-2008, 06:38 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by coreys View Post
I think Graal should have brush functionality much like C#. ;(
There is the GuiDrawingPanel. It will soon be possible to also draw text and lines into that and may be used with showimgs.
Reply With Quote
  #26  
Old 01-23-2008, 07:07 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
Quote:
Originally Posted by Admins View Post
There is the GuiDrawingPanel. It will soon be possible to also draw text and lines into that and may be used with showimgs.
Nice
__________________
Reply With Quote
  #27  
Old 01-23-2008, 07:51 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004 Send a message via Skype™ to Tolnaftate2004
Quote:
Originally Posted by Angel_Light View Post
Invern is right, showImg(); was made just for compatibility with showimg;
No, there never existed anything called showimg(); in GS1; showimg; was retained for backwards compatibility.
Quote:
You should use findImg, it is more object oriented than showImg;
No, these two functions return the same thing. You can't say one is more OO than the other.

But showimg involves no lookup.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #28  
Old 01-23-2008, 08:14 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Inverness View Post
findimg() is listed in the serverside script functions.
Never got findimg() to work serverside when I would want to display text.
__________________
Reply With Quote
  #29  
Old 01-23-2008, 11:43 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
I seem to recall showtext working clientside only back in the GS1 days.
Quote:
Originally Posted by Tolnaftate2004 View Post
No, there never existed anything called showimg(); in GS1; showimg; was retained for backwards compatibility.

No, these two functions return the same thing. You can't say one is more OO than the other.

But showimg involves no lookup.
Of course there was no showimg() in GS1 as that is a GS2 function equivalent. When the scripting engine reads GS1 script I'm pretty damn sure its just executing the GS2 equivalent of the function which would be showimg().

And how do you mean that showimg() involves no lookup?
__________________
Reply With Quote
  #30  
Old 01-24-2008, 12:28 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
showimg is a fine function. I personally do something like
this.whatevz = showimg(whatevz);
then generally reference the variable when i want to change anything
this.whatevz.red = rad;
__________________
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:28 AM.


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