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


All times are GMT +2. The time now is 06:23 AM.

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