Author Topic: [83+ BASIC]RPG topics  (Read 5364 times)

0 Members and 1 Guest are viewing this topic.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ BASIC]RPG topics
« on: August 12, 2006, 06:21:00 pm »
I am posting this topic to help people who are trying to start programming an RPG. If anyone wants to they can post their routines for NPC's, hit detection, storyline creation, engine routines, anything to help out the common person
There are 10 types of people in this world-- those that can read binary, and those that can't.

Risen Phoenix

  • Guest
[83+ BASIC]RPG topics
« Reply #1 on: August 13, 2006, 04:19:00 am »
Hmm...

Here is an NPC routine for the RPG starter kit by Tifreak8x

c1-->
CODE
ec1PROGRAM:ZCH
\\code for other checks
:If sub(Str1, T-16,1)="(omega)
\\if person is in front of you
:Then
:prgmZTALK
\\what to say
:ClrHome
:Pause Ans
\\Obviously this is not very pretty, that's your job :p. You can use the arrow keys to scroll if the text goes beyond the screen boundries.
:Output(1,1,Str1
\\returns screen to normal
:Endc2
ec2
c1
-->
CODE
ec1PROGRAM:ZTALK
:If L=1:Then
:If M=1:Then
:If T=56:"What are you doing in my house?
:If T=92:"Hello, did you see what happened yesterday on the news?
:End:End
\\this example is kind of vauge, however it checks for your exact location then saves the corresponding text to the Ans variable. If there is only one person on the screen, you can leave out the "If T=#" part.
c2
ec2

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ BASIC]RPG topics
« Reply #2 on: August 13, 2006, 03:34:00 pm »
Wow that's pretty cool, if you have any Xlib NPC routines then that would be great.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Dragon__lance

  • Guest
[83+ BASIC]RPG topics
« Reply #3 on: August 13, 2006, 04:38:00 pm »
Here's how i did NPC's with Xlib.I store them their sprites in a matrix,(duh),with an extra decimal,let's say ".4".Then for collusion detection,if the decimal is ".4",it calls a subroutine which-
(1)-retrieves the data from another program,Data is in form of If/Then
(2)-Displays it to the screen via a TextDecoder.
(3)In the data,If/Then,it might modify a list to trigger an event or something.
(4)Returns

If you want any code,i'll have to dig it up ;)wink.gif

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ BASIC]RPG topics
« Reply #4 on: August 13, 2006, 04:50:00 pm »
No no that's fine I can make my own code thanks a lot thought
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ BASIC]RPG topics
« Reply #5 on: August 13, 2006, 04:59:00 pm »
O and also here's a little info. People always say use A+(K=26)->A or sumthin of that nature but really think about it. Everytime the TI runs through all that code but with the If statement it will skip the code if the condition is not true. So here's a routine. What is does is displays the character and then waits for a keypress until one is pressed then it will delete the character then it will test the getkey statements and then loop back and display the character in his new spot and basically I use this routine in all my games.

Routine 1:(i got this from xlibman's tutorial)
:While 1
//display character here
:Repeat K
:getkey->K
:End
:If K=34 or (K>=24 or K<=26):then
//delete character
:End
:A+(K=24)-(K=26->A:B-(K=25)+(K=34->B
//ti will only run over this if a key is pressed because of the if statement
:End
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
[83+ BASIC]RPG topics
« Reply #6 on: August 13, 2006, 05:58:00 pm »
Ok, if I understand you correctly (forgive me if I take this wrong) is that you want to skip key code or any code if it doesn't add to anything? As if, the arrows weren't pressed so I skip the code. Well it would actually slow down the program than letting it run through the key code. And with the code posted, it would be quicker and smaller to do:
Routine 1:(i got this from xlibman's tutorial)
c1-->
CODE
ec1:While 1
:For(I,1,0,-1
:real(1,Spr_X,Spr_Y,Spr_Width,SprHeight,sPIC_Num,sPIC_X,sPIC_Y,Spr_Method,Spr_Flip,I
:End
:Repeat Ans
:getkey->K
:End
:A+(Ans=24)-(Ans=26->A:B-(K=25)+(K=34->B
:Endc2
ec2
To me what you are saying isn't matching up to what code you posted (I know you said it's kevins code, but I am getting mixed messages with your posted). I hope this helped?

Dragon__lance

  • Guest
[83+ BASIC]RPG topics
« Reply #7 on: August 14, 2006, 05:18:00 am »
Do you mean xlibman's GS tutorial? I think itd be faster to just let the key detection loop run through,(agree with kalan_vod) ;)wink.gif

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
[83+ BASIC]RPG topics
« Reply #8 on: August 14, 2006, 05:42:00 am »
fyi the reason why i had the getkey in a repeart or while loop is because i used grayscale in the routine, which looked crappy without the loop

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
[83+ BASIC]RPG topics
« Reply #9 on: August 14, 2006, 05:44:00 am »
QuoteBegin-xlibman+Aug 14 2006, 11:42 AM-->
QUOTE (xlibman @ Aug 14 2006, 11:42 AM)
fyi the reason why i had the getkey in a repeart or while loop is because i used grayscale in the routine, which looked crappy without the loop  

 Yeah, I just thought it was old code >.>

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ BASIC]RPG topics
« Reply #10 on: August 14, 2006, 05:44:00 am »
that was just an example but i(and i think many other people have) have way more detections so I need to make sure a key is pressed cause otherwise it will run through all that code and then the getkey won't be read thus making it slower and less responsive to getkey's but yea in ur case it would be faster to just run through the code.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
[83+ BASIC]RPG topics
« Reply #11 on: August 14, 2006, 05:48:00 am »
i think having it ina loop make it more responsive, however its a bad idea if you are gonna have animations

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
[83+ BASIC]RPG topics
« Reply #12 on: August 14, 2006, 06:06:00 pm »
o yea ic well then what engine type do you use??
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
[83+ BASIC]RPG topics
« Reply #13 on: August 15, 2006, 09:40:00 am »
the one you posted above, kinda, but with the actual grayscale commands scattered across the code