Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   how can i fix this (https://forums.graalonline.com/forums/showthread.php?t=20566)

la_builder 01-07-2002 02:06 AM

how can i fix this
 
Ok i wanted to make something like a craft system bud it lags as hell because of a part in da script and its not my computer bud the script this is the script plz fix it

if (playerenters) {message Free Table;hide;}
if (actionmining) {this.User=#a;this.Mine=this.Mine+1; message #v(this.Mine)% by #v(this.User);sleep 0;}
if (this.User=#a) {
if (this.Mine=100) {setimg fossil.gif;this.Mine=this.Mine-100;toweapons Rock;hide;destroy;message Free Table;}}

Kumada 01-07-2002 02:19 AM

Here you go ;)

Tested, Works
NPC Code:

if (playerenters) {
message Free Table;
}

if (actionmining) {
setstringthis.User,#a;
setstring this.Mine,#v(strtofloat(#s(this.Mine))+1);
message #s(this.Mine)% by #s(this.User);
}

if (strequals(#s(this.User),#a)){
if (strtofloat(#s(this.Mine))>99) {
setimg fossil.gif;
setstring this.Mine,#v(strtofloat(#s(this.Mine))0);
toweapons Rock;message Free Table;
setimgpart pics1.png,1,1,1,1;
}
}



Dunno, Havent tested (makes it so it does not say free table unless somoene is done crafting ... i think)
NPC Code:

if (playerenters&&!this.mode==1) {
message Free Table;
}

if (actionmining) {
this.mode = 0;
setstringthis.User,#a;
setstring this.Mine,#v(strtofloat(#s(this.Mine))+1);
message #s(this.Mine)% by #s(this.User);
}

if (strequals(#s(this.User),#a)){
if (strtofloat(#s(this.Mine))>99) {
setimg fossil.gif;
setstring this.Mine,#v(strtofloat(#s(this.Mine))0);
toweapons Rock;message Free Table;
setimgpart pics1.png,1,1,1,1;
this.mode = 1;
}
}


la_builder 01-07-2002 02:45 AM

thanks for fixing owner system
 
bud it still lags if i use the hammer will it take like 10 sec before the precent i giong up by 1

PhenomX 01-07-2002 03:56 AM

maybe some of the setimg s are lagging your computer, try check all your options and make sure there is nothing that could interfere, because if graal has to look for te img, it could lag it down fast enough the make the percentage slower appearing.

la_builder 01-07-2002 05:03 PM

nope
 
i think its not that also could someone of you remake it a little plzz
caus i cant i really dont know what the bug is:(

Kumada 01-07-2002 06:24 PM

Your hammer script is probably bugged.. or u dont have the fossil.gif img :(

la_builder 01-07-2002 07:27 PM

:(
 
:( well here is my hammer script check it for bugs plzzz

// NPC made by Discounter
if (playerenters) {
message Hammer;
blockagain;
}
if (playertouchsme) {
toweapons Hammer;
}
if (weaponfired) {
setani jaxe,hammergold.png;freezeplayer 0.5;
sleep 3;
triggeraction playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,mining,#v(axepower);
}

Falcor 01-07-2002 08:18 PM

For rocks or anything you want to have triggeraction, use setshape.... So it will work even w/o the gif...

setshape 1,32,32; will define and NPC with the width and hiegh of 32 px despite its gif (if any)

Kumada 01-07-2002 08:21 PM

Re: :(
 
Quote:

Originally posted by la_builder
:( well here is my hammer script check it for bugs plzzz

// NPC made by Discounter
if (playerenters) {
message Hammer;
blockagain;
}
if (playertouchsme) {
toweapons Hammer;
}
if (weaponfired) {
setani jaxe,hammergold.png;freezeplayer 0.5;
sleep 3;
triggeraction playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,mining,#v(axepower);
}

U didn't make that lol.. There are 2 people claiming to make taht script.. u and josey... haha

la_builder 01-07-2002 08:36 PM

mmmm
 
First off all kumada i didnt cliam the owner ship it was releast by stefan knorr and falcor would this stop the lag because if so explain it to me why

la_builder 01-07-2002 08:45 PM

1 Attachment(s)
here is the level

Kumada 01-07-2002 08:51 PM

Re: mmmm
 
Quote:

Originally posted by la_builder
First off all kumada i didnt cliam the owner ship it was releast by stefan knorr and falcor would this stop the lag because if so explain it to me why
Yea u did.
Quote:

// NPC made by Discounter

la_builder 01-07-2002 09:05 PM

ow
 
o sorry your right bud plz get back to the problem

mikepg 01-08-2002 04:14 AM

Re: Re: :(
 
Quote:

Originally posted by Kumada


U didn't make that lol.. There are 2 people claiming to make taht script.. u and josey... haha

you have got to be an idiot. EVERYONE uses a variation of that. They use the triggeraction code, because its a formula that is easy to use. Every other aspect of the NPC is done by individuals. They USE (or steal in your mind) the x,y formula, but they DIDNT steal the NPC. If you take the time to formulate your own trigger action x,y and the one stefan gave in newfeatures works fine, then you wasted time.

Dont be so quick to say that someone stole something. People use resources.

joseyisleet 01-08-2002 04:37 AM

Re: Re: :(
 
Quote:

Originally posted by Kumada


U didn't make that lol.. There are 2 people claiming to make taht script.. u and josey... haha

Kumada,
Just because two scripts look the same doesn't mean jack **** you stupid ****. Just because we used triggeraction and vecx and vecy doesn't mean we stole it. I know I didn't and I have a few people who can vouche for that because I was gone before triggeraction was even put into the commands. So you need to shut the **** up.


All times are GMT +2. The time now is 02:27 AM.

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