SRL Archive - OSR Help

How to find if your in a fight in colour


Troll

2011-04-15 13:06:32

Ok so im trying to make a all colour script, so how could i check if im in a fight while im here?


Thanks

E: pic not showing for me so here is a link http://i55.tinypic.com/2s0epnm.png

Edit again: What part of the include handles health or do i have to find a way myself?

Dervish

2011-04-15 13:35:35

Find the color of your healthbar and if it is on a certain location (above your head), then in fight ? :p

Troll

2011-04-15 13:38:18

How do i find if thats my health bar because its not always in the middle?

Thanks for the help tho

Gu3st...

2011-04-15 13:41:21

There's multiple ways of locating a health bar:
1. Color searching. Search for the green and/or red color
2. DTM. Make a DTM of the bar outline
3. BMP. Search for a 1px wide BMP of the green part of the health bar

Brandon

2011-04-15 14:10:59

Basically I believe this is impossible.. Due to the fact that if someone is standing under you and fighting your monsters, it will show up as your health bar.. tbh the only way to find out if your being attacked is to check your health.. like the number itself.

You have 492 hp. Check to see if it keeps decreasing or something. If you have really high def and you never get hit, then good luck.

:o I love how ideas pop into my head.. The possible best solution:
You know how it shows the "29" damage you did in the pic? Yours will always be red/orange, etc or if you hit a 0, its blue.. other people's will be sorta maroon and if they hit 0, then it wont show up at all.. That is possibly the best way to tell if your in a fight. As far as I know, yours will never ever be maroon so you can still colour tolerance it.

TRiLeZ

2011-04-15 16:01:39

Hit-splashes are static images, and the hit-splashes made by you/to you have a unique colour, so look for the top/bottom of the hit-splash (DTM/Bitmap). Then, if the hitsplash doesn't show up for a while, or if your hp bar is gone, you are probably done fighting. You can also keep track of your enemy's hp bar for optimal performance.

Troll

2011-04-15 16:04:45

So how can you check your hitpoint/ your life?
How can you check your hitpoint XP.
So if they change your in a fight

Blumblebee

2011-04-15 17:05:25

From: Troll
So how can you check your hitpoint/ your life?
How can you check your hitpoint XP.
So if they change your in a fight


In Colour you simply look at the Upper Left area of the MM where your health is located in a circle in text. You can easily moderate changes in that.

You can also attempt to implement pixel shift as a check as well, seeing how if a person is standing on your square, you show up on top of them and not animating. However I do not know how accurate this method is.

Troll

2011-04-15 17:08:28

So can you make BitMap/DTM on the go, so i can make in using set bounds?

Flight

2011-04-15 19:37:34

From: TRiLeZ
Hit-splashes are static images, and the hit-splashes made by you/to you have a unique colour, so look for the top/bottom of the hit-splash (DTM/Bitmap). Then, if the hitsplash doesn't show up for a while, or if your hp bar is gone, you are probably done fighting. You can also keep track of your enemy's hp bar for optimal performance.


I think hit splashes wouldn't be so accurate as they're located further away from the player. I would rely more on the health bar located at a certain static location, that'd be the simplest in my opinion.

NCDS

2011-04-15 23:58:57

Animation.scar to see if your char is 'Animating' plus color check for HP bar.

TomTuff

2011-04-16 20:39:10

srl_InFight?

E:

function AreWeFighting: Boolean;
begin
if srl_InFight then
Result := PixelShift(IntToBox(MSCX - 15, MSCY - 15, MSCX + 15, MSCY + 15), 800) > 150;
end;

should work well