This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-Freak8x subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Pokemon Purple => TI-Freak8x
United-TI Archives -> Pokemon Purple
 
    » Goto page Previous  1, 2, 3, 4, 5, 6  Next
» View previous topic :: View next topic  
Author Message
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 04 May 2011 09:39:11 am    Post subject:

Nice! So I take it you have kind of wrapped your mind around how to switch during battle? Is it like swapping list data or something?
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 04 May 2011 03:05:59 pm    Post subject:

A little bit of that goes on, but not really all that much.

Basically what's going to happen is when a battle is initiated, it creates a second list that contains the Party order and shoves it off to the side so it can mess around with the party order list. Then when a pokemon is switched out, it will store the important changes to the main list (IE HP, PP changes, status changes) and move it back into it's normal stats list. It will then change numbers around inside the new party list, and call the pokemon that is in the first slot, since it gets moved there once you use the PKMN option. Once the battle is won, it just recalls the saved Party list and dumps it back into the normal list, and deletes the back up.

The only thing I'm not sure as of yet is how to do the exp bit for multiple pokemon. It is something I'm working on.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 04 May 2011 03:19:11 pm    Post subject:

Okee, here is an idea for some code then... If each Pokémon has a fixed number of elements for data (As in, say 16 elements each), then you could make it so that if the first element is the current health and B was the party number (0=1st, 1=2nd, et cetera), then to access the health of the currently active pokémon, you could do L1(16B+1). As for a method of determining multiple experience, you could make a six element list and at the beginning of the battle reset each element. If a Pokémon makes an appearance in battle, simply set that list element to 1. Then, after the battle, if total experience gained is in the Y, you could do:

Code:
Y/sum(L2
If fPart(Ans
1+iPart(Ans
AnsL2→L2

And from there you have the experience in L2 (or whatever list) that each pokémon receives.
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 04 May 2011 09:22:23 pm    Post subject:

Well, each stat list is 56 elements in size (lots of things to keep track of per pokemon!) And I was thinking about making the party list just add to it. Any # after 6 is going to be pokemon that were involved with the battle. The problem stems from which of the pokemon do I use to determine experience gained? The one with the lowest level, or the one that defeated the pokemon? I'm pretty sure it's the last fighting pokemon that kicked butt and took names, and then it is spread out over the pokemon involved. Probably going to be the easiest solution to this whole dilemma.

I think..

Maybe. xD
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 04 May 2011 11:07:26 pm    Post subject:

In the game it is split up evenly among all participants in battle. If you used the idea of the 6 element list (well, made to fit in with the program), if you include the Exp All item, then you just use something like L2+1→L2 before calculations.
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 05 May 2011 03:54:24 am    Post subject:

Yeah, I just need to set up a list or variable that is continuously 'set' when EXP ALL is in the inventory. I still have so many little things like that to do in the game it isn't funny x.x
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 05 May 2011 06:35:55 am    Post subject:

Yeah, Pokémon is a packed game x.x Still, you have made a ton of progress!
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 05 May 2011 08:10:25 am    Post subject:

Why thank you! :lol:

I don't know if you have/follow twitter, I just posted up the list of variables I am using (so far, I am sure there are things I need to add to it).

http://tifreakware.net/forum/viewtopic.php?f=5&t=36&p=223#p223

I hope I can get left alone from things this evening so I can make some progress on this switch out system. Need to write out the steps it needs to take so I can write out the code so I can dump it into the calc and test!
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 16 May 2011 07:07:08 am    Post subject:

So, some good news. I've gotten through the code for ZPP and I've managed to figure out where to insert the code for switching out pokemon in battle and have even managed to get a bit written down on paper, code wise. I don't seem to have the code written out for ZMISC, which houses the code for the stats screen, so I need to deal with that yet so I can make sure there are no conflictions within that code and ZPP for the switch out. Once the stats bit is done, then I just have to write the switch out code, which will constitute storing the important date from L_1 to the correct LP# depending on the first active slot in L_PRTY. Then from that point, I pull the next slot over and dump that into L_1, then bring back the battle screen, erase the pokemon and HP data, then redraw it, then allow the enemy to attack. (For testing purposes, I'm just going to have 'Enemy attacks!' and might even have it deal 1 pt of damage to try to work out the hp bar going down.)

I actually just had an idea to that end as well. First I calculate the length of that line, and store that to a variable. Then I calculate the damage and recalculate the line the length. Then it's just a matter of using the Line(#,#,#,#,0 with the two values obtained, should allow to subtract the damage part of the hp bar without needing to clear it out and re-rendering it.
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 27 May 2011 07:28:45 am    Post subject:

I've made some more progress, I've essentially gotten it to the point where I need to return control of the game back to the battle gui program. I still need to have it do attacks, but I think I will just have it do "NAME attacks NAME" and have the damage meter go down by 1 or 2 or something random from 1-5.

I also saw this morning that I made the hp bars 1 pixel too short, so I've fixed that in the code, and moved the storing of Pic 2 in the battle GUI to Pic 1 and put it before it displays the text for the menu.

And I consolidated the code for displaying the HP bar (that shows you how much hp the pokemon has, not the border around it) from


Code:
L1(1)/L1(2)->G
(G_E2)/4->G
Line(65,25,65+G,25


To


Code:
Line(65,25,65+(.25iPart(_E2(L1(1)/L1(2)))),25


Hopefully will have this code finished and incorporated into where it should be before too much longer. Then testing to see how badly I screwed things up and see if it is fixable Razz
Back to top
DigiTan
Unregistered HyperCam 2


Super Elite (Last Title)


Joined: 10 Nov 2003
Posts: 4468

Posted: 28 May 2011 03:50:28 pm    Post subject:

Cool progress! I swear these RPG projects are never-ending. Razz
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 30 May 2011 08:18:03 pm    Post subject:

You've got that right x.x

I've got the code written out now to do the switch out during battles, it's just getting it put in the correct spot that has become somewhat tricky. Working on it though!
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 22 Jun 2011 07:47:37 pm    Post subject:



Oh yeah, now we're getting somewhere! :D

edit:



Managed to fix a few things with that, mostly 'cosmetic' bits


Last edited by Guest on 22 Jun 2011 08:45:31 pm; edited 1 time in total
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 24 Jun 2011 11:21:51 am    Post subject:

Update:



What this adds over the previous screenshot is now it detects if the pokemon you are trying to send out is the same one that is already out or not.

I've fixed the problem with Cancel being used to exit the party screen, that just now cancels out of the menu you are in. This also helps by rearchiving the lists since you don't need those all the time.

The program also cleans up after itself by eliminating 2 Pic vars upon exiting the party screen. I do believe I need to have it delete a list or two though, as well.
Back to top
cch


Newbie


Joined: 25 Jun 2011
Posts: 4

Posted: 25 Jun 2011 09:58:12 pm    Post subject:

A small suggestion:
Since it appears all of this is being done on the graph screen, instead of using a Line() to wipe the text box and erase the Pokemon from the field during switching, try a code similar to the following:

Text(-1,47,4," "):Text(-1,52,4," ")
(Note that it's 14 spaces between the quotes)
This will white out the entire box and will do it in two shots rather than a whole wipe with Line(). A tweak of the number of spaces and the coordinates of the text target will allow you to wipe Pokemon images or the HP area or any other thing. Note that using -1 before the coords in Text() will write text using the larger font you'd use on the home screen. If you leave the -1 out, it'll do the smaller text, which then you can treat a space as one pixel and wipe 6 pixels high worth of image, so basically using the smaller text, you can wipe a block sized equal to number of spaces wide by 6 pixels tall. Using the larger font is a fixed width, so each space will wipe 6x7 spaces.

I'm not sure if this would be more or less code than your current method, but it's definitely faster.
I would guess currently you use something along the lines of:

For(θ,2,19):Line(2,θ,92,θ,0):End

This would cost 23 bytes, while my code would cost 43 bytes. You could probably leave out the ending ") on each line and save a few bytes, or do some kind of loop to make it use less space, but as far as speed goes, I think this is your best bet.
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 26 Jun 2011 03:54:39 pm    Post subject:

Yeah, I definitely know about that trick. I just don't do it because I prefer the smoothness that a For loop and Line provide. It's not like it takes horridly long to go through that loop either.
Back to top
cch


Newbie


Joined: 25 Jun 2011
Posts: 4

Posted: 26 Jun 2011 04:22:25 pm    Post subject:

The smoothness is nice, but I guess personally I like just getting rid of the text as quickly as possible. Using the code I posted will appear to the player as a near instant wipe rather than a wipe that takes a couple seconds.

Anyway, I'm new on the forum and I guess I needed to make a post somewhere before I'm allowed to make my own topics, so I figured I'd try to help since I'm a big fan of Pokemon.
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 26 Jun 2011 07:31:58 pm    Post subject:

The thought is definitely appreciated. If I were to change to the Text( bit, I would have a LOT to change, since I use the smooth scrolling bit pretty much everywhere in the game, and it's pretty big.

also, an update:

I've managed to kill off bugs relating to the Run option in the battle gui.



Edit:

Also, welcome to the forums!


Last edited by Guest on 26 Jun 2011 07:39:06 pm; edited 1 time in total
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 13 Jul 2011 06:54:27 am    Post subject:

As some know, I attempted to test out the items system, only to discover there isn't enough RAM to complete the task. I've done some code moving from the party display program into an appvar. I then took that program, and for every instance of a Z=#, the conditional was removed and all the code that was in the If Then End block was put onto one line. I know what 3 of the 4 lines of code are for, I'm still working on determining exactly what the last one is. The appvar is now sitting at 4601 bytes, it removed well over 1k from the party display program. There is considerable amount of work that needs to be completed yet, though I will get done what I can as I can, and hopefully I will make it so that it is playable once again.

I also think I can easily archive the picvar that is used to save the state of the battle screen as well, and unarchive it when it is needed again, that will save some used memory as well.
Back to top
tifreak8x


Elite


Joined: 27 Aug 2005
Posts: 956

Posted: 22 Jul 2011 06:42:23 am    Post subject:

Managed some progress with getting the battle system to work again after it mysteriously stopped working. Still no idea what the problem was. Anyways, Use of Antidote now works so long as it is on a Pokemon that is in battle. It currently does nothing to the other Pokemon in the party, and I'm not sure why as of yet. I've got a few things to try to see if I can't make it work. I also need to make it subtract the amount from the Item list properly.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2, 3, 4, 5, 6  Next
» View previous topic :: View next topic  
Page 4 of 6 » All times are UTC - 5 Hours

 

Advertisement