Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   My MP Bar (https://forums.graalonline.com/forums/showthread.php?t=13567)

SSRobgeta 10-02-2001 02:44 AM

My MP Bar
 
How would I make my own MP bar? Sorta like making your own AP bar. I started to make one but for some reason it won't work?

// NPC made by Rob Getashu
timereverywhere;
timeout=.05;
if (playerchats&&strequals(#c,human)) {
toweapons -System Status-;
}
if (timeout)
if (isweapon) {
showstats 1+2+4+8+16+32+256+512+1024;
this.pos = {screenwidth-180,30};
this.mpdisplay = ((playermp/100)*100);
if (good) {
showimg 1,Picture1.gif,this.pos[2],this.pos[1];
}
else if (evil) {
showimg 1,Picture1.gif,this.pos[2],this.pos[1];
}
else {
showimg 1,Picture1.gif,this.pos[2],this.pos[1];
}
changeimgvis 1, 4;
}
if (this.mpdisplay>0) {
showimg 2,Picture2.gif,this.pos[2],this.pos[1];
changeimgpart 5,0,0,this.mpdisplay,6;
changeimgvis 1,4;
}



if (playerdies) {playermp=playermp}

btedji 10-02-2001 03:00 AM

Re: My MP Bar
 
I think this part is the problem

if (this.mpdisplay>0) {
showimg 2,Picture2.gif,this.pos[2],this.pos[1];
changeimgpart 5,0,0,this.mpdisplay,6;
changeimgvis 1,4;
}

should the changeimgpart be 2 so it is changing picture2.gif and shouldnt the changeimg vis be 2 so it will change the level of picture2.gif?

SSRobgeta 10-02-2001 03:04 AM

Ok I'll try that

SSRobgeta 10-02-2001 03:07 AM

Re: Re: My MP Bar
 
Quote:

Originally posted by btedji
I think this part is the problem

if (this.mpdisplay>0) {
showimg 2,Picture2.gif,this.pos[2],this.pos[1];
changeimgpart 5,0,0,this.mpdisplay,6;
changeimgvis 1,4;
}

should the changeimgpart be 2 so it is changing picture2.gif and shouldnt the changeimg vis be 2 so it will change the level of picture2.gif?

Which parts should be 2?

SSRobgeta 10-02-2001 03:08 AM

NM I got it thx!

btedji 10-02-2001 03:09 AM

np

SSRobgeta 10-02-2001 03:36 AM

OK thx , but now it won't show the MP picture change when you use the magic?

// NPC made by Rob Getashu
timereverywhere;
timeout=.05;
if (playerchats&&strequals(#c,human)) {
toweapons -MP Bar-;
}
if (timeout)
if (isweapon) {
showstats 1+2+4+8+16+256+512+1024;
this.pos = {screenwidth-180,30};
this.mpdisplay = ((playermp/100)*100);
if (good) {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
else if (evil) {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
else {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
changeimgvis 1, 4;
}
if (this.mpdisplay>0) {
showimg 2,picture2.gif,this.pos[2],this.pos[1];
changeimgpart 5,0,0,this.mpdisplay,2;
changeimgvis 2,4;
}

else {
hideimg=0.5;
}




if (playerdies) {playermp=playermp}

btedji 10-02-2001 03:44 AM

Quote:

Originally posted by SSRobgeta
OK thx , but now it won't show the MP picture change when you use the magic?

NPC Code:

// NPC made by Rob Getashu
timereverywhere;
timeout=.05;
if (playerchats&&strequals(#c,human)) {
toweapons -MP Bar-;
}
if (timeout)
if (isweapon) {
showstats 1+2+4+8+16+256+512+1024;
this.pos = {screenwidth-180,30};
this.mpdisplay = ((playermp/100)*100);
if (good) {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
else if (evil) {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
else {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
changeimgvis 1, 4;
}

stuff below this line should be in the timeout loop and you need a timeout command at the bottom of the timeout loop

if (this.mpdisplay>0) {
showimg 2,picture2.gif,this.pos[2],this.pos[1];
changeimgpart 5,0,0,this.mpdisplay,2;
changeimgvis 2,4;
}

else {
hideimg=0.5;
}

if (playerdies) {playermp=playermp}




SSRobgeta 10-02-2001 03:46 AM

You mean like this


// NPC made by Rob Getashu
timereverywhere;
timeout=.05;
if (playerchats&&strequals(#c,human)) {
toweapons -MP Bar-;
}
if (timeout)
if (isweapon) {
showstats 1+2+4+8+16+256+512+1024;
this.pos = {screenwidth-180,30};
this.mpdisplay = ((playermp/100)*100);
if (good) {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
else if (evil) {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
else {
showimg 1,picture1.gif,this.pos[2],this.pos[1];
}
changeimgvis 1, 4;

timeout = .5;
}
if (this.mpdisplay>0&&timeout) {
showimg 2,picture2.gif,this.pos[2],this.pos[1];
changeimgpart 5,0,0,this.mpdisplay,2;
changeimgvis 2,4;
}

else {
hideimg=0.5;
}

btedji 10-02-2001 03:47 AM

you didnt put the stuff below the timeout loop in the timeout loop and the timeout should be .05

SSRobgeta 10-02-2001 03:49 AM

Can you give me an exsample :D

btedji 10-02-2001 04:01 AM

NPC Code:

timereverywhere;
timeout=.05;
if (playerchats&&strequals(#c,human)) {
toweapons -MP Bar-;
}
if (timeout)
if (isweapon) {
showstats 1+2+4+8+16+256+512+1024;
this.pos = {screenwidth-180,30};
this.mpdisplay = ((playermp/100)*100);

if (good) {
showimg 1,picture1.gif,this.pos[1],this.pos[0];
}
else if (evil) {
showimg 1,picture1.gif,this.pos[1],this.pos[0];
}
else {
showimg 1,picture1.gif,this.pos[1],this.pos[0];
}

changeimgvis 1, 4;

if (this.mpdisplay>0&&timeout) {
showimg 2,picture2.gif,this.pos[1],this.pos[0];
changeimgpart 2,0,0,this.mpdisplay,2;
changeimgvis 2,4;
}

timeout = .05;
}




try this

SSRobgeta 10-02-2001 04:02 AM

Ok let me try

SSRobgeta 10-02-2001 04:12 AM

Ok now it's not working at all! Can you try to figure it out and I'll check it when I get back on later? I would really apreicate it!

Riot-Starter 10-02-2001 04:13 AM

shouldnt the image indexes be higher than 199 so they are local or is all imgvis 4 images local

btedji 10-02-2001 04:14 AM

NPC Code:

timereverywhere;
timeout=.05;
if (playerchats&&strequals(#c,human)) {
toweapons -MP Bar-;
}
if (timeout) {

if (isweapon) {
showstats 1+2+4+8+16+256+512+1024;
this.pos = {screenwidth-180,30};
this.mpdisplay = ((playermp/100)*100);}

if (good) {
showimg 1,picture1.gif,this.pos[0],this.pos[1];
}
else if (evil) {
showimg 1,picture1.gif,this.pos[0],this.pos[1];
}
else {
showimg 1,picture1.gif,this.pos[0],this.pos[1];
}

changeimgvis 1, 4;

if (this.mpdisplay>0) {
showimg 2,picture2.gif,this.pos[0],this.pos[1];
changeimgpart 2,0,0,this.mpdisplay,2;
changeimgvis 2,4;
}

timeout = .05;
}




maybe this?

SSRobgeta 10-02-2001 07:37 AM

and I wanted to say... The MP Bar goes where the AP bar is


All times are GMT +2. The time now is 04:33 PM.

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