Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   [help] health sys gui (https://forums.graalonline.com/forums/showthread.php?t=80629)

GULTHEX 07-19-2008 11:10 PM

[help] health sys gui
 
i got the gui image for it and uploaded it but how do i replace the normal gui with the new gui??:confused::confused:


heres the gui

http://gulthex.ucoz.com/kudosai_gui1.png

cbk1994 07-19-2008 11:29 PM

Start by disabling the default one:
PHP Code:

showstats1024 ); 

then show yours:
PHP Code:

showimg200"image.png"0);
changeimgvis200); 

Change the 0, 0 at the end to the x and y. GraalControl.width will give you the far right, GraalControl.height will give you the bottom of the screen.

The 200 is the index; all your images need a unique index and must be over 200 (in this case).

The changeimgvis puts the image on the 4th layer, which is the screen.

Then, show your text where you need it:
PHP Code:

showtext201xy"Font Face""options""Text" ); 

For example:
PHP Code:

showtext20110030"Verdana""b"clientr.hp_cur "/" clientr.hp_max ); 

For those bars, you need to use something like this:
PHP Code:

showimg202"bar.png"3040 );
temp.= ( width clientr.hp_max ) * clientr.hp_cur// Replace width with the width of the bar, and change the vars to what you need.
changeimgpart20200n); // Replace 8 with the height of the bar. 

If you need to show the image of the players current weapon, use:
PHP Code:

showimg203player.weaponsselectedweapon ].image30100 ); 

I recommend splitting all the images into separate images instead of one since it is much simpler to deal with.

GULTHEX 07-19-2008 11:54 PM

where do i find graal control.width

cbk1994 07-19-2008 11:57 PM

Quote:

Originally Posted by GULTHEX (Post 1405479)
where do i find graal control.width

GraalControl.width is the variable.

GULTHEX 07-20-2008 12:14 AM

i got an error
 
this is the script but when i hit apply

PHP Code:

if (playeronline || weaponfired) {
showstats1024 );
showimg200"kudosai_gui1.png"0);
changeimgvis200);
showtext20110030"Verdana""b"clientr.hp_cur "/" clientr.hp_max ); 
showimg202"kudosai_gui1.png"3040 );
temp.= ( 86 clientr.hp_max ) * clientr.hp_cur
changeimgpart20200n); 
showimg203player.weaponsselectedweapon ].image30100 ); 

i get this error

PHP Code:

Script compiler output for -health:
errorunexpected token:  at line 9showimg203player.weaponsselectedweapon ].image30100 );
Weapon/GUI-script -health added/updated by GULTHEX 


xXziroXx 07-20-2008 12:15 AM

Lol. Sorry, but...

http://wiki.graal.net

Try to learn some of the basics before trying this.

GULTHEX 07-20-2008 12:16 AM

dude just tell me how to fix the error

Loriel 07-20-2008 12:23 AM

Quote:

Originally Posted by GULTHEX (Post 1405512)
dude just tell me how to fix the error

It appears you stepped a rather crucial step in the process of replacing the default GUI with a custom one, namely "learning some basic programming"! It is usually expected that you gain some basic scripting experience before approaching such a complex task, because scripting is not going to be as easy as copy&pasting together chunks of code you got off the forums.

The "error" is that you have obviously no idea what you are doing, and the recommended way to fix that is to follow the link that was given to you. Alternatively you could convince someone with more clue to show you the ropes, but I suggest you do not try to harass them into doing your all work.

Zanzel 07-20-2008 12:08 PM

I agree with the others, learn to script before taking steps.
Try scripting up your first few graphic user interface in GUIControls.
You will probably find it much easier to do than trying something
you probably won't get unless you really do want to learn. ;)

Judging by your demands "dude just tell me how to fix the error"
you obviously don't want to teach yourself these things.

cbk1994 07-20-2008 08:42 PM

Quote:

Originally Posted by GULTHEX (Post 1405508)
this is the script but when i hit apply

PHP Code:

if (playeronline || weaponfired) {
showstats1024 );
showimg200"kudosai_gui1.png"0);
changeimgvis200);
showtext20110030"Verdana""b"clientr.hp_cur "/" clientr.hp_max ); 
showimg202"kudosai_gui1.png"3040 );
temp.= ( 86 clientr.hp_max ) * clientr.hp_cur
changeimgpart20200n); 
showimg203player.weaponsselectedweapon ].image30100 ); 

i get this error

PHP Code:

Script compiler output for -health:
errorunexpected token:  at line 9showimg203player.weaponsselectedweapon ].image30100 );
Weapon/GUI-script -health added/updated by GULTHEX 


It seems to me that you just copied and pasted exactly what I said, and barely changed anything.

Try to learn some basic scripting before trying to do something like this.

I know I'll get flamed if I tell you the error, but check out your functions. Also, replace your GS1 functions with GS2 (no, this isn't the error). Check out the wiki, especially this page:

http://graal.net/images/5/50/S_dummies.png

BonzaiXxXSRStudios 09-29-2008 02:26 AM

I know this is an old post but i dont want to start a new one. So how would you go about making the hp and mana bars decrease when a player is hit or when a player uses his mana for example?

Tigairius 09-29-2008 02:38 AM

Easiest way would be having a timeout
then something like
PHP Code:

temp.img "block.png";
showimg(200img2020);
changeimgvis(2004);
changeimgpart(20000, (player.hearts player.fullhearts) * getimgwidth(img), getimgheight(img)); 

Pretty basic math.


All times are GMT +2. The time now is 04:12 AM.

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