Author Topic: nooboish prgrammer  (Read 13060 times)

0 Members and 1 Guest are viewing this topic.

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
nooboish prgrammer
« on: November 22, 2011, 07:28:04 pm »
I'm cyrrently designing a text based RPG that includes the basic things you would expect to find in an RPG however I cant figure out how to create a menu or something else that works like an invetory such as using a potion takes you to a different menu asking if you wan't to use it so any ideas on how to make an inventory that you can add and take items form would be helpful.THX :banghead:
« Last Edit: November 22, 2011, 09:47:45 pm by obon7 »

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: nooboish prgrammer
« Reply #1 on: November 22, 2011, 07:41:17 pm »
Do you mean having a variable menu? If you could give me an example, that would be great. Also, welcome to omnimaga. You should introduce yourself.

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: nooboish prgrammer
« Reply #2 on: November 22, 2011, 08:25:48 pm »
Menu("title","Firstvariable",A,"second",B,"etc.",C)
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
Re: nooboish prgrammer
« Reply #3 on: November 22, 2011, 09:08:13 pm »
I know how to do that the problem is in my game i want i to make so that if in a menu i have one option that is for inventory i would want it too be able to store the objects you find while searching a forest or something. I can't really do that because storing and altering objects in a menu is difficult. So any other functions or any other ideas would help. *. :w00t:

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: nooboish prgrammer
« Reply #4 on: November 22, 2011, 09:09:48 pm »
like save it as a appvars? or am I still thinking axe! :P lol make a text rpg in axe, and I could help you a lot more, lol
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: nooboish prgrammer
« Reply #5 on: November 22, 2011, 09:11:23 pm »
Sorry, I am still having trouble understanding what you want. If you could write out an example, that would be helpful to me, allowing me to help you :)

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: nooboish prgrammer
« Reply #6 on: November 22, 2011, 09:13:46 pm »
Save them after you quit the game or just during the game?

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: nooboish prgrammer
« Reply #7 on: November 22, 2011, 09:24:14 pm »
I know how to do that the problem is in my game i want i to make so that if in a menu i have one option that is for inventory i would want it too be able to store the objects you find while searching a forest or something. I can't really do that because storing and altering objects in a menu is difficult. So any other functions or any other ideas would help. *. :w00t:

Use a list... first create a guide for yourself (aka something like potions, apples, feathers, etc), then use a list to keep track of the items.
You can use a list by doing:
Code: [Select]
{0,4,5}->L1By using the guide, you have: 0 potions, 4 apples, and 5 feathers
Then you can access the list by using:
Code: [Select]
L1(1)^ That will return zero, as the first element in the list, the potions, are zero.
Also, think of each element of a list as a variable, aka L1(1) can be thought of as A, so you can use code like 1->L1(1)  or even   L1(1)+1->L1(1)

Using this, you can make a menu, and read from the list to help make it easier/ display amounts of items. :)
Hope this helped! :D

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: nooboish prgrammer
« Reply #8 on: November 22, 2011, 09:28:10 pm »
so is the '1' in L1(1) referring to the first number in the list a.k.a the 0?
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: nooboish prgrammer
« Reply #9 on: November 22, 2011, 09:29:00 pm »
so is the '1' in L1(1) referring to the first number in the list a.k.a the 0?
Yes.
« Last Edit: November 22, 2011, 09:29:54 pm by mrmprog »

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: nooboish prgrammer
« Reply #10 on: November 22, 2011, 09:29:19 pm »
so is the '1' in L1(1) referring to the first number in the list a.k.a the 0?
Yes

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: nooboish prgrammer
« Reply #11 on: November 22, 2011, 09:29:37 pm »
OH COOL! that is so helpful!

is that the same in axe?
« Last Edit: November 22, 2011, 09:30:02 pm by saintrunner »
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: nooboish prgrammer
« Reply #12 on: November 22, 2011, 09:31:25 pm »
No. In axe, when you use a static pointer, or saferam area, the offset is the bytes. The concept is the same though, reading numbers from data.

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: nooboish prgrammer
« Reply #13 on: November 22, 2011, 09:31:28 pm »
I've tried making entire games without using any variables, just one list.  It was slower than if I used variables, but it worked, and all of those important numbers from A to Z and theta were safe! ;D

And in Axe, you cannot make lists, but more of an array format.  You store  multiple bytes in a row to a point in memory, and then using that same memory location + the offset, as mrm said, you can access the individual bytes you stored
« Last Edit: November 22, 2011, 09:33:34 pm by chattahippie »

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
Re: nooboish prgrammer
« Reply #14 on: November 22, 2011, 09:33:10 pm »
so pretty much I want a way that all the items in the game that you find or buy (all decisions in the game are made by navigating a single menu ) are stored in a form that you can access from the menu to lead to another menu type of setting and then be able to view/use the items that are in your "inventory".
The menu looks a bit like this
:"options","fight",D,"search",E,"Explore",f,"shop",g,"sleep",H,"inventory",I,"exit",1
basically all of these lead to different parts in the program (Lbl's etc.) and eventually lead back to the beginning menu. There is also title screen and obviously this isn't the whole program because I only put the part that I have trouble with. I will upload the rest of my code in hopefully less than a week. :banghead: