Author Topic: nooboish prgrammer  (Read 11048 times)

0 Members and 1 Guest are viewing this topic.

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
Re: nooboish prgrammer
« Reply #15 on: November 22, 2011, 09:37:52 pm »
thanks but then how do you make it so it specifically says 0 potions and choosing that off the menu will work like other functions in a menu. Also once a list is created can you alter it by for example you use a potion or you find a potion. THX guys I just joined and am getting all of these replies makes me like the omnimaga community.

edit: in response to chattahippie
« Last Edit: November 22, 2011, 09:39:58 pm by obon7 »

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: nooboish prgrammer
« Reply #16 on: November 22, 2011, 09:40:21 pm »
Code: [Select]
:Lbl M
:"for main menu
:Menu("Options","Rest",1,"Fight"'
:Lbl 1
:...Stuff
:Goto M
:Lbl 2
:Menu("Fight","Use Sword",3,"Use Bow",4,"Back",M
:Lbl 3
:...stuff
:Goto M
:Lbl 4
:...stuff
:Goto M
Like this?

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 #17 on: November 22, 2011, 09:40:53 pm »
there are ways, like I said, I could do all this in like 1 hour in axe lol :)
and just so you know you should double post within 6 hours, just use the modify button! :)
« Last Edit: November 22, 2011, 09:41:39 pm by saintrunner »
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 #18 on: November 22, 2011, 09:47:24 pm »
I guess it may not be possible but I envision more like in the menu that I have posted you could simply choose inventory and that would take you too a different screen that shows all the items you have found or bought and be able to use for example a health potion or something.

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: nooboish prgrammer
« Reply #19 on: November 22, 2011, 09:47:24 pm »
Okay, here is the code for a simple menu:

Code: [Select]
"Set up variables
{0,4,5->L1
2->Y
"Y will be used for the cursor
0->G
"G will be for key presses
Output(1,1,"INVENTORY
Output(2,2,"Potions
Output(3,2,"Apples
Output(4,2,"Feathers
Output(2,10,L1(1
Output(3,10,L1(2
Output(4,10,L1(3
While G=/=23
"23 is the code for [mode]
getKey->G
If Ans =/=0
Then
Output(Y,1,"_"
"Where _ is space
Y+(G=34)(Y=/=4)-(G=25)(Y=/=2)->Y
Output(Y,1,">
"Then for jumping to other code
If (G=105) and (Y=2)
Goto PO
" jump to potion code or code potions here
If (G=105) and (Y=3)
Goto AP
"apple code jump or here
"repeat for Feathers"
End
End
Try that, should work okay
Tell me if you have questions, or if it doesn't work ;D

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: nooboish prgrammer
« Reply #20 on: November 22, 2011, 09:49:06 pm »
If you want something like this:

Where it shows how many potions you have, tell me.
You can use a custom menu, or a manipulated OS one
« Last Edit: November 22, 2011, 09:49:52 pm by mrmprog »

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
Re: nooboish prgrammer
« Reply #21 on: November 22, 2011, 09:51:31 pm »
Okay, here is the code for a simple menu:

Code: [Select]
"Set up variables
{0,4,5->L1
2->Y
"Y will be used for the cursor
0->G
"G will be for key presses
Output(1,1,"INVENTORY
Output(2,2,"Potions
Output(3,2,"Apples
Output(4,2,"Feathers
Output(2,10,L1(1
Output(3,10,L1(2
Output(4,10,L1(3
While G=/=23
"23 is the code for [mode]
getKey->G
If Ans =/=0
Then
Output(Y,1,"_"
"Where _ is space
Y+(G=34)(Y=/=4)-(G=25)(Y=/=2)->Y
Output(Y,1,">
"Then for jumping to other code
If (G=105) and (Y=2)
Goto PO
" jump to potion code or code potions here
If (G=105) and (Y=3)
Goto AP
"apple code jump or here
"repeat for Feathers"
End
End
Try that, should work okay
Tell me if you have questions, or if it doesn't work ;D

That might work although I don't think that if you ran out of health potions they would  disappear , also you might want to use disp instead of output ; unless that is on purpose.

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
Re: nooboish prgrammer
« Reply #22 on: November 22, 2011, 09:53:02 pm »
also I don't have much experience with using getkey .............. hehehe like I said I'm kind of  a noob.

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: nooboish prgrammer
« Reply #23 on: November 22, 2011, 09:55:09 pm »
You could use Disp for the first 4 Outputs, just be sure to put a space in front of the items. The final three must be Output commands
And no, the potions would not disappear if you had zero; you would have to check in the code to see if you had potions before you used them
For example,
Where I said If (G=105) and (Y=2)
You should change to If (G=105) and (Y=2) and (L1(1)>0)
This will check to see if there are any potions left, and will run the code following it only if all of the conditions are met

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
Re: nooboish prgrammer
« Reply #24 on: November 22, 2011, 10:01:44 pm »
so i am just wondering if the getkey stuff is necessary because wiht a normal menu you could just use the arrow keys numpad and enter button. Questions: does it specifically say how many potions there are on the menu and does every item availble in the game need to be already existing in the menu and if so will it show how many you have so( not yet fouund items will display a 0 next to the name)

Offline obon7

  • LV2 Member (Next: 40)
  • **
  • Posts: 34
  • Rating: +1/-1
    • View Profile
Re: nooboish prgrammer
« Reply #25 on: November 22, 2011, 10:03:19 pm »
output allows you to display something at a certain point
for example:
:output(1,1,"hi"

will make it appear at point 1,1 on the screen, or the upper left corner!

AND DON'T DOUBLE POST!

and read this  http://www.ticalc.org/programming/columns/83plus-bas/cherny/
Yeah i looked there but It didn't help that much also another person said to double post so........

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: nooboish prgrammer
« Reply #26 on: November 22, 2011, 10:08:35 pm »
output allows you to display something at a certain point
for example:
:output(1,1,"hi"

will make it appear at point 1,1 on the screen, or the upper left corner!

AND DON'T DOUBLE POST!

and read this  http://www.ticalc.org/programming/columns/83plus-bas/cherny/
Yeah i looked there but It didn't help that much also another person said to double post so........
Here are the official rules
Quote
4: The only time double-posting is allowed (posting two messages in a row in the same topic) is either if there has been 6 hours since your last post, 3 hours if your thread has been bumped out of the New Posts page, 1 hour if it's a project update or immediately if you need to upload more than 10 file attachments at once. Otherwise, update the last post using the "EDIT" button. It will be marked as unread for all members (altough it won't bump the thread).

EDIT:  Yes, if you want the numbers to be displayed, I suggest using all the getKey stuff.  It will look much nicer than the default menu, and is more customizable
And the zero is expected. With that code, it is what it is supposed to do
« Last Edit: November 22, 2011, 10:10:09 pm by chattahippie »

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: nooboish prgrammer
« Reply #27 on: November 22, 2011, 10:08:56 pm »
Err, You really shouldn't double post. And saintrunner, no need to "yell" at a newer member. When you joined, you were by no means perfect, but look at you now, a productive member of the community :)

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 #28 on: November 22, 2011, 10:09:57 pm »
Getkey's are easier (in my opinion) in axe. and the reason you need it in chatta's example is because he made it self modified. in other words, it looks the same as the menu( function but it is written out so it can be adjusted

And yeah your right, I don't meen to yell, I'm just bad at explaining, so I'm really yelling at myself... sorry :P
« Last Edit: November 22, 2011, 10:11:13 pm by saintrunner »
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 #29 on: November 22, 2011, 11:08:19 pm »
quick question how do you alter a list so that its size can be increased and display the new item and not have to hav ea preset name for each slot.