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 Your Projects 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. Final Fantasy => Your Projects
Author Message
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 08 Mar 2004 07:44:04 pm    Post subject:

here are some code snippets from final fantasy, which is coming along sloooowly, as i have other things to do


first is the 2 player code, so far it finds the enemy's name, and stores it seperate from yours, and can detect when the other calc hits the "attack" button.


Code:
1->LSTAT(41)
Goto P0
End
If K=93
Then
Goto P1
End
End

Lbl P0
For(Z,5,9
While Z

GetCalc(LSTAT(40)

If LSTAT(40)=92
Then
0->M
For(Z,5,7
While Z
Output(1,1,"ATTACKED"
If LSTAT(7)=0
Then
54->H
24->L
Pt-On(H,L
Pt-On(H+1,L
Pt-On(H,L-1
Pt-On(H+1,L-1
Pt-On(H+1,L-1
Pt-On(H+1,L-2
Pt-On(H+1,L-1
Pt-On(H+2,L-2
Pt-On(H+2,L-3
Pt-On(H+3,L-2
Pt-On(H+4,L-3
Line(H+6,L-1,H+1,L-6
Line(H+9,L+10,H+3,L-4
Line(H+10,L-9,H+4,L-3
Pt-On(H+10,L-10
M+1->M
If M=2 or M=3:Then:H+1->H:L+1->L:End

End
End
LSTAT(2)-L1(5)->LSTAT(2
ClrHome
Output(1,1,"GOT HIT FOR",L1(5)
Goto P2
End
If LSTAT(40)=93
Then
Output(4,5,"ATTACKED BY MAGIC"
Pause
End

Lbl P2
ClrHome
ClrDraw
Text(1,30,Str0,"'S STATS"
Text(9,5,"HP-",LSTAT(2),"/",LSTAT(1),"            ATTACK-",LSTAT(5)
Text(18,5,"MP-",LSTAT(4),"/",LSTAT(3),"        DEFENCE-",LSTAT(4)
Text(30,25,Str1,"'S STATS
Text(40,5,"HP-",L1(1),"/",L1(2),"                ATTACK-",L1(5)
Text(48,5,"MP-",L1(3),"/",L1(4),"              DEFENCE-",L1(6)

Pause
Goto P1




Lbl P1
GetCalc(L1(1)


Output(4,5,"YOUR TURN
Pause
ClrHome

For(Z,5,7
RecallPic 1
While Z
getKey->LSTAT(40)
If LSTAT(40)=92
Then
Output(1,1,"ATTACK"
Pause
Goto P1
End
If LSTAT(40)=93
Then
Output(1,1,"MAGIC"
Goto P1
End

End




And here is the main charecter as a teen, my art style follows Akira Toryama sensei's art


Code:
ClrDraw
Pt-On(7,45
Pt-On(6,45
Pt-On(5,44
Pt-On(4,45
Pt-On(15,44
Pt-On(14,45
Pt-On(13,44
Pt-On(12,45
Pt-On(11,45
Pt-On(11,44
Pt-On(12,43
Pt-On(6,43
Pt-On(7,44
Pt-On(4,45
Pt-On(3,44
Pt-On(16,57
Pt-On(16,56
Pt-On(17,55
Pt-On(1,55
Pt-On(0,55
Pt-On(0,54
Pt-On(9,60
Pt-On(10,59
Pt-On(10,58
Pt-On(9,57
Pt-On(8,57
Pt-On(8,59
Pt-On(8,58
Pt-On(7,56
Pt-On(6,56
Pt-On(6,52
Pt-On(7,52
Pt-On(9,50
Pt-On(8,51
Pt-On(9,52
Pt-On(8,53
Pt-On(8,54
Pt-On(10,53
Pt-On(10,54
Pt-On(11,56
Pt-On(12,56
Pt-On(11,52
Pt-On(12,52
Line(18,55,18,53
Line(17,52,11,46
Line(11,46,7,46
Line(7,46,0,53
Line(16,50,16,44
Line(2,44,2,50
Line(3,51,3,55
Line(2,54,7,59
Line(11,59,16,54
Line(15,54,15,51
Line(10,48,8,48
Line(13,61,10,61
Line(13,61,16,58
Line(8,61,5,61
Line(5,61,2,58
Line(2,58,2,56
Line(5,55,5,53
Line(13,55,13,53



what i would like though is some code for a program that puts lists into strings, then strings to graphscreen, i know there was a topic on it some time ago, i cant find it though


Last edited by Guest on 08 Mar 2004 07:49:27 pm; edited 1 time in total
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 10 Mar 2004 03:09:18 pm    Post subject:

guys! i made this graphical engine that uses PXL-TEST and only 4 if statements! ill post code when i get home (1.5 hours)


Note- if this is common knowledge again, dont laugh!
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 10 Mar 2004 05:13:09 pm    Post subject:

Quote:

Code:
ClrDraw
Pt-On(7,45
Pt-On(6,45
Pt-On(5,44
Pt-On(4,45
Pt-On(15,44
Pt-On(14,45
Pt-On(13,44
Pt-On(12,45
Pt-On(11,45
Pt-On(11,44
Pt-On(12,43
Pt-On(6,43
Pt-On(7,44
Pt-On(4,45
Pt-On(3,44
Pt-On(16,57
Pt-On(16,56
Pt-On(17,55
Pt-On(1,55
Pt-On(0,55
Pt-On(0,54
Pt-On(9,60
Pt-On(10,59
Pt-On(10,58
Pt-On(9,57
Pt-On(8,57
Pt-On(8,59
Pt-On(8,58
Pt-On(7,56
Pt-On(6,56
Pt-On(6,52
Pt-On(7,52
Pt-On(9,50
Pt-On(8,51
Pt-On(9,52
Pt-On(8,53
Pt-On(8,54
Pt-On(10,53
Pt-On(10,54
Pt-On(11,56
Pt-On(12,56
Pt-On(11,52
Pt-On(12,52
Line(18,55,18,53
Line(17,52,11,46
Line(11,46,7,46
Line(7,46,0,53
Line(16,50,16,44
Line(2,44,2,50
Line(3,51,3,55
Line(2,54,7,59
Line(11,59,16,54
Line(15,54,15,51
Line(10,48,8,48
Line(13,61,10,61
Line(13,61,16,58
Line(8,61,5,61
Line(5,61,2,58
Line(2,58,2,56
Line(5,55,5,53
Line(13,55,13,53

Put those in a list and do

Code:
For(I,1,whatever
Pt-On(L1(I),L2(I
End
For(I,1,whatever2
Line(L3(I),L4(I),L5(I),L6(I
End
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 10 Mar 2004 07:24:17 pm    Post subject:

yea but lists are big, the most ive found to get in it are 999, that isnt enough for most screens, here is that code



Code:
50->A
50->B
While Z(does not = )1000
getKey->K

If K=24
Then
B-1->B
pxl-Test(A,B->C
If C=1
Then
B+1->B
Pxl-On(A,B
End
End


If K=26
Then
B+1->B
pxl-Test(A,B->C
If C=1
Then
B-1->B
Pxl-On(A,B
End
End


If K=25
Then
A-1->A
pxl-Test(A,B->C
If C=1
Then
A+1->A
Pxl-On(A,B
End
End


If K=34
Then
A+1->A
pxl-Test(A,B->C
If C=1
Then
A-1->A
Pxl-On(A,B
End
End
Pxl-On(A,B
End

has this been done before in an RPG, i think i have seen it talked about before, but have never seen actual code till mine
Back to top
nether fish


Newbie


Joined: 04 Feb 2004
Posts: 5

Posted: 10 Mar 2004 08:52:10 pm    Post subject:

Quote:
If K=24
Then
B-1->B
pxl-Test(A,B->C
If C=1
Then
B+1->B
Pxl-On(A,B
End
End


you can optimize it a lil more by doing something like this...

Quote:
B-1(K=24)->B
pxl-Test(A,B->C
B+1(-C=1)->B
Pxl-On(A,B
End
End


that should work... but i havent tested it.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 11 Mar 2004 05:08:23 pm    Post subject:

If one list isn't enough for a screen, maybe you should use a pic for that screen.
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 11 Mar 2004 08:22:24 pm    Post subject:

there is only 10 pics, and alot of screens Laughing
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 12 Mar 2004 05:00:30 pm    Post subject:

Beg to differ... there are actually 255 pics.

And using asm you can store pics to programs and it will only take about 800 bytes per screen, close to a pic.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 12 Mar 2004 05:51:06 pm    Post subject:

using ASM you could (theoretically) store a pic to Str1 if you really wanted... you could just store the pic to a prgm file (same syntax...)
Back to top
X1011
10100111001


Active Member


Joined: 14 Nov 2003
Posts: 657

Posted: 12 Mar 2004 07:32:09 pm    Post subject:

You could have an ASM program with compressed pic data in it that would display them.
Back to top
Notepad_Gamer


Newbie


Joined: 29 Jan 2004
Posts: 36

Posted: 12 Mar 2004 08:52:09 pm    Post subject:

To optemize your code, you replace

While Z(does not = ) 1000

with

Repeat Z=1000

Anyway, IF statements are icky in my view, especially if within a loop. I would use something like this, putting IFs outside the loop.:

Repeat Z=1000
Repeat K
getkey->K
End
If K=24
(some code)
If K=??
(some code)
End
Back to top
Babyboy


Advanced Member


Joined: 11 Jun 2003
Posts: 499

Posted: 12 Mar 2004 10:49:51 pm    Post subject:

here is the modified code for that, with built in code for nit going off the screen


Code:
50->A
50->B
Pxl-On(A,B
Pxl-On(A+1,B

Pxl-On(A+2,B-1

Pxl-On(A+2,B-1
Pxl-On(A+2,B+1
Pxl-On(A-2,B

Pxl-On(A,B+1
Pxl-On(A,B-1


Repeat Z=1000
getKey->K

If K=24 and B-3>0
Then
pxl-Test(A,B-3->C
If C=0 and B-3÷93
Then
Pxl-Off(A,B
Pxl-Off(A+1,B
Pxl-Off(A+2,B-1
Pxl-Off(A+2,B+1
Pxl-Off(A-2,B
Pxl-Off(A,B-1
Pxl-Off(A,B+1
B-3->B
End
End


If K=26 and B+3<94
Then

pxl-Test(A,B+3->C
If C=0 and B+3÷92
Then
Pxl-Off(A,B
Pxl-Off(A+1,B
Pxl-Off(A+2,B-1
Pxl-Off(A+2,B+1
Pxl-Off(A-2,B
Pxl-Off(A,B-1
Pxl-Off(A,B+1
B+3->B
End
End


If K=25 and A-3>1
Then
pxl-Test(A-3,B->C
If C=0 and A÷63
Then
Pxl-Off(A,B
Pxl-Off(A+1,B
Pxl-Off(A+2,B-1
Pxl-Off(A+2,B+1
Pxl-Off(A-2,B
Pxl-Off(A,B-1
Pxl-Off(A,B+1
A-3->A
End
End


If K=34 and A+3<60
Then
pxl-Test(A+3,B->C
If C=0
Then
Pxl-Off(A,B
Pxl-Off(A+1,B
Pxl-Off(A+2,B-1
Pxl-Off(A+2,B+1
Pxl-Off(A-2,B
Pxl-Off(A,B-1
Pxl-Off(A,B+1
A+3->A
End
End



Pxl-On(A,B
Pxl-On(A+1,B

Pxl-On(A+2,B-1

Pxl-On(A+2,B+1
Pxl-On(A-2,B

Pxl-On(A,B+1
Pxl-On(A,B-1


End
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement