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 09-06-2004, 08:59 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
downloadsize

How come downloadsize it returning zero everytime? simple test will prove it does

if(created||timeout){
setplayerprop #c, #D #v(downloadpos) / #v(downloadsize);
timeout = .05;
}

Notice the var downloadsize comes up 0
__________________

Reply With Quote
  #2  
Old 09-06-2004, 10:10 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
If there is no current download, the variable will become 0, are you running the script client-side? I may be wrong but I think it doesn't work server-side.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /

Last edited by osrs; 09-06-2004 at 10:34 PM..
Reply With Quote
  #3  
Old 09-06-2004, 11:41 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
yea its clientside, and #D work as such

#D,#D(filename)

The player chat i got was this

filename.png 32000 / 0
this script returned this to RC :
NPC Code:

if(actionserverside)
sendtonc Downloading:#p(0) #p(1) / #p(2);
//#CLIENTSIDE
if(created||timeout){
timeout=.5;
triggeraction 0,0,serverside,Sern,#D,#v(downloadpos),#v(download size),;
}



Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 256000 / 0
Downloading:bravo_tileset.png 256000 / 0
__________________


Last edited by ZeroTrack; 09-06-2004 at 11:52 PM..
Reply With Quote
  #4  
Old 09-07-2004, 12:04 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Your script is pretty insecure, you don't really need to use sendtonc and even inside a timeout loop.
It is returning 0, because of this:

triggeraction 0,0,serverside,Sern,#D,#v(downloadpos),#v(download size),;

The name of the variable is downloadsize, and you used space.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #5  
Old 09-07-2004, 12:11 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
no i didnt the fourm made it that way for some reason, which leads me to believe that the gserver is doing it too, and the sendtonc is for debuging
__________________

Reply With Quote
  #6  
Old 09-07-2004, 01:55 AM
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
Maybe you should try:
sendtonc Downloading:#p(0) #p(1) / #v(downloadsize);

It may just be that the client doesn't know how large the file is because it has yet to download?
Reply With Quote
  #7  
Old 09-07-2004, 02:06 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Tolnaftate2004
Maybe you should try:
sendtonc Downloading:#p(0) #p(1) / #v(downloadsize);

It may just be that the client doesn't know how large the file is because it has yet to download?
hmm no that didnt work but that shouldnt matter cause the newfeatures doc states

-new scripting variable 'downloadsize': when the
graal client is currently downloading a big file
(>32k) then this variable contains the size of the
file
__________________

Reply With Quote
  #8  
Old 09-07-2004, 03:34 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Has anyone figured out this problem yet?
__________________

Reply With Quote
  #9  
Old 09-16-2004, 10:19 PM
Tseng2 Tseng2 is offline
Lance
Tseng2's Avatar
Join Date: Sep 2004
Location: California, USA.
Posts: 4
Tseng2 is on a distinguished road
Quote:
Originally Posted by ZeroTrack
no i didnt the fourm made it that way for some reason, which leads me to believe that the gserver is doing it too, and the sendtonc is for debuging
You put a space in there - the forum does not insert spaces there, and the supposition that the server does so is laughable. Use the proper variable if you wish the proper result. If you still have a problem, post your revised code and we will have a look at it.
__________________
Reply With Quote
  #10  
Old 09-17-2004, 01:36 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by ZeroTrack
yea its clientside, and #D work as such

#D,#D(filename)

The player chat i got was this

filename.png 32000 / 0
this script returned this to RC :
NPC Code:

if(actionserverside)
sendtonc Downloading:#p(0) #p(1) / #p(2);
//#CLIENTSIDE
if(created||timeout){
timeout=.5;
triggeraction 0,0,serverside,Sern,#D,#v(downloadpos),#v(download size),;
}



Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 256000 / 0
Downloading:bravo_tileset.png 256000 / 0
I tried that with #v(downloadsize) instead of #v(download size) and got the same thing.

Bug perhaps?
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #11  
Old 09-17-2004, 01:59 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Tseng2
You put a space in there - the forum does not insert spaces there, and the supposition that the server does so is laughable. Use the proper variable if you wish the proper result. If you still have a problem, post your revised code and we will have a look at it.
LANCE! post the code your-self without a space and watch what happens , i know what im doing i wouldnt put a space there, if you dont know the awnser then dont comment, please try posting the code youself then you'll see so you can put that foot back in your mouth

and BTW! read the first post here i did without using the code tags, ... oh whats that ?? its not spaced? oh loookk at thatt
__________________

Reply With Quote
  #12  
Old 09-17-2004, 02:02 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Geez, he is trying to help, don't be so rude.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #13  
Old 09-17-2004, 02:28 PM
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
NPC Code:

message #v(downloadsize);



Edit: works?
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #14  
Old 09-17-2004, 06:02 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
na i tired that too returns 0 still
__________________

Reply With Quote
  #15  
Old 09-17-2004, 07:12 PM
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
Quote:
Originally Posted by ZeroTrack
na i tired that too returns 0 still
I was reffering to the forums

huh, it seems to work fine in v3, but not 2
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #16  
Old 09-17-2004, 07:59 PM
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 osrs
Geez, he is trying to help, don't be so rude.
I'm not being rude - I'm pointing out when someone else is incorrectly blaming someone or something else for something they did themselves.

The first thing for one to do when they have a problem should not be to say "There's something wrong with the system." but instead, ask yourself "What could I possibly be doing wrong?"
Reply With Quote
  #17  
Old 09-17-2004, 09:32 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Lance
I'm not being rude - I'm pointing out when someone else is incorrectly blaming someone or something else for something they did themselves.

The first thing for one to do when they have a problem should not be to say "There's something wrong with the system." but instead, ask yourself "What could I possibly be doing wrong?"
I should have quoted, but I was talking to Sern.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #18  
Old 09-18-2004, 04:40 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Dach
I was reffering to the forums

huh, it seems to work fine in v3, but not 2
Why is that....
__________________

Reply With Quote
  #19  
Old 09-18-2004, 08:20 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
Quote:
Originally Posted by ZeroTrack
How come downloadsize it returning zero everytime? simple test will prove it does

if(created||timeout){
setplayerprop #c, #D #v(downloadpos) / #v(downloadsize);
timeout = .05;
}

Notice the var downloadsize comes up 0
NPC Code:
//#CLIENTSIDE
if (created || timeout) {
if (strlen(#D)>0) {
setplayerprop #c,#D;
showtext 201,1,1,comic sans ms,,#D;
changeimgvis 201,8;
changeimgzoom 201,11/textheight(comic sans ms,,1);
for (this.i=0;this.i<int(downloadpos/downloadsize*100);this.i++) {
showtext 300+this.i,1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;
changeimgvis 300+this.i,8;
changeimgzoom 300+this.i,11/textheight(comic sans ms,,1);
}
} else {
hideimg 201;
hideimgs 300,400;
}
timeout = .05;
}



Edit: Had to fix something. Erm, it should work, haven't tested so.
Reply With Quote
  #20  
Old 09-18-2004, 08:34 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Nice work malinko, I see why you are part of the debug team :P
__________________

Last edited by Python523; 09-18-2004 at 09:48 PM..
Reply With Quote
  #21  
Old 09-18-2004, 09:22 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
NPC Code:
1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;



The same error in my original one, how bizarre.
And it's also strange that you would use font comic sans ms everywhere but there.

And if downloadsize is 0, as is the problem, it can't divide by 0.
Reply With Quote
  #22  
Old 09-18-2004, 09:32 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Malinko
NPC Code:
//#CLIENTSIDE
if (created || timeout) {
if (strlen(#D)>0) {
setplayerprop #c,#D;
showtext 201,1,1,comic sans ms,,#D;
changeimgvis 201,8;
changeimgzoom 201,11/textheight(comic sans ms,,1);
for (this.i=0;this.i<int(downloadpos/downloadsize*100);this.i++) {
showtext 300+this.i,1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;
changeimgvis 300+this.i,8;
changeimgzoom 300+this.i,11/textheight(comic sans ms,,1);
}
} else {
hideimg 201;
hideimgs 300,400;
}
timeout = .05;
}



Edit: Had to fix something. Erm, it should work, haven't tested so.
Doesnt work for me.....
__________________

Reply With Quote
  #23  
Old 09-18-2004, 09:35 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 ZeroTrack
Doesnt work for me.....
For half a moment, it should say what you're downloading right when you log on. I've never seen it show anything while you're playing.
Reply With Quote
  #24  
Old 09-18-2004, 09:48 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
I'm thinking the var is bugged, didn't work for me really when I tested it a day or so ago
Reply With Quote
  #25  
Old 09-18-2004, 11:08 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Python523
I'm thinking the var is bugged, didn't work for me really when I tested it a day or so ago
excatly what i think
__________________

Reply With Quote
  #26  
Old 09-18-2004, 11:16 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
Quote:
Originally Posted by Tolnaftate2004
NPC Code:
1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;



The same error in my original one, how bizarre.
And it's also strange that you would use font comic sans ms everywhere but there.

And if downloadsize is 0, as is the problem, it can't divide by 0.
I think that is yours. Did you name it -Download on #gscript?
Reply With Quote
  #27  
Old 09-19-2004, 12:47 AM
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 Malinko
I think that is yours. Did you name it -Download on #gscript?
-pfa/downloads :]

But you are a debugger and missed that? Shame
Reply With Quote
  #28  
Old 09-19-2004, 02:16 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Everyone pakes mistakes pfa, I mean look what you did to UN, You can just about do anything on UN..
__________________
Reply With Quote
  #29  
Old 09-19-2004, 07:44 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 xAndrewx
pakes mistakes pfa
Yup, yup.
And it wasn't intended to be mean.

But I didn't make most, if any, of the buggy stuff on UN.
Reply With Quote
  #30  
Old 09-21-2004, 05:08 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
It seems that the modifications for the "downloadsize" variable were accidently removed in the last Graal v2 release, so the variable doesn't contain something right now except you are running v3. In the next version (will be released in a few weeks) it will be fixed.
Reply With Quote
  #31  
Old 09-21-2004, 06:49 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
When will the new scripting engine be out?;o
__________________
Reply With Quote
  #32  
Old 09-22-2004, 08:01 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
Quote:
Originally Posted by xAndrewx
Nice work malinko, I see why you are part of the debug team :P
I don't...
__________________
Do it with a DON!
Reply With Quote
  #33  
Old 09-23-2004, 01:57 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Stefan
It seems that the modifications for the "downloadsize" variable were accidently removed in the last Graal v2 release, so the variable doesn't contain something right now except you are running v3. In the next version (will be released in a few weeks) it will be fixed.
woo Sern found a bug =D *does the cabbage patch* and you'll thought i was scripting wrong =p
__________________

Reply With Quote
  #34  
Old 09-27-2004, 07:02 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 ZeroTrack
woo Sern found a bug =D *does the cabbage patch* and you'll thought i was scripting wrong =p
Hey, you are actually right for once. Good job.
Reply With Quote
  #35  
Old 09-27-2004, 06:36 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by Lance
Hey, you are actually right for once. Good job.
Lance you love me right? im a good kid =D
__________________

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 07:55 PM.


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