Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   STATUS BARS x.X (https://forums.graalonline.com/forums/showthread.php?t=5535)

MoonAngel 06-23-2001 10:57 AM

STATUS BARS x.X
 
ok, i made a status bar.. the thing is that when i enter a new level, it messes up.. = \ i WILL NOT post the script since all the newbies and midbies that need it will steal it, so any good scripter willing to help, ill PM the script. thank you

06-23-2001 11:03 AM

Hmm... I will make you a status bar for life, mp, and ap. it will take be about 10-15 mins.

MoonAngel 06-23-2001 11:06 AM

i already made them, i just need a good scripter that will fix it so that it works on all levels =\

06-23-2001 11:10 AM

// NPC made by Ice Pick
timereverywhere;
timeout=.05;
if (playerenters) {
toweapons weapon name;
}
if (timeout) {
if (isweapon) {
showstats 1+2+4+8+16+256+512+1024;
this.pos = {screenwidth-180,30};
this.hpdisplay = ((playerhearts/playerfullhearts)*100);
this.mpdisplay = ((playermp/100)*100);
this.apdisplay = ((playerap/100)*100);
if (good) {
showimg 1,statsmenuname.gif,this.pos[0],this.pos[1];
}
else if (evil) {
showimg 1,statsmenuname.gif,this.pos[0],this.pos[1];
}
else {
showimg 1,statsmenuname.gif,this.pos[0],this.pos[1];
}
changeimgvis 1, 4;
if (this.hpdisplay>0) {
showimg 3,mpbarname.gif,this.pos[0]+15,this.pos[1]+33;
changeimgpart 3,0,0,this.hpdisplay,6;
changeimgvis 3,4;
}
else {
hideimg 3;
}
if (this.apdisplay>0) {
showimg 4,mpbarname.gif,this.pos[0]+15,this.pos[1]+50;
changeimgpart 4,0,0,this.apdisplay,6;
changeimgvis 4,4;
}
else {
hideimg 4;
}
if (this.mpdisplay>0) {
showimg 5,mpbarname.gif,this.pos[0]+17,this.pos[1]+66;
changeimgpart 5,0,0,this.mpdisplay,6;
changeimgvis 5,4;
}
else {
hideimg 5;
}
}
}
if (playerdies) {playerap=playerap;playermp=playermp;}

try that... I dunno if it works right though...

CrazedMerlin 06-23-2001 11:43 AM

hello icepick, be really cool and make me a stats meeter, bai!

MoonAngel 06-23-2001 11:49 AM

it's not for a normal bar, it's like.. a Stamina bar and it goes down with a timeout but messes up when you go in another level > _ < i alerady have every other type of status bar =\

grim_squeaker_x 06-23-2001 05:58 PM

Well only advice I can think of is this:
put in "isweapon" flags in all stuff which it only needs to if it is a weapon, put a !isweapon flag in any things which it needs to do if it isn't a weapon, use strings for storing how many stamina the player has, and make sure that it doesn't reset the stamina everytime the player entesr another level.

Falcor 06-23-2001 09:22 PM

Bleh
 
Dont use timeout to count down. Timeout is really unreliable other than looping really fast =\
Id suggest a Variable
NPC Code:

if (isweapon) {
if (playerenters||timeout) {
timeout = 0.05;
if (this.time<=0) {
setstring stamina,#v(strtofloat(#s(stamina)) - 1);
this.time = 30;
}
this.time --;
}
}



Try something alonge those lines :o

General 06-24-2001 09:05 AM

Hmm
 
Send me it i'll fix it : )
Yah Variables will work Alot better (Like Falados said)

Marco2002 06-24-2001 01:57 PM

use a save[index] variable
it's much better for those things

General 06-25-2001 12:39 AM

Yah, send it to me too...

PS: I am supersonic, as stated below, i am cooler


All times are GMT +2. The time now is 11:31 AM.

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