Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   % done (https://forums.graalonline.com/forums/showthread.php?t=14521)

ownerofbabylon 10-13-2001 12:41 PM

% done
 
how do they do it on 2001 and Prov where everytime u fire a weapon on a NPC it adds 1% or so and returns a action at 100%?

Falcor 10-13-2001 05:13 PM

its just adding to a general total. not hard

if(action) this.percentdone++;

ownerofbabylon 10-13-2001 09:38 PM

that brings me to my next point. How do you declare your variables in graal?

in VB you have to do

dim playerspeed as integer
playerspeed = 0

how do you define them in graal?

KJS 10-13-2001 09:40 PM

Quote:

Originally posted by ownerofbabylon
that brings me to my next point. How do you declare your variables in graal?

in VB you have to do

dim playerspeed as integer
playerspeed = 0

how do you define them in graal?

you dont...

its automatically delcared....

like

setstring blah,blah;

then blah is a string

this.blah = 5;

thats in integer in that npc

level.blah = 5;
that is a level wide integer

ownerofbabylon 10-13-2001 09:43 PM

i have never heard of level. before. Thats pretty good =D

SSRobgeta 10-13-2001 09:44 PM

I know how to do this! I made Lumber jacking for my server and I'm working on more.

ownerofbabylon 10-13-2001 09:51 PM

so for lets say mining or something:

if(playerenters){
setstring percentdone,0;
if(playertouchsme&&isweapon(pick)){
percentdone++;
message This rock is percentdone Percent Done;
}
if(percentdone==100){
hide;
playerruppes+=1;
sleep 30;
show;
}

So that would set the string percentdone to 0 when they enter, when the fire the pick on the NPC it adds 1 to percent done and when it reaches 100 it gives them 1 gralat and hides the rock for 30 seconds?

BocoC 10-13-2001 09:52 PM

Quote:

Originally posted by ownerofbabylon
i have never heard of level. before. Thats pretty good =D
Npcserver only. And I think it is still bugged where weapons can't read level.variables, although I am not sure. Stefan may have fixed.

ownerofbabylon 10-13-2001 09:54 PM

oh damn, i was about to get happy

nyghtGT 10-13-2001 11:13 PM

Quote:

Originally posted by ownerofbabylon
so for lets say mining or something:

if(playerenters){
setstring percentdone,0;
if(playertouchsme&&isweapon(pick)){
percentdone++;
message This rock is percentdone Percent Done;
}
if(percentdone==100){
hide;
playerruppes+=1;
sleep 30;
show;
}

So that would set the string percentdone to 0 when they enter, when the fire the pick on the NPC it adds 1 to percent done and when it reaches 100 it gives them 1 gralat and hides the rock for 30 seconds?

I am not the expert but i think 'triggeraction' may help you out greatly ...

Petey84 10-13-2001 11:23 PM

Shakaku:
Lol, I learned that, but i've heard it only works online or somethin, but i know how to use it. I'm not that great of a scripter tho, u can add me to aim and i'll try to help :D Moe478

Falcor 10-13-2001 11:41 PM

NPC Code:

if(playerenters){
setstring percentdone,0; //Why reset when a player enters?
if(playertouchsme&&isweapon(pick)){ //isweapon does not
//Have arguments. maybe your looking for hasweapon(name).
//actionACTIONNAME would be good to put here.

percentdone++;
message This rock is percentdone Percent Done;//It will say
//literally "This rock is percentdone Percent Done"

}
if(percentdone==100){
hide;
playerruppes+=1;
sleep 30;
show;
//THIS is where you should reset the percent done.
}



Not the best code... But im poiting out your errors.

Link188 10-14-2001 12:02 AM

Just ask SSRobgeta, hes the best scriptor i know...;)

ownerofbabylon 10-14-2001 12:09 AM

thanks faldos.

Enigma_GP6 10-14-2001 02:24 AM

Quote:

Originally posted by ownerofbabylon
so for lets say mining or something:

if(playerenters){
setstring percentdone,0;
if(playertouchsme&&isweapon(pick)){
percentdone++;
message This rock is percentdone Percent Done;
}
if(percentdone==100){
hide;
playerruppes+=1;
sleep 30;
show;
}

Well You need to fix this, like so:

if(playerenters){
setstring percentdone,0;
if(playertouchsme&&isweapon(pick)){
percentdone++;
message This rock is #v(#s,percentdone) Percent Done;
}
if(percentdone==100){
hide;
playerruppes+=1;
sleep 30;
show;
}

Dont forget, if you want a string value to appear in a message or a sign, you have to use message codes, :rolleyes:

-Rebel95

nyghtGT 10-14-2001 02:47 AM

Quote:

Originally posted by Enigma_GP6


Well You need to fix this, like so:

if(playerenters){
setstring percentdone,0;
if(playertouchsme&&isweapon(pick)){
percentdone++;
message This rock is #v(#s,percentdone) Percent Done;
}
if(percentdone==100){
hide;
playerruppes+=1;
sleep 30;
show;
}

Dont forget, if you want a string value to appear in a message or a sign, you have to use message codes, :rolleyes:

-Rebel95

I like this better
NPC Code:

if(playerenters){
setstring percentdone,0;
if(playertouchsme && isweapon(pick)){
percentdone++;
message This rock is strtofloat(#s(percentdone)) Percent Done;
}
if(#s(percentdone==100)){
hide;
playerruppes+=1;
sleep 30;
show;
}


but even then that wont work because percentdone is being displayed like its a flag when its a string ... and even then the command 'percentdone++' would not even work ..... and before you tried to use 'percentdone' as a variable and it was never sey as a variable .....

ownerofbabylon 10-14-2001 03:25 AM

whats strofloat for?

nyghtGT 10-14-2001 03:31 AM

strtofloat
 
Quote:

Originally posted by ownerofbabylon
whats strofloat for?
'strtofloat' makes a string being able to be tested as a number

SSRobgeta 10-14-2001 05:24 AM

Heres an exsample of PERCENT. If you bomb this object 4 times. It'll open. I think you should use Triggeraction.

//Created by Rob Getashu
if (exploded && this.bombed<=4){
this.bombed++;
message #v(this.bombed/4*100)%
if (this.bombed=4) {
setcharani stone_open,#s(this.bugsprite);
sleep 2;
setcharani stone_idle,#s(this.bugsprite);
sleep 2;
setcharani stone_close,#s(this.bugsprite);
sleep 2;
setcharani stone_closed,;
setstring bugs,#v(strtofloat(#s(bugs))+1);
}
}

SSRobgeta 10-14-2001 05:28 AM

Now be Jelious;)

Enigma_GP6 10-14-2001 05:31 AM

I am so Jelous

Xaviar 10-14-2001 08:04 AM

Waait...So who's bright idea was it to use a string for the percent done? You could save yourself alot of trouble...

btedji 10-14-2001 08:09 AM

strings dont get reset when a playerenters a level, thats why you have to manually reset them

dragoonvenganc 10-14-2001 10:59 AM

why be jelious when it does not even work .. there is a obviouse erorr and if supersayin jin ... rob.. here is the best scripter you know u do not know many people..

not to be ignorant.

nyghtGT 10-14-2001 11:07 AM

what it was ....
 
Quote:

Originally posted by btedji
strings dont get reset when a playerenters a level, thats why you have to manually reset them
what i explained what Lord Helmut did 'if (playerenters) {percentdone=0;}
therefore anyone entering could reset it ... so i told him to do if (playerenters && !actionMining) {percentage=o;}

SSRobgeta 10-15-2001 12:22 AM

Quote:

Originally posted by dragoonvenganc
why be jelious when it does not even work .. there is a obviouse erorr and if supersayin jin ... rob.. here is the best scripter you know u do not know many people..

not to be ignorant.

Your so messed up it does work. -.-

SSRobgeta 10-15-2001 12:30 AM

Quote:

Originally posted by dragoonvenganc
why be jelious when it does not even work .. there is a obviouse erorr and if supersayin jin ... rob.. here is the best scripter you know u do not know many people..

not to be ignorant.

Second of all: Learn to spell
Third of all: You don't even have the Gani Files *****!

SSRobgeta 10-15-2001 12:32 AM

Quote:

Originally posted by dragoonvenganc
why be jelious when it does not even work .. there is a obviouse erorr and if supersayin jin ... rob.. here is the best scripter you know u do not know many people..

not to be ignorant.

And he thinks I'm a good scipter because (I know him in real life) I'm only 13 and I'm at a high level of scripting.

SSRobgeta 10-15-2001 12:35 AM

Quote:

Originally posted by dragoonvenganc
why be jelious when it does not even work .. there is a obviouse erorr and if supersayin jin ... rob.. here is the best scripter you know u do not know many people..

not to be ignorant.

AND another thing... I'm more of an Althlete then a computer guy. ;)

btedji 10-15-2001 12:38 AM

Quote:

Originally posted by SSRobgeta


AND another thing... I'm more of an Althlete then a computer guy. ;)

im fairly even

nyghtGT 10-15-2001 12:38 AM

Quote:

Originally posted by SSRobgeta


AND another thing... I'm more of an Althlete then a computer guy. ;)

then get outta the forums and go run a mile ...

btedji 10-15-2001 12:40 AM

Quote:

Originally posted by nyghtGT

then get outta the forums and go run a mile ...

and do it in <10min

Link188 10-15-2001 01:51 AM

He really did it in 7:15!

nyghtGT 10-15-2001 02:51 AM

Quote:

Originally posted by Link188
He really did it in 7:15!
who asked you ?

AlexH 10-15-2001 02:55 AM

running one mile in less than 10 mins isnt really hard if you are a lil fit

Slaktmaster 10-15-2001 03:22 AM

Is this thread dedicated to confusing the poor Lord Helmut with code that doesn't work?

strtofloat in a sign wont work
#s(percentdone) works
#v(#s(percentdone)) does not work.

Link188 10-15-2001 03:30 AM

Quote:

Originally posted by nyghtGT

who asked you ?

HES OVER MU HOUSE YOU IDIOT!

Xaviar 10-15-2001 03:43 AM

*votes for this thread to be closed*

dragoonvenganc 10-15-2001 10:02 AM

now you total idiot pay attetion

//Created by Rob Getashu
if (exploded && this.bombed<=4){
this.bombed++;
message #v(this.bombed/4*100)% <<<<<HERE you need ;
if (this.bombed=4) {
setcharani stone_open,#s(this.bugsprite);
sleep 2;
setcharani stone_idle,#s(this.bugsprite);
sleep 2;
setcharani stone_close,#s(this.bugsprite);
sleep 2;
setcharani stone_closed,;
setstring bugs,#v(strtofloat(#s(bugs))+1);
}
}
with out that ; it keeps thinking you are saying text.
i dint try the program on my computer. I am not that stupid i know i do not have the gani.

and i ran a mile last year in 7:06 thanx.

SSRobgeta 10-16-2001 07:27 AM

Quote:

Originally posted by dragoonvenganc
now you total idiot pay attetion

//Created by Rob Getashu
if (exploded && this.bombed<=4){
this.bombed++;
message #v(this.bombed/4*100)% <<<<<HERE you need ;
if (this.bombed=4) {
setcharani stone_open,#s(this.bugsprite);
sleep 2;
setcharani stone_idle,#s(this.bugsprite);
sleep 2;
setcharani stone_close,#s(this.bugsprite);
sleep 2;
setcharani stone_closed,;
setstring bugs,#v(strtofloat(#s(bugs))+1);
}
}
with out that ; it keeps thinking you are saying text.
i dint try the program on my computer. I am not that stupid i know i do not have the gani.

and i ran a mile last year in 7:06 thanx.

It is saying text *****!


All times are GMT +2. The time now is 07:08 PM.

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