Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-23-2001, 12:17 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Cool

I made this really nifty lifemeter thing.....it decreases and increases on both normal health and max health....it sorta replaces the hearts.......but i am having some trouble with it, cause it wont let me get into my weapons list when i push Q. I also want to know how to get it to display the hp in actual numbers on the image.....

anyway....here is what i did.......includes 1 board w/the lifemeter script +extra npcs that play with it. Also include 4 flavors and 1 template.......(hpbar img)
__________________
Reply With Quote
  #2  
Old 04-23-2001, 12:19 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
bah......

it screwed up.........here it is

I should also mention that it does not work right for baddies......
Attached Files
File Type: zip lifemeter.zip (20.4 KB, 268 views)
__________________

Last edited by G_yoshi; 04-23-2001 at 02:55 PM..
Reply With Quote
  #3  
Old 04-24-2001, 08:44 AM
Er1c Er1c is offline
Registered User
Er1c's Avatar
Join Date: Mar 2001
Location: Chicago, IL
Posts: 791
Er1c is on a distinguished road
Exclamation Why you cant use Q

Whenever a player's hearts get changed/set, the normal playing screen is displayed. With that script, every .05 secconds you're setting the player's hearts, which makes the Q screen hide whenever someone trys to display it. Getting numbers to display the health is a bit more advanced, but you need to use changeimgpart a lot for it...
__________________
Eric Kraft
Reply With Quote
  #4  
Old 04-24-2001, 08:46 AM
Er1c Er1c is offline
Registered User
Er1c's Avatar
Join Date: Mar 2001
Location: Chicago, IL
Posts: 791
Er1c is on a distinguished road
WOW, only 7 posts!!! Heh, heres another.
__________________
Eric Kraft
Reply With Quote
  #5  
Old 04-24-2001, 11:31 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
so....then what should i do? I want to make sure that the bar does not lag
__________________
Reply With Quote
  #6  
Old 04-24-2001, 12:19 PM
LilbrojX LilbrojX is offline
why dont you marry it?
LilbrojX's Avatar
Join Date: Mar 2001
Location: hmm
Posts: 1,465
LilbrojX is on a distinguished road
Send a message via AIM to LilbrojX Send a message via Yahoo to LilbrojX
Red face

WOAH, I wish I could script this well
__________________

http://www.dictionary.com/search?q=arrogant
kai is an expert on all things arrogant
Reply With Quote
  #7  
Old 04-24-2001, 04:03 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Pheh........im not that good......but how would i know....
but im flattered that you think so

anyway....i have made a small update to it......check it out......also comes with 2 new skins!!!

i still need to find out how to make it decrease hp when the player is hit by arrows, thrown objects, and bombs....

also need to find out how to make it work when the player is in a bed........

i wonder if there is some kind of flag that is set when the player is in a bed........
Attached Files
File Type: zip lifemeter.zip (34.2 KB, 192 views)
__________________
Reply With Quote
  #8  
Old 04-24-2001, 07:21 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Blah.

It currently sets it every 0.05 seconds to the players fullhearts?
then use this:
NPC Code:
if (playerhurt) {
playerhearts=playerfullhearts;
}


Then you will only restore the hearts whenever the player is hurt
__________________

Reply With Quote
  #9  
Old 04-25-2001, 03:07 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
THANK YOU!!!!!! :D

Thank you so much!! Now i got it so it works with baddies and bombs and stuff!!! Now I must get it to work when a player is in a bed.........

Here is another update for it too......since Grim's suggestion helped imensely.

No new skins though....maybe i will make somemore later.
Attached Files
File Type: zip lifemeter.zip (35.1 KB, 188 views)
__________________
Reply With Quote
  #10  
Old 04-25-2001, 05:29 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
oops.....sorry

hehe........me r dummy.......i forgot a few files......
here is the full thing
Attached Files
File Type: zip lifemeter.zip (91.1 KB, 209 views)
__________________
Reply With Quote
  #11  
Old 04-25-2001, 02:32 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
And if you really even care......here are 3 more skins i made.......
Attached Files
File Type: zip hpmeter_skinpack1.zip (11.3 KB, 191 views)
__________________
Reply With Quote
  #12  
Old 04-26-2001, 09:05 AM
General General is offline
Banned
Join Date: Apr 2001
Location: Station Square
Posts: 984
General is on a distinguished road
Send a message via ICQ to General Send a message via AIM to General Send a message via Yahoo to General
Post Re: oops.....sorry

Use if Sprite=Uhm that number...
Reply With Quote
  #13  
Old 04-26-2001, 03:19 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Question

?????
__________________
Reply With Quote
  #14  
Old 05-01-2001, 01:22 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
I still need some help with my HP meter displaying numbers.........i can get it to do it some what.....but it does not always work right.......

hp=strtofloat(#s(player_hp));
hp3=int(hp/100);
hp1=int(hp/10);
hp2=(hp%10);
showimg 202,hp_bar_#s(flavor).png,425,37;
changeimgpart 202,hp3*16,44,16,16;
changeimgvis 202,4;
showimg 203,hp_bar_#s(flavor).png,434,37;
changeimgpart 203,hp1*16,44,16,16;
changeimgvis 203,4;
showimg 204,hp_bar_#s(flavor).png,443,37;
changeimgpart 204,hp2*16,44,16,16;
changeimgvis 204,4;

that is what i have........if someone can help me, that would be great........
__________________
Reply With Quote
  #15  
Old 05-02-2001, 08:02 AM
WhoopA WhoopA is offline
Registered User
Join Date: May 2001
Location: Wherever I may roam
Posts: 86
WhoopA is on a distinguished road
Cool

WhoopA to the rescue! Here's some code you can use. It'll use the default letters.png for the readout. You should be able to modify it to your own use.

NPC Code:

// Digital readout function Draw()
// Script by WhoopA
// Displays a value, left aligned, on the player's screen.
//
// These variables muse be set before this function is called!
// num: Number to display
// dx, dy: Position to display the number on the player's screen. These will be changed as the function runs.
// img: Image values to use (start with 200). This is the parameter supplied to showimg and will be incremented automatically.

function Draw()
{
dr_val = 10; while (dr_val < num) dr_val *= 10;
while (dr_val > 1) {
dr_val = dr_val / 10;
dr_i = int(num / dr_val) % 10;
showimg img,letters.png,dx,dy;
changeimgpart img,64*dr_i,96,12,32;
changeimgvis dr_i,4;
dx += 12; img++;
}
}



At the end of your timeout, you can take care of cleanup by running these lines (assuming you use this method of doing your status):

for (i=200;i<this.lastimg;i++) hideimg i;
this.lastimg = img;

Hope this helps.
__________________
WhoopA, the Official Kicker of Butts

--- No images. No clutter. Just pure, simple text.
"Thank you, thank you. Please, ladies, put your clothes back on... Not you Samus..." - Link from the BOTVGH
Everywhere I look, I see rabbits. Maybe I should take down all my Sailor Moon stuff.
Reply With Quote
  #16  
Old 05-02-2001, 11:03 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
thanks......i will see what if this will help
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:39 AM.


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