Is there a way to say any number between x and y without having a condition for each value?
Printable View
Is there a way to say any number between x and y without having a condition for each value?
This code gives you the value from an Alterable Value but 5 if it's lower and 15 if it's higher.
Max(5, Min(Alterable Value A( "Active" ), 15))
If you want to know if the Alterable Value is between 5 and 15 use Compare two general values from the Special object:
Alterable Value A( "Active" ) equal Max(5, Min(Alterable Value A( "Active" ), 15))
And so on...
hmm...wish that didn't look so foreign, lol. Here's what I'm trying to do. I've got a global variable for health, and a health bar that shows a state of fullness based on that value...if health is 50 the bars is full, if it's 49 to 44 is shows a little gone, so on and so fourth to 0 = empty, lol.
one of those expressions you gave me may help, but I don't always speak syntax so well, lol..
the easiest way I know how to do it is.
49
48
47 - show some gone
46
45
44
43 - show a little more gone.
42
but I figured if there was a better expression it would use less of my valuable mmf2 resource space, lol.
lol. ^^
The easiest way is to use the Counter object. You can use graphics too. It calculates the steps between automatically.
Yeah, but that's no good if you want a cool custom health bar, lol. Not that it would matter for this project of course, but it would be an issue for my other one, lol.
Then have a look at the Interface Bar object.
You can still do it by yourself but it's a bit more work...
Well... I *did* make a private object just to test if a number is between too other numbers if you want it...
cool, thanks, I'm gonna have a look into that.
awesome...could I use it? see if I can work in into the health bar?
hmm I like the interface bar, but I don't understand how to change the animations. If you click edit images, only one picture shows up.
I never worked with this object yet. ^^
ahh I just read on that wiki that it works by cutting the image at the right percentage, something like that. It can have a background image, and the regular image for the bar..I'm guessing background can be set up to go around the bar that will be cut to look like it's emptying. Could be pretty useful in some situations. lol
I'm going to have to implement that bar. The method that I stated early....it's not working for some reason. That's something I'd like to know if someone can figure it out, lol.
I've got an active object for a health bar. I have a single frame animation for each state of fullness the bar can be in.
I have
50 animation full
49
47 - set animation 13
46
45
44 - set animation 12
43
all the way down to 0..
for some reason the bar is stuck on full...
I had it working when I had the code another way, but there was logical errors I needed to fix...I knew this way would fix them...but...didn't know it wouldn't work, lol.
any ideas why it would be stuck on full even though the health is going down?
Have you checked your each animation is set to loop?
If you upload a picture of your health bar, Id be happy to make you an example using only 2 or 3 lines of code.
Awesome, I'll get that set up, it's nothing special, but you wouldn't have to do any work to make a health bar, lol, hold on. They are set to loop. I had the bar working with different code, but there was a logical error which made it not work right all the time, so I tried coding it this way...hold on, I'll get that file.
http://www.mediafire.com/?6sbx79j9zt2g043
it's 64kb
around 13 rared pngs
Downloading from mediafire is very annoying to some users as there are adverts and popups. The forum has built-in support for uploading and displaying images. ;)
I haven't once seen a pop us on a media fire download page. There are some ads on the page itself, but there's ads everyone where, lol. How do you upload images to the site, and would I have to do it one by one? I'm probably not going to bother if that's the case, because that would be more annoying than adding one file to media fire....if he says himself to do it that way I probably will though, in reconsideration...I'm not going to bother redoing something I'm not going to get help with, lol.
"I'm not going to bother redoing something I'm not going to get help with, lol. "
That is not going to get you very far in game making...lol.
Nah, don't take it the wrong way, lol. I just mean the guy who said he would help isn't responding..it's easy enough to click that link and dl the files, if someone really wanted to help they would, if not I'm not to worried about it.
I don't mean to be stubborn, lol. I'm a bit sorry...your points are valid, but here's the way I see it...I've already supplied the files. They're neatly packaged in a rar file. All he would have had to of done was click the link, and the big green button that says download...no popups, no hassle, and he would have had the files. I've already taken the time to supply them..if I uploaded them here I would have done the same thing...supplied the files...someone who wanted to be nice, and help could click the two clicks, get the files, and help..I don't see it as a big issue...someone who's helping would be doing so out of kindness right? they shouldn't be too prudent as to how they got the files when it's that simple...I could see if they had to navigate through 600 pages of media fire site, and jump through rings of fire that it might be a real issue...but if someone clicked the link...they would see for themselves how hassle free, and simple it is to get them files, lol.
Then I had a look and made you a simple example. You should understand it if you take your time.
Custom health bar example: http://www.mediafire.com/?916w3u2oxoxdz8i
The code works like other gadgets here on the forums. Just set the Alterable Value "BarValue" to set the position. You can find the code in the behavior of the Active.
Have fun. ^^
Hey, thanks for that. I'm gonna check it out :) I'm sorry about the above posts...I was just used to using media fire, and that was the way I did it. Didn't even know how to do it the other way, lol. next time for something like this I'll figure out how to use the inbuilt forum way.
oh you bugger!! lol
I am not happy about going to media fire...now why didn't you use the repository!?!?!?!?!
okay okay..we're gonna have to be a family here...click team put these features here for a reason, no more media fire for Jibs, lol.