CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 99 users online: 2 members, 72 guests and 25 bots.
Members: woukabouter.
Bots: Magpie Crawler (4), Googlebot (20), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
    » Goto page 1, 2, 3 ... 12, 13, 14  Next
» View previous topic :: View next topic  
Author Message
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 28 Mar 2012 07:33:20 am    Post subject: [Pokemon Purple] Progress 2012

Ordered list of getting the HP bars to increase on the party screen:

1) Calculate current HP %, *100, /4. Add value to 3+52(Z>3), store to var1.

2) Increase HP via potion or other item, check HP does not exceed HPmax.

3) Calculate new HP %, *100, /4. Add value to 3+52(Z>3), store to var2.

4) For loop with var1,var2 to increase hp bar.

I've started writing out the code for it, hopefully will have it done soonish. It's going to be another bit of code that will be a pain in the butt to write.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.


Last edited by tifreak8x on 20 Jan 2013 11:03:00 am; edited 1 time in total
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 28 Mar 2012 08:10:02 am    Post subject:

At last, a 2012 topic! Very Happy And only one-quarter of the year gone first. Wink What about those items is particularly challenging, would you say? Also, what are you picking for var1 and var2?
_________________


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 28 Mar 2012 08:26:04 am    Post subject:

There HAS been a 2012 topic, just on TI-Freakware, where no one goes :p

The hardest part is just writing this dynamic bit of code so it can fill in the proper bar and all that.

The first line of code for it is "|LP"+sub("123456",Z,1)->Str7. This basically gives you which |LP# list you're working with. So you have to build the whole string of code around that, which is fun.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 11 Apr 2012 06:51:18 am    Post subject:


Code:
"|LP"+sub("123456",Z,1)->Str7
4->theta:"ZTEMP"->Str0:prgmZCE
3->theta:prgmZCE
Str7+"(2)/"+Str7+"(1)"+sub(Str9,1,1)+"|N:"+Str7+"(1)"+sub(str9,1,1)+"X:"+Str7+"(2)"+sub(Str9,1,1)+"Z:If X
+200<Z:200"+sub(Str9,1,1)+"J:If X+200>Z:Z-X"+sub(Str9,1,1)+"J:(X+J)/Z"+sub(Str9,1,1)+"I%:


That's what I have thus far to get it so it will increase the HP bar and values at the same time.

I'm still at a loss on whether I should loop through with a For( loop and recalculate the length of the hp bar through each pass or figure out some other way of doing things. Trying to be as memory efficient as possible while still being completely dynamic.


Edit:

After some thought, I'm thinking about removing the numerical values of HP/HPMax shown on the party screen. This would shrink the program a small amount, allow the display to be faster, and would make it easier to change the HP values on that screen via just updating the bar instead of doing both bar and numbers. Thoughts?
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
Compynerd255


Power User


Joined: 08 Apr 2011
Posts: 397

Posted: 11 Apr 2012 09:22:13 am    Post subject:

tifreak8x wrote:

Edit: After some thought, I'm thinking about removing the numerical values of HP/HPMax shown on the party screen. This would shrink the program a small amount, allow the display to be faster, and would make it easier to change the HP values on that screen via just updating the bar instead of doing both bar and numbers. Thoughts?

I can see the reasoning for that. However, I think that people might like to see HP numbers simply to know how powerful their Pokemon are and exactly how effective their Potions and things will be. For the latter case, I'd recommend that when you are using a health restoring item on the Party screen, you show a blinking extension of the health bar as a preview of how much health the item will heal.
_________________
Visit Betafreak Games: http://www.betafreak.com
Help Me Pay for College:
- Sign up for Fastweb through my referal link!
Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 11 Apr 2012 09:24:36 am    Post subject:

As much as I'd like to offer that, that would be beyond difficult for my current set up to do, since I have to keep the lists in archive. I'll keep the numbers, then, and find a way to update both numbers and bar at the same time.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 16 Apr 2012 07:12:47 am    Post subject:

So, I guess I should update here that I've mostly thought of a way to update both the numbers and bar at the same time. I just have to figure out how to do the equation properly for a conditional to know when to increment the bar. I might end up just cheating and using additional variables to increment and every nth one, increment the bar.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 16 Apr 2012 08:44:10 am    Post subject:

tifreak8x wrote:
So, I guess I should update here that I've mostly thought of a way to update both the numbers and bar at the same time.
Of course you should! What was that way?
Quote:
I just have to figure out how to do the equation properly for a conditional to know when to increment the bar. I might end up just cheating and using additional variables to increment and every nth one, increment the bar.
Well, if you're using lines for the bar, you can simply draw out the lines' length as BAR_LENGTH*(CUR-MIN)/(MAX-MIN), where the value being measured has current, minimum, and maximum values CUR, MIN, and MAX. If you're using pixels, and you only want to update the bar when it will show another column of dark pixels, say for example that your variable range is 0-100 and the bar is 50 pixels long. You would want to update it when not(fPart(X/2.
_________________


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 16 Apr 2012 08:53:57 am    Post subject:

Well, the bar is 25 pixels in length. The idea is to store hp, hpmax, hpgained, curbarlength, newbarlength, barlengthgained and pixelperhp in separate variables. Then in a For( loop, where I'm incrementing from hp,hp+hpgained, every nth value hp goes up in the loop, it increments the bar by one pixel. It doesn't have to do anything fancy with it beyond that point, because if you go back to the party screen again, it will recalculate and display that stuff brand new.

I hope this makes sense Neutral

Also, I thought about that, but I'm not sure that will work correctly.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 16 Apr 2012 09:42:03 am    Post subject:

I'd say it's unnecessary to store newbarlength, barlengthgained, and pixelperhp anywhere. I'd probably just turn on the next pixel, in this case, any time you increment the health, as BASE_COLUMN+25*(hp/hpmax); there's nothing wrong with turning on the same pixel multiple times. Smile
_________________


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 16 Apr 2012 10:22:07 am    Post subject:

But it would slow down the whole process every time it ran through that equation, though. Not working with asm here :p
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 16 Apr 2012 10:44:39 pm    Post subject:

tifreak8x wrote:
But it would slow down the whole process every time it ran through that equation, though. Not working with asm here :p
It would only need to update the HP bar every once in a while anyway, imho; I think the conditional to decide whether to re-draw it or not would be more overhead than just going ahead and drawing.
_________________


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 17 Apr 2012 01:04:04 pm    Post subject:

Well, I guess I can try it both ways in their own programs and see what happens. Would be the best to get down what is faster than what.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 17 Apr 2012 01:07:49 pm    Post subject:

tifreak8x wrote:
Well, I guess I can try it both ways in their own programs and see what happens. Would be the best to get down what is faster than what.
But really, how often are you redrawing the HP bars? It's not like it's inside the getKey loop or something. I feel like it wouldn't be worth your time and headaches to worry too much about the extra millisecond every dozen seconds.
_________________


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 18 Apr 2012 04:05:49 am    Post subject:

I'll write the code up to do that, then, and throw it in its own program to see what it looks like.

Edit:

What I've written so far to test, hopefully it works the first time, once I make it look like a normal program.


Code:
X - HP
V - HPMax
I -
J - Points healed


"|LP"+sub("123456",Z,1)->Str7
4->theta:"ZTEMP"->Str0:prgmZCE
3->theta:prgmZCE
+Str7+"(1)"+sub(str9,1,1)+"X:"
+Str7+"(2)"+sub(Str9,1,1)+"V:
For(F,X,X+J
Text(Text(7+21(Z!=4 and Z>1)+21(Z=3 or Z=6),(2+52(Z>3))+4(2-int(log(F))),F:
iPart((|E2(X/V)).25"+sub(Str9,1,1)+"K:
47(Z=1 or Z=4)+26(Z=2 or Z=5)+5(Z=3 or Z=6"+sub(Str9,1,1)+"F:
Line(2+52(Z>3)+1,F,(C+1)+K,F:
End

_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 18 Apr 2012 10:04:59 am    Post subject:

Is that nested Text a typo or some amazing technique that I've never seen before? Smile
_________________


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 18 Apr 2012 10:06:34 am    Post subject:

Oh, whoops. Yeah, a typo on my part. Not really sure how that happened, but I was half asleep when typing that code up 0x5
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55741
Location: Earth, Sol, Milky Way

Posted: 18 Apr 2012 10:09:16 am    Post subject:

tifreak8x wrote:
Oh, whoops. Yeah, a typo on my part. Not really sure how that happened, but I was half asleep when typing that code up 0x5
Fair enough. Smile Other than that, though, that looks like very tight code; I hope it works.
_________________


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 19 Apr 2012 06:15:09 pm    Post subject:

Quote:
[19:14] <Weregoose> Just wanted to throw this at you: 47(Z=1 or Z=4)+26(Z=2 or Z=5)+5(Z=3 or Z=6) == 68-21(Z-3(Z>3))


note to self.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9060
Location: Sol System

Posted: 25 Apr 2012 03:26:51 pm    Post subject:

So, here are a few screenshots:



These two screenshots above show, in a perfect world when the amount of HP_Gain is either increased by 1 or increased by 5, with the HP_Gain being 200.



Now the above two show what happens when you have an HP_Gain of a non divisible by 5 number, 74. Because everything is wrapped in a For( loop, it doesn't complete the loop properly.

I'm thinking about possible fixes right now, because doing it by +5 is an obvious need, because +1 just takes a long time with larger values. :/

Thoughts on the screenshots?
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
Display posts from previous:   
    » Goto page 1, 2, 3 ... 12, 13, 14  Next
» View previous topic :: View next topic  
Page 1 of 14 » All times are GMT - 5 Hours

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.041717 seconds.