Advancer GE is a little pack that contains functions that done require any images whatsoever.
Thanks to pyrometal for helping me with the Actor* code
gcia.freeforums.org link
How to use:
setHP(number) sets HP
setMAXHP(number) sets maxhp
setMP and setMAXMP are the same as HP but set MP instead
textHP("actor name") replace actor name with the actor you want to display HP information about. You must use this in a text actor
textMP is the same as HP but gives information on MP instead
drawHP("actor name") draws the HP bar inside of a canvas. It reads the HP / max HP from the actor you typed in
drawMP is the same as drawHP but is for drawing MP instead
Functions:
The ability to draw a gradient based on HP and MP of another actor by using the code:
- Code: Select all
drawHP("player1");
in one canvas, and use the code
- Code: Select all
drawMP("player1");
in another canvas, then inside of the player1, use this code to set the HP and MP of the character
- Code: Select all
setMAXHP(100);
setMAXMP(100);
setHP(maxhp);
setMP(maxmp);
You can also colorize an actor or text, here is a list of colors and a screenshot you can use. You have to type them as they are inside of the event that changes the color. For example, say the character gets hit, you want him to turn red so on colision - enemy - script editor and type in this code
- Code: Select all
red
Note:
red; = wrong
red = right.
Their shouldn't be a " ; " after the color you chose.
And, likewise to the colors, you have the transparency settings.
Examples:
view50 makes the actor half transparent
view25 makes it 25% seeable
view75 makes it 75% seable
view0 makes it transparent
view100 makes it non transparent
Also likewise to the colors, you shouldn't use the " ; " after the transparency you set.
Screenshots:
How to do it yourself:
Go to the global code editor, and make a new global code script. Name it "Definitions" and put this code in it
- Code: Select all
#define self "Event Actor";
#define green r=0, g=255, b=0;
#define darkgreen r=0, g=166, b=0;
#define blue r=0, g=0, b=255;
#define darkblue r=0, g=0, b=166;
#define lightblue r=0, g=144, b=255;
#define yellow r=255, g=255, b=0;
#define darkyellow r=166, g=166, b=0;
#define orange r=255, g=166, b=0;
#define brown r=121, g=87, b=20;
#define red r=255, g=0, b=0;
#define darkred r=166, g=0, b=0;
#define pink r=255, g=88, b=174;
#define purple r=255, g=0, b=255;
#define darkpurple r=134, g=0, b=126;
#define black r=0, g=0, b=0;
#define white r=255; g=255; b=255;
#define viewhalf transp = .50;
#define view50 transp = .50;
#define view25 transp = .75;
#define view75 transp = .25;
#define view0 transp = 1;
#define view100 transp = 0;
Now make another global code, and put this code in it
- Code: Select all
void setHP(int set)
{
hp = set;
}
void setMP(int set)
{
mp = set;
}
void setMAXHP(int set)
{
maxhp = set;
}
void setMAXMP(int set)
{
maxmp = set;
}
void drawHP(char character[255])
{
Actor* c = getclone(character);
erase(0, 0, 0, .99);
for (i2=0; i2<c->maxhp; i2++)
{
setpen(122, 122, 122, 0, 3);
moveto(i2, 0);
lineto(i2, height-1);
i2++;
}
for (i=0; i<c->hp; i++)
{
for (i3=0; c->hp>i3; i3++)
{
setpen(255, c->hp - (i3 + 64), 0, 0, 3);
moveto(i, 0);
lineto(i, height-1);
i++;
}
}
}
void drawMP(char *character)
{
Actor* c = getclone(character);
erase(0, 0, 0, .99);
for (i2=0; i2<c->maxmp; i2++)
{
setpen(122, 122, 122, 0, 3);
moveto(i2, 0);
lineto(i2, height-1);
i2++;
}
for (i=0; i<c->mp; i++)
{
for (i3=0; c->mp>i3; i3++)
{
setpen(0, i3-(c->mp + 32) / 12 + maxmp, 255, 0, 3);
moveto(i, 0);
lineto(i, height-1);
i++;
}
}
}
void textHP(char *character)
{
Actor* c = getclone(character);
int temp1 = c->hp;
int temp2 = c->maxhp;
sprintf(text, "%d / %d", temp1, temp2);
}
void textMP(char *character)
{
Actor* c = getclone(character);
int temp1 = c->mp;
int temp2 = c->maxmp;
sprintf(text, "%d / %d", temp1, temp2);
}
You can test out Advancer by downloading the GED file here