CMS/CBS PROBLEM
Posts
Pages:
1
I'm just crunching my pencil and thinking how to show ally's HP/MP without doing million pages of event which shows numbers..
I don't know how to make a system which does something to show HP so can anyone help?
I don't know how to make a system which does something to show HP so can anyone help?
It's complicated, but it shouldn't take too much code.
I like to first use if-thens to see how many digits are in the number to be displayed.
Ex: If 9 or less set variable "Digits" to one. If not, then if 99 or less set variable to two. Etc.
After that, use different forks depending on how many digits.
For instance:
If Variable "Digits" is two then:
If variable "HP" is twenty or above then:
Show picture 1 (first HP digit) subtract variable HP by twenty.
If variable "HP" is ten or above then:
Show picture 1 (first HP digit) subtract variable HP by ten. (etc)
Then another one for the second digit.
If variable "HP" is nine then:
Show picture 2 (second HP digit) (etc)
You will get into problems when the middle digits are zeros, so I just use "Labels" to skip over it if not needed. That's a little more complicated too, but work with what I gave you and practice different things. This is the easiest way I have done it, but I did it through LOTS of trial and error over the years.
If you make some progress, I'll tell you the rest.
I like to first use if-thens to see how many digits are in the number to be displayed.
Ex: If 9 or less set variable "Digits" to one. If not, then if 99 or less set variable to two. Etc.
After that, use different forks depending on how many digits.
For instance:
If Variable "Digits" is two then:
If variable "HP" is twenty or above then:
Show picture 1 (first HP digit) subtract variable HP by twenty.
If variable "HP" is ten or above then:
Show picture 1 (first HP digit) subtract variable HP by ten. (etc)
Then another one for the second digit.
If variable "HP" is nine then:
Show picture 2 (second HP digit) (etc)
You will get into problems when the middle digits are zeros, so I just use "Labels" to skip over it if not needed. That's a little more complicated too, but work with what I gave you and practice different things. This is the easiest way I have done it, but I did it through LOTS of trial and error over the years.
If you make some progress, I'll tell you the rest.
Zeroes aren't so hard. You have to include zeroes in your display script though for it to work properly.
To make sure that they are displayed properly, Include in your display code a branch at the zero for each place value, where it goes
IF VAR (the one you want to display) is less than place value (ie if its less than a thousand and this is the thousands column) THEN show no pic.
Another method is at the end of the display code, add a conditional branch that if the digit is zero, then show no picture (or a blank picture). WITHIN that condition, add similar conditions for the place values that come after it, up to but not including the 1s.
This will show zeroes only when there are numbers high enough to prompt thier nescessity. For example, if you number is 100, but your display covers places into the ten thousands, the 0s in the ten-thousands and the thousands places will not show, because the ten-thousands value equals zero and so does the thousands value BUT NOT the hundreds (because it is greater than zero so the conditional process breaks) nor does the tens value (because the conditional process broke at the hundreds place.
A little confusing to explain in print but its really simple in practice.
See this topic at GW where I explained most of the details of splitting and showing a variable for a CMS/CBS.
I'm not quite sure what Demicrassus is talking about but it really isn't complicated. It takes about 10(x) commands to do up a number display, where (x) is the number of place values you want to use.
To make sure that they are displayed properly, Include in your display code a branch at the zero for each place value, where it goes
IF VAR (the one you want to display) is less than place value (ie if its less than a thousand and this is the thousands column) THEN show no pic.
Another method is at the end of the display code, add a conditional branch that if the digit is zero, then show no picture (or a blank picture). WITHIN that condition, add similar conditions for the place values that come after it, up to but not including the 1s.
This will show zeroes only when there are numbers high enough to prompt thier nescessity. For example, if you number is 100, but your display covers places into the ten thousands, the 0s in the ten-thousands and the thousands places will not show, because the ten-thousands value equals zero and so does the thousands value BUT NOT the hundreds (because it is greater than zero so the conditional process breaks) nor does the tens value (because the conditional process broke at the hundreds place.
A little confusing to explain in print but its really simple in practice.
See this topic at GW where I explained most of the details of splitting and showing a variable for a CMS/CBS.
I'm not quite sure what Demicrassus is talking about but it really isn't complicated. It takes about 10(x) commands to do up a number display, where (x) is the number of place values you want to use.
author=Blitzen link=topic=1973.msg32353#msg32353 date=1221688183
I'm not quite sure what Demicrassus is talking about but it really isn't complicated.
It's complicated if you're new (I'm pretty sure he is). And you can just call me Demi, comrade.
author=Demicrusaius link=topic=1973.msg32297#msg32297 date=1221675706
If Variable "Digits" is two then:
If variable "HP" is twenty or above then:
Show picture 1 (first HP digit) subtract variable HP by twenty.
If variable "HP" is ten or above then:
Show picture 1 (first HP digit) subtract variable HP by ten. (etc)
Why. Would. You. Ever. Do. That.
author=AznChipmunk link=topic=1973.msg32372#msg32372 date=1221695726author=Demicrusaius link=topic=1973.msg32297#msg32297 date=1221675706
If Variable "Digits" is two then:
If variable "HP" is twenty or above then:
Show picture 1 (first HP digit) subtract variable HP by twenty.
If variable "HP" is ten or above then:
Show picture 1 (first HP digit) subtract variable HP by ten. (etc)
Why. Would. You. Ever. Do. That.
...I don't see what's wrong with that. It works just fine and only uses one variable. The coding didn't take long and wasn't tedious.
By subtracting like that you can get the next digit. In the example it moves from the tens place to the ones place.
Different strokes for different folks.
To answer the original question, there is no way to show numbers without coding pages and pages of show picture/move character commands EXCEPT if you use the message window.
What I did was find a program that will record macros (a sequence of keystrokes and mouse movements). Because the pattern of coding these events is repetitive, you could take advantage of this by making simple macros to help you (for example, you can make an event that will show a number, copy it, then paste it 99 more times; instead of going down the line and clicking on each one to edit the number you want to display, just hit a button with a recorded macro that will bring you right to the new number entry, like a find & replace option). It's a little too complicated to go into further detail, but if you understand the concept, it saves you a TON of time.
What I did was find a program that will record macros (a sequence of keystrokes and mouse movements). Because the pattern of coding these events is repetitive, you could take advantage of this by making simple macros to help you (for example, you can make an event that will show a number, copy it, then paste it 99 more times; instead of going down the line and clicking on each one to edit the number you want to display, just hit a button with a recorded macro that will bring you right to the new number entry, like a find & replace option). It's a little too complicated to go into further detail, but if you understand the concept, it saves you a TON of time.
author=Demicrusaius link=topic=1973.msg32401#msg32401 date=1221702159
...I don't see what's wrong with that. It works just fine and only uses one variable. The coding didn't take long and wasn't tedious.
By subtracting like that you can get the next digit. In the example it moves from the tens place to the ones place.
Different strokes for different folks.
There's a function in RM used for isolating individual digits. (Mod)
author=S. F. LaValle link=topic=1973.msg32658#msg32658 date=1221795919
To answer the original question, there is no way to show numbers without coding pages and pages of show picture/move character commands EXCEPT if you use the message window.
This isn't anything especially tedious anyways... I've tons this tons of times.
Numbers aside, the alternative is a health bar, which is a different evil. You'll have to make pictures for each increment of the health, and then a huge nest of conditionals to display each one. It's only slightly more tedious than what these people are talking about, but it's a lot more straightforward.
Actually, if you have the bar at the very edge, you can just slide the picture around. Then it's pretty simple.
author=AznChipmunk link=topic=1973.msg32660#msg32660 date=1221796862
This isn't anything especially tedious anyways... I've tons this tons of times.
Mine was pretty tedious because I was using charsets for the numbers, had to use two character events for 4-digit numbers, plus the afore-mentioned checks to make sure the leading zeros were removed. Not only that, but I had 8 of them (4 hp indicators, and 4 mp indicators) on screen at one time ;) It's a lot of cut-paste with minor changes, but a lot of changes. That's when the macro program became REALLY handy.
Pages:
1

















