Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: MSR5 on November 29, 2007, 04:18:00 pm

Title: The resistance
Post by: MSR5 on November 29, 2007, 04:18:00 pm
I am (after learning how to use xlib) making a RPG.  It is based in the year 2132, 5 years after Earth is invaded and humanity is enslave.  This RPG circles around 3 people in the underground revolution trying to free humanity. It will be like ROL3 but much faster, no magic, non-liner plot, and futuristic wepons. Right now I have 10% of the battle engin, but I am having troble with the menu(not the one using the menu function) :banghead:banghead.gif , is it posible that I can get some help for the possible programing of it.  Otherwise I will have a thermal nuclear meltdown in my head at my frusteration of trying to program it. :grr:mad.gif:flame:tresfache.gif
if everything goes ok I will be able to get pictures uploaded of the game play, but no promises
Title: The resistance
Post by: Speler on November 29, 2007, 04:23:00 pm
This can help you with your menus: http://tibasicdev.wikidot.com/custommenus

Sounds like a great project, I hope you have fun!
Title: The resistance
Post by: trevmeister66 on November 29, 2007, 04:57:00 pm
I wouldn't mind helping since it's basic + xLIB. Just let me know what to do.
Title: The resistance
Post by: nitacku on November 29, 2007, 05:11:00 pm
I'm pretty good at graphics using xLIB, so just let me know what you need ;)wink.gif
Title: The resistance
Post by: DJ Omnimaga on November 29, 2007, 06:27:00 pm
wow I don't see nitacku much anymore those days o.oblink.gif.

ANyway this will be kinda sci-fi like ROL3, right? I am curious about what you will come up with :)smile.gif
Title: The resistance
Post by: MSR5 on November 30, 2007, 12:49:00 pm
yes this will be like a sci-fi ROL3
anyway
how do you post images?
and after working for an hour i came up with this as the first part of the menu

also if part of the program has (...)* it means that i could not use or mimic the right symble

:real(0
:real(1,1,0,4,15,1,0,45,3,0,0,1
:real(1,1,16,4,11,1,0,34,3,0,0,1
:real(1,0,32,4,11,1,4,45,3,0,0,1
:real(1,0,48,4,12,1,4,33,3,0,0,1
:-11->X
:25->Y
:Lbl 1
:->A
Pt-on(X,Y,2
:If A (not equal)* 34
:Then
:Goto 2
:Else
:Y-16->Y
:If  Y<-23
:Then
:25->Y
Pt-Off(-54125+11,-23,2
:Goto 1
:Else
Pt-Off(x,(y+16),2
:Goto 1
:Lbl 2
:If A(does not equal) 25
:Then
:Goto 3
:Else
:Y+16->Y
:If Y>25
:Then
:-23->Y
Pt-Off(-54125+11,25,2
:Goto 1
:Else
Pt-Off(X,(Y-16),2
:Goto 1
:Lbl 3
:If A(does not equal)*105
:Then
:Goto 1
:Else
:prgmAA2

please if posible optimize theis since my brain is not working at the moment  :???:confus.gif
Title: The resistance
Post by: vuurrobin on November 30, 2007, 01:38:00 pm
there are a lot of if-then statements, but no ends O_Oshocked2.gif

don't put goto inside a if-then statement, they cause memory leaks.
Title: The resistance
Post by: MSR5 on November 30, 2007, 01:41:00 pm
any other ideas?
Title: The resistance
Post by: kalan_vod on November 30, 2007, 04:13:00 pm
QuoteBegin-MSR5+30 Nov, 2007, 18:49-->
QUOTE (MSR5 @ 30 Nov, 2007, 18:49)
how do you post images?

QuoteBegin-MSR5+30 Nov, 2007, 18:49
-->
QUOTE (MSR5 @ 30 Nov, 2007, 18:49)
how do you post images?

Upload your image to a host (I like http://imageshack.us, but others like photobucket), after uploading you can make a post containing the following:
c1
-->
CODE
ec1(http://url-to-image.com/image.gif)
also imageshack will have other options to post larger images as thumbnails that will show full if clicked on.c2
ec2
Title: The resistance
Post by: vuurrobin on December 01, 2007, 03:01:00 am
QUOTE
:->A


I asume that should be getkey->A

second, look http://tibasicdev.wikidot.com/controlflow#toc7 and learn how to use loops like while and repeat. also learn how to use boolean logic, you are going to need them.


since there isn't an animation or grayscale picture or anything when you wait for the user to press a key, you can put that in a loop so key detection will be faster.

:repeat ans
:getkey->A
:end


instead of checking if the user didn't press a key, you should check if he/she did press that key.

so this:

c1
-->
CODE
ec1:If A (not equal)* 34
:Then
:Goto 2
:Else
:Y-16->Y
:If Y<-23
:Then
:25->Y
Pt-Off(-54125+11,-23,2
:Goto 1
:Else
Pt-Off(x,(y+16),2
:Goto 1c2
ec2

can become this

c1
-->
CODE
ec1if A=34
then
Y-16->Y
If ans<-23
Then
25->Y
Pt-Off(-54125+11,-23,2
Else
Pt-Off(x,y+16,2
end
endc2
ec2

you can do the same for when the user presses up.


since you want the menu to keep running until the user presses [enter], you can use a repeat loop for that.


c1
-->
CODE
ec1
repeat A=105

menu code

end

code for if the user has pressed [enter]c2
ec2


since repeat will always be executed at least once, we don't have to worry about what value A is when it enters the loop.


so the code currently looks like this:

c1
-->
CODE
ec1
real(0
real(1,1,0,4,15,1,0,45,3,0,0,1
real(1,1,16,4,11,1,0,34,3,0,0,1
real(1,0,32,4,11,1,4,45,3,0,0,1
real(1,0,48,4,12,1,4,33,3,0,0,1
-11->X
25->Y
repeat A=105
Pt-on(X,Y,2
repeat ans
getkey->A
end
if A=34
then
Y-16->Y
If ans<-23
Then
25->Y
Pt-Off(-54125+11,-23,2
Else
Pt-Off(x,y+16,2
end
end
if A=25
then
Y+16->Y
If ans>25
Then
-23->Y
Pt-Off(-54125+11,25,2
Else
Pt-Off(x,y-16,2
end
end
end
prgmAA2c2
ec2

it can still be optimised some more (mainly using boolean logic) but make sure that you understand this and that you can use it. there is no need to rush it ;)wink.gif

good luck with this  :)smile.gif


Title: The resistance
Post by: MSR5 on December 01, 2007, 03:17:00 am
Thanks this helps with some of the problems
Title: The resistance
Post by: Liazon on December 01, 2007, 11:04:00 am
yay for more RPGs!
Title: The resistance
Post by: MSR5 on December 01, 2007, 02:41:00 pm
thanks for the enthusiasm, but it would be nice if everyone could contribute also like vuurrobin did
Title: The resistance
Post by: DJ Omnimaga on December 01, 2007, 06:51:00 pm
well I try to contribute whenever I can or have the time, but when I can I at least give some feedback  
Title: The resistance
Post by: trevmeister66 on December 01, 2007, 06:53:00 pm
You could also give us some more code to try to optimize..

EDIT: Here is vuurrobin's code a little more optimized.

c1-->
CODE
ec1real(0
real(1,1,0,4,15,1,0,45,3,0,0,1
real(1,1,16,4,11,1,0,34,3,0,0,1
real(1,0,32,4,11,1,4,45,3,0,0,1
real(1,0,48,4,12,1,4,33,3,0,0,1
-11->X
25->Y
Repeat A=105
Pt-on(X,Ans,2
repeat max(Ans={25,34,105
getkey->A
End
Pt-Off(X,Y,2
Y-16(A=34)+16(A=25
Ans+32(Ans<23)-32(Ans>25->Y
End
prgmAA2c2
ec2
Title: The resistance
Post by: MSR5 on December 02, 2007, 08:49:00 am
thanks so much :gift:party3.gif
this should cut down the mem my menu takes up
i'll try to get out a demo of the game by the end of the month, but no guarantee  
Title: The resistance
Post by: trevmeister66 on December 02, 2007, 10:33:00 am
Haha sweet, a new year's present  :Ptongue.gif Take your time, and don't rush anything.  
Title: The resistance
Post by: vuurrobin on December 02, 2007, 12:40:00 pm
QUOTE
this should cut down the mem my menu takes up


just make sure that you learn from it and that you understand the code, because you will need this stuff for more things than just the menu  ;)wink.gif

(thats why I didn't optimise it further, because I thought it would be to much in 1 time. well that and I didn't had time :Ptongue.gif )

to optimise it even further, chance this

:Y-16(A=34)+16(A=25
:Ans+32(Ans<23)-32(Ans>25->Y

into this

:Y-16((A=34)+(A=25
:Ans+32((Ans<23)-(Ans>25->Y


can't wait to try the demo
Title: The resistance
Post by: MSR5 on December 02, 2007, 05:06:00 pm
thanks for helping so much for the menus
progress so far

i have most of the needed pics for containing the parts for the tile map
they are 16 by 16
i have multiple ones for gs
i have the out lines for the to be maps on graph paper
the battle engine is now 15 percent done

i will keep posting updates every week
Title: The resistance
Post by: DJ Omnimaga on December 02, 2007, 07:22:00 pm
Cool! As for grayscale you may want to check out CDI's grayscale tutorial in Downloads->Our programs->TI programming tools sections. It may help a bit  
Title: The resistance
Post by: MSR5 on December 03, 2007, 01:27:00 pm
thanks for the tutorial
i'am of to several hours of undisturbed programing time
Title: The resistance
Post by: bfr on December 03, 2007, 03:46:00 pm
QuoteBegin-MSR5+2 Dec, 2007, 13:49-->
QUOTE (MSR5 @ 2 Dec, 2007, 13:49)
i'll try to get out a demo of the game by the end of the month, but no guarantee  

 Please do!  I'm looking forward to this!  :Dbiggrin.gif

(Not to put any pressure on you..take your time if you need it)