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 09-16-2006, 03:01 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
keyDown check?

Hi,

i made a TDrawingPanel(in the TDrawingPanel there a GUIWindowCtrl that goes all over the screen and is on the top,
for some reason the keydown check ( onKeyPressed, keyDown2 ) doesnt work anymore now XD
how do i make em working again?
Reply With Quote
  #2  
Old 09-16-2006, 04:00 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
PHP Code:
GraalControl.makeFirstResponder(); 
I think.
__________________
Skyld
Reply With Quote
  #3  
Old 09-16-2006, 05:11 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
doesnt work =/
when i make ()
it says
Quote:
GraalScript: Not enough parameters for makefirstresponder (1 needed, 0 given) in script of Weapon projectigi/mapeditor
and when i give a bool(be it true or false) it doesnt work too ~.~
Reply With Quote
  #4  
Old 09-16-2006, 06:45 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Should be:

PHP Code:
GraalControl.makefirstresponder(true); 
Reply With Quote
  #5  
Old 09-16-2006, 08:58 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 projectigi
Hi,

i made a TDrawingPanel(in the TDrawingPanel there a GUIWindowCtrl that goes all over the screen and is on the top,
for some reason the keydown check ( onKeyPressed, keyDown2 ) doesnt work anymore now XD
how do i make em working again?
Example:

PHP Code:
function onCreated()
{
  new 
GuiWindowCtrl("MainWindow") {
     
// stuff
  
}
  
MainWindow.makeFirstResponder("false");

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 09-16-2006, 09:40 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
doesnt work :<
Reply With Quote
  #7  
Old 09-16-2006, 10:04 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
Works for me..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 09-16-2006, 10:13 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
and doesnt for me <.<
Reply With Quote
  #9  
Old 09-16-2006, 10:26 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
Maybe if you posted parts of the script so that we could try and see whats wrong?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #10  
Old 09-16-2006, 10:50 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
nvm, does work now :P
Reply With Quote
  #11  
Old 09-16-2006, 11:07 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
is there a workaround for loop limit exceeded?
Reply With Quote
  #12  
Old 09-16-2006, 11:17 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 projectigi
is there a workaround for loop limit exceeded?
Make your loop smaller.
__________________
Skyld
Reply With Quote
  #13  
Old 09-16-2006, 11:28 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
how would i fill a [255][255] array then
Reply With Quote
  #14  
Old 09-18-2006, 03:01 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Post your current loop that gets exceeded.. I'll see wut I can do.
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #15  
Old 09-18-2006, 04:13 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
NPC Code:

for( this.dy = 0; this.dy < 128; this.i1++ )
{
for( this.dx = 0; this.dx < 128; this.dx++ )
{
this.map[ this.dx ][ this.dy ] = int( random( 1, 3.99 ));
}
}


thats my loop :P
Reply With Quote
  #16  
Old 09-18-2006, 04:17 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Quote:
Originally Posted by projectigi
PHP Code:
// I am bad, I use code tags.
for( this.dy 0this.dy 128this.i1++ ) // this.i1++? this.dy ++ you mean
  
{
  for( 
this.dx 0this.dx 128this.dx++ )
    {
    
this.mapthis.dx ][ this.dy ] = intrandom13.99 ));
    }
  } 
thats my loop :P
Try this tho, I more like it that way;
PHP Code:
for ( 0128 2++) {
  
this.dx 128;
  
this.dy int128);
  
this.mapthis.dx][ this.dy] = intrandom13.99));

Tho it won't work, since 128 ^ 2 > 10.000, and will exceed the loop limit

And make sure this.map is created already as an array.
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #17  
Old 09-18-2006, 04:59 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
is there a fps counter in graal?
Reply With Quote
  #18  
Old 09-18-2006, 05:17 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Frames Per Second? Not that I know off.
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #19  
Old 09-18-2006, 07:07 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
One could do:
PHP Code:
temp.keys "";
 for (
temp.i=0;temp.i<128;temp.i++) temp.keys.add(temp.i);

 for (
temp.i=0;temp.i<128;temp.i++) {
   
temp.key int(random(0,128-.001));
   
this.map[temp.i][temp.key] = int(random(0,3.99));
   
temp.keys.delete(temp.key);
 } 
__________________
◕‿‿◕ · 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
  #20  
Old 09-18-2006, 07:45 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Quote:
Originally Posted by Tolnaftate2004
One could do:
PHP Code:
temp.keys "";
 for (
temp.i=0;temp.i<128;temp.i++) temp.keys.add(temp.i);

 for (
temp.i=0;temp.i<128;temp.i++) {
   
temp.key int(random(0,128-.001));
   
this.map[temp.i][temp.key] = int(random(0,3.99));
   
temp.keys.delete(temp.key);
 } 
Uhh.. that's not gonna work I think (For what he wants it to do).
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #21  
Old 09-18-2006, 08:00 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
Quote:
Originally Posted by contiga
Uhh.. that's not gonna work I think (For what he wants it to do).
Just realized, you are right, my mistake.
__________________
◕‿‿◕ · 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
  #22  
Old 09-18-2006, 08:52 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally Posted by projectigi
NPC Code:

for( this.dy = 0; this.dy < 128; this.i1++ )
{
for( this.dx = 0; this.dx < 128; this.dx++ )
{
this.map[ this.dx ][ this.dy ] = int( random( 1, 3.99 ));
}
}


thats my loop :P
NPC Code:
for( this.dy = 0; this.dy < 128; this.i1++ )



You are adding this.i1 instead of this.dy, which I assume you meant to do. That is going to cause an infinite loop.
__________________

Reply With Quote
  #23  
Old 09-18-2006, 10:27 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
yeah forgot to change this :P
still the loop won't work for 500x500 map arrays
how is the loop limit calculated? is it just like at the end of every loop you do this.foobar++; and when this.foobar>=10000 echo("blub... limit exceeded..."); break;
or something like this?

Last edited by projectigi; 09-18-2006 at 10:44 PM..
Reply With Quote
  #24  
Old 09-18-2006, 11:44 PM
Tyrial Tyrial is offline
The Shiznic
Join Date: Dec 2001
Location: Sweden > Stockholm
Posts: 2,411
Tyrial is an unknown quantity at this point
Is there no builtin command that values the length of a <something>?

Like in Java, you can use Integer.MAX_VALUE or such.. Perhaps this.MAX_VALUE? Don't know.. try.
__________________
-Mher Avetian
Reply With Quote
  #25  
Old 09-19-2006, 10:45 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
huh?
contiga: what code tags?

Last edited by projectigi; 09-19-2006 at 11:02 PM.. Reason: added
Reply With Quote
  #26  
Old 09-20-2006, 12:21 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Tyrial View Post
Is there no builtin command that values the length of a <something>?

Like in Java, you can use Integer.MAX_VALUE or such.. Perhaps this.MAX_VALUE? Don't know.. try.
like this.blah.length();?
Reply With Quote
  #27  
Old 09-20-2006, 09:03 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
Quote:
Originally Posted by Tyrial View Post
Is there no builtin command that values the length of a <something>?

Like in Java, you can use Integer.MAX_VALUE or such.. Perhaps this.MAX_VALUE? Don't know.. try.
If you mean is there a way to find out the maximum value of a specific type of data (like you might do sizeof(int) in C), then no, there isn't such a thing in GScript.

If you are just looking for the length of the current data, then yes, obj.length() is correct.
Reply With Quote
  #28  
Old 09-20-2006, 02:43 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Quote:
Originally Posted by projectigi View Post
huh?
contiga: what code tags?
NPC Code:
function blabla()
// foo



PHP Code:
function blabla()
  
// foo 
I more like the PHP tags instead of the CODE tags, it's easier to read scripts with the hightlighting.. Btw, my highlighting in RC doesn't work no more! (As I posted in bug thread or so), someone knows why?
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
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 06:04 AM.


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