Jump to content
IGNORED

Having trouble updating 3rd & 4th score digit


Gemintronic

Recommended Posts

So, in my latest game I'm having trouble updating the 3rd and 4th digit in the score. I'm using it as an inventory bar.

 score = 0
 if has_sword then score = score + 100000
 if has_shield then score = score + 20000
 if has_ring then score = score + 3000
 if has_food then score = score + 400
 if has_potion then score = score + 50
 if has_scroll then score = score + 6

When I attempt to update it this way it just doesn't go. If I later go "score = 3400" then it appears to work correctly. Is this the wrong way to try an inventory bar using the score? Is there a better way?

 

 

atarowg11.bas

Link to comment
Share on other sites

What is happening in this game? Am I supposed to find items/treasure chests? Am I suppose to fight that creature and he drops something?

 

 

I ran around the game for a long time, and tried fighting the creature with the firebutton, but nothing happened. I did this with a breakpoint in Stella at your score code, and found that you never reach there. So I think you got some logic errors that is not letting you even get to that code.

Link to comment
Share on other sites

What is happening in this game? Am I supposed to find items/treasure chests? Am I suppose to fight that creature and he drops something?

 

 

I ran around the game for a long time, and tried fighting the creature with the firebutton, but nothing happened. I did this with a breakpoint in Stella at your score code, and found that you never reach there. So I think you got some logic errors that is not letting you even get to that code.

 

Eventually you find rooms with treasure chests. The treasure chest will have a random item 1-6 that gets added to your inventory bar. When testing I just hit F2/reset until a chest appeared nearby. Thanks for taking a look :)

 

This is my attempt at a 7 day Rogue-like. It's pretty far from finished. All you can do is go down stairs and nab items from an occasional treasure chest.

 

I kind of underestimated the potential for roadblocks like not being able to manipulate the score correctly.

Link to comment
Share on other sites

You can't directly assign a variable to the score, so at the very least, this line is messing up the score...

 

score = enemyhp

 

...if you really want to do that, use score=score+enemyhp. But be sure enemyhp is a BCD value.

Edited by RevEng
Link to comment
Share on other sites

 

rand&5 will produce one of four values 0,1,4 or 5

 

you'll never see 2 or 3

this should work

 

temp1 = rand/2 : temp1 = (temp1/2 + temp1)/32

 

 

YOU. GUYS. ROCK!

 

This was the solution. I'm very, very grateful for the posts here. Even the people who didn't post and just simply considered my quandary like Random Terrain and Andrew Davie. Thanks 'yall :)

 

UPDATE: Is this never-see-a-2-or-3 a symptom of using foo&5? Or, is it something in how rand generates its results?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...