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 11-15-2003, 01:55 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
Unhappy lunpa's problem of the week

w00t...
Is there a way to prioritize the drawing height of a showimg over another at the same screen layer? I mean, other than its x/y/z coordinate... unless there is a way to get, say, z to be the priority rather a y axis modifyer...

for example, lets say I use a polygon to blacken the screen. how can I make it so some stuff actualy draws over it, and still be in the middle of the screen?
__________________
Reply With Quote
  #2  
Old 11-15-2003, 02:14 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Other than drawing at a "higher" layer, no. At least nothing that I know of.
__________________
Kat
Reply With Quote
  #3  
Old 11-15-2003, 04:15 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Commands for layering, for level npcs:
NPC Code:

drawoverplayer;
drawunderplayer;
drawovertrees;


I have no idea what 'drawovertrees' does.

Commands for images, used in showimg, showtext, and showpoly:
NPC Code:

chageimgvis index,vis;


'vis' is a number between 0 and 5
0 and 1 = Under player
2 = Same height as player
3 = Over player
4 = On the screen, images will be drawn on the screen instead of the level, usefull for GUIs
5 = Same as vis 4, but is drawn over the images with a vis of 4.

Question:
Is it possoble to have a vis higher than 5? Such as changeimgvis 200,6;?
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #4  
Old 11-15-2003, 04:25 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally posted by ForgottenLegacy

Question:
Is it possoble to have a vis higher than 5? Such as changeimgvis 200,6;?
Yes.
Reply With Quote
  #5  
Old 11-15-2003, 04:30 AM
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
Lance is right.

But there is a limit I believe... max 20-30, or somewheres around there. I can't remember exact though.
Reply With Quote
  #6  
Old 11-15-2003, 04:56 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
huzzah! thats just what I was looking for. thanks again

Also, I have another small question...

Is there a way to convert keycode into its character value? or is it just a one-way conversion from char to keycode?
__________________
Reply With Quote
  #7  
Old 11-15-2003, 06:03 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by MrGannondorf
Is there a way to convert keycode into its character value? or is it just a one-way conversion from char to keycode?
#K(value)
__________________
Kat
Reply With Quote
  #8  
Old 11-15-2003, 08:07 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
before...
NPC Code:
if ((strtofloat(#p(0))>=65&&strtofloat(#p(0))<=90)||(  strtofloat(#p(0))>=321&&strtofloat(#p(0))<=346)) addstring client.lunpatexttestis,#p(0);



after...
NPC Code:
if ((strtofloat(#p(0))>=65&&strtofloat(#p(0))<=90)||(  strtofloat(#p(0))>=321&&strtofloat(#p(0))<=346)) addstring client.lunpatexttestis,#K(#p(0));



o.O Are you sure thats right? Now it won't return anythign...
__________________
Reply With Quote
  #9  
Old 11-15-2003, 08:18 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by MrGannondorf
after...
NPC Code:
if ((strtofloat(#p(0))>=65&&strtofloat(#p(0))<=90)||(  strtofloat(#p(0))>=321&&strtofloat(#p(0))<=346)) addstring client.lunpatexttestis,#K(#p(0));

#K(strtofloat(#p(0)));
__________________
Kat
Reply With Quote
  #10  
Old 11-15-2003, 09:00 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
or just #p(1) ?
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #11  
Old 11-15-2003, 09:20 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by Dach
or just #p(1) ?
Or not? #p(1) is a string, not a float value. The #K() code wants a float value.

Besides, when did he even mention #p(1)?
__________________
Kat
Reply With Quote
  #12  
Old 11-15-2003, 09:54 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by -Ramirez-

Or not? #p(1) is a string, not a float value. The #K() code wants a float value.

Besides, when did he even mention #p(1)?
You know what #p(1) returns, right?
__________________
Reply With Quote
  #13  
Old 11-15-2003, 10:03 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by Kaimetsu
You know what #p(1) returns, right?
Isn't it obvious that I know what it returns by what I last posted?
__________________
Kat
Reply With Quote
  #14  
Old 11-15-2003, 10:17 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally posted by -Ramirez-

Isn't it obvious that I know what it returns by what I last posted?
Not really. #K is unnecessary and out of the equation if you use #p(1). Think about it, dude.
Reply With Quote
  #15  
Old 11-15-2003, 10:19 AM
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
#p(1) is the parameter sent, and in this case, returns the key character when the event keypressed is called.
Reply With Quote
  #16  
Old 11-15-2003, 10:25 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by Lance
Not really. #K is unnecessary and out of the equation if you use #p(1). Think about it, dude.
Uh... what if the parameters were sent in ASCII code? In that case, #p(1) would be a NUMBER in string form, not the actual character. :/
__________________
Kat
Reply With Quote
  #17  
Old 11-15-2003, 10:33 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally posted by -Ramirez-

Uh... what if the parameters were sent in ASCII code? In that case, #p(1) would be a NUMBER in string form, not the actual character. :/
newfeatures2002.txt

Quote:
- new script functions to access the keyboard
- events:
keypressed - occurs when a standard key has been pressed; because
several keys can be pressed at the same time you get the
pressed key directly as a parameter to the script (like in
actionxxx event): #p(0) is the keycode, #p(1) the character
(when its standard key);
Reply With Quote
  #18  
Old 11-15-2003, 10:39 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Um, okay. Ramirez, it's clear that he's using the #p() codes as arguments from keypressed. In which case #p(0) holds the keycode (in string form) and #p(1) holds the ascii character to which it corresponds. So #p(1) is identical to #K(strtofloat(#p(0))).
__________________
Reply With Quote
  #19  
Old 11-15-2003, 10:51 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
It may be easy to ASSUME that's what he's using, but you still don't know that for certain until he verifies it himself.

Besides, you guys are going an extra step by saying it's unnecessary to use #K(). Sure, it may be if he's using keypressed, however, that is NOT what he asked for. He asked for a way to convert ASCII codes into actual characters, and I gave it to him. Then he put a string inside of the #K() code when it requires a float value. Instead of assuming it was for keypressed and not something else, I gave him the solution that worked in the way he was using it, rather than trying to change his script for him.

*sigh* *waits for the Argument Duo to continue on*
__________________
Kat
Reply With Quote
  #20  
Old 11-15-2003, 10:52 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally posted by Kaimetsu
So #p(1) is identical to #K(strtofloat(#p(0))).
Nah - the #K(strtofloat(#p(0))) method makes everything uppercase, and behaves differently when symbols (e.g. semicolon) are pressed.
Reply With Quote
  #21  
Old 11-15-2003, 12:39 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Lance
Nah - the #K(strtofloat(#p(0))) method makes everything uppercase, and behaves differently when symbols (e.g. semicolon) are pressed.
My fault, I should've been more explicit. They're identical in terms of the range of values in use here (ie: only letters). I dunno about the upper-case thing, I've never experimented with that. If it is true then Ramirez' solution is inadequate.

Quote:
Originally posted by -Ramirez-
It may be easy to ASSUME that's what he's using, but you still don't know that for certain until he verifies it himself.
Are there any other realistic explanations for him processing single-character params and filtering for letters, then appending one-by-one to a string?
__________________
Reply With Quote
  #22  
Old 11-15-2003, 07:05 PM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by Kaimetsu
My fault, I should've been more explicit. They're identical in terms of the range of values in use here (ie: only letters). I dunno about the upper-case thing, I've never experimented with that. If it is true then Ramirez' solution is inadequate.
That turns out to be true, but only because Graal is weird with keypressed. Instead of returning 65 to 90 for uppercase letters, and 97 to 122 for lowercase letters, it returns 65 to 90 for lowercase, and 321 to 346 for uppercase letters, strangely enough. It would seem extending beyond the normal 255 range just wraps around, like directions do.

...too bad all of this is still assuming it's for keypressed.


Quote:
Are there any other realistic explanations for him processing single-character params and filtering for letters, then appending one-by-one to a string? [/B]
Why does it have to be realistic? What says he's using some method that you would think of as being used the most? Who's to say he doesn't have some weird script triggeractioning the chat text of the player to another NPC? There's no reason to assume it's keypressed just because that's the most likely thing. He did not ask for his script to be optimized, he asked why #K(string) didn't work.
__________________
Kat
Reply With Quote
  #23  
Old 11-15-2003, 10:32 PM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
lol, I got what I needed.

I didn't realize that #p(1) returned the actual character of the pressed key

still its good to know that I have to convert #p(0) into ascii before it can be used in #K()

thanks again!
__________________
Reply With Quote
  #24  
Old 11-16-2003, 03:12 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by MrGannondorf
lol, I got what I needed.

I didn't realize that #p(1) returned the actual character of the pressed key

still its good to know that I have to convert #p(0) into ascii before it can be used in #K()

thanks again!
See? Now he TOLD US himself it was keypressed. In that case, #p(1) is better to use, as was already mentioned. Now you also know that #K() exists and that you can't use a string value in #K().
__________________
Kat
Reply With Quote
  #25  
Old 11-16-2003, 04:15 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
heh, anyway, I have a new question, wich would be, is there a serverside command to change the head of the rc?
and are there any events like 'rcchats' (an equivalent to playerchats) and posibly a message code to obtain the rc chat text?
__________________
Reply With Quote
  #26  
Old 11-16-2003, 04:43 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by MrGannondorf
heh, anyway, I have a new question, wich would be, is there a serverside command to change the head of the rc?
Yes. Use with () on the index of the person on RC and use setplayerprop to change the head image.

Quote:
and are there any events like 'rcchats' (an equivalent to playerchats) and posibly a message code to obtain the rc chat text?
The only one I'm aware of is the "rcchat" event. This is triggered when someone on RC uses the command /npcText params. #p(0) is "Text", and #p(1) and up are the parameters. I might be wrong about that, but I'm pretty sure I'm not. Oh... and I also believe it can only be used in the Control NPC.
__________________
Kat
Reply With Quote
  #27  
Old 11-16-2003, 06:56 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
I'll try it out. thanx!

oh, and for some reason I can't open the script of one of my weapons. Could it be that its gotten too long? Its one of my longer scripts
__________________
Reply With Quote
  #28  
Old 11-16-2003, 07:45 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by MrGannondorf
oh, and for some reason I can't open the script of one of my weapons. Could it be that its gotten too long? Its one of my longer scripts
When our server flags on Classic get too long, we can't view them. So that could very well be what's happening there, though I've never had it happen to myself.
__________________
Kat
Reply With Quote
  #29  
Old 11-16-2003, 08:01 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
oo, any idea how I can retrieve the script?
__________________
Reply With Quote
  #30  
Old 11-16-2003, 09:12 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by MrGannondorf
oo, any idea how I can retrieve the script?
I don't know how you would, but maybe someone else will. I know classes are stored in scripts\, but I have no idea if weapons are stored somewhere like that as well.
__________________
Kat
Reply With Quote
  #31  
Old 11-16-2003, 09:15 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
yah, since classes are, I'd say its only logical that the weapons are. I dug through the ftp the best I could, but to no luck.
Say... could someone with a different kind of access to the ftp (like a different program or something) posibly retrieve it? I know that to have a larger tileset put on the server, you need stefan to upload it. Maby he can help? (so, now I have to figure out the best way to contact him...)
__________________
Reply With Quote
  #32  
Old 11-16-2003, 09:16 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
I don't really get why everyone is so... interested in changing the RC head, it's an administrative tool, not a play tool ;(
Reply With Quote
  #33  
Old 11-16-2003, 09:28 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by MrGannondorf
(so, now I have to figure out the best way to contact him...)
Forum PMs usually work.
__________________
Kat
Reply With Quote
  #34  
Old 11-16-2003, 09:34 AM
MrGannondorf MrGannondorf is offline
Teh Lunpa
Join Date: Apr 2002
Location: usa, alas
Posts: 395
MrGannondorf is on a distinguished road
Send a message via AIM to MrGannondorf
thanx, Ramirez, I'll try that.

as for Python
Quote:
I don't really get why everyone is so... interested in changing the RC head, it's an administrative tool, not a play tool ;(
You have an intresting point, but you're making it sound as if graal itself is not a play thing.
__________________
Reply With Quote
  #35  
Old 11-16-2003, 09:55 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by -Ramirez-
Why does it have to be realistic?
Our objective in this matter is to provide him with the help he needs in solving his problem. You'll note that he never specified that he was working in GScript, so you were wrong to suggest that he use #K! Wrong! Foolish! Assumptions!

We deduce that he is using keypressed, because of the overwhelming evidence pointing in that direction. As it turns out, we're right. Wasn't this path more productive, then?
__________________
Reply With Quote
  #36  
Old 11-16-2003, 10:27 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
We deduce that he is using keypressed, because of the overwhelming evidence pointing in that direction. As it turns out, we're right. Wasn't this path more productive, then?
Is arguing about this being productive?


I have no intention of posting again in regard to this "debate" or whatever you want to call it, as it's completely pointless. I would hope that you would do the same. It's only making us both look like idiots for continuing on mindlessly.
__________________
Kat
Reply With Quote
  #37  
Old 11-16-2003, 10:41 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by -Ramirez-
Is arguing about this being productive?
Is it supposed to be?

Quote:
I have no intention of posting again in regard to this "debate" or whatever you want to call it, as it's completely pointless. I would hope that you would do the same.
Debate is only pointless if you do not gain anything from it.
__________________
Reply With Quote
  #38  
Old 11-16-2003, 11:29 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Btw, lunpa, Gannondorf, whatever you prefer to be called, I want to apologize for going on with the stupid argument as long as I did. You shouldn't have to read through that garbage to find what you're looking for.

Anyway, you got your answers, so I guess that's all that matters.
__________________
Kat
Reply With Quote
  #39  
Old 11-16-2003, 12:19 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by -Ramirez-
I want to apologize for going on with the stupid argument as long as I did. You shouldn't have to read through that garbage to find what you're looking for.
Get off the high horse, man. You were the source of all this, through your failure to identify his problem and inability to accept your mistake.
__________________
Reply With Quote
  #40  
Old 11-16-2003, 08:54 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by MrGannondorf
thanx, Ramirez, I'll try that.

as for Python


You have an intresting point, but you're making it sound as if graal itself is not a play thing.
I'm still trying to figure out how you can conclude that I made it sound like graal isn't a play thing when all I said is an administrative tool shouldn't have the ability to change their head.
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 04:06 PM.


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