Results 1 to 26 of 26

Thread: Need more randomness

  1. #1

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Need more randomness

    Same app but different problem.

    When a good thing happens I have a list of blurbs for the player.
    Same with bad things.

    But not nearly enough. They tend to get stale - particularly when you see the same ones twenty times per hour. I add new ones as I think of them but this is what I've got.

    The idea is that you're the top executive in a widget factory so while some of the things I've got don't correspond well with that, that's kind of where I'd like to focus more.

    Any ideas you have are appreciated.

    Code:
    Public Function TookDamage() As String
    Dim m_CallStacker As New cCallStacker
    Static nTookDamage(1 To 12) As Long
    Static nCount As Long
    Dim nRnd As Long
    
    m_CallStacker.Add NAME & ".TookDamage(Private Function)"
    
    If RollDie(d40) = 40 Then
    
      TookDamage = "Will someone please get the velociraptors out of the kitchen?!?  I'm trying to cook here!"
    
      Exit Function
    
    End If
    
    nRnd = RollDie(12)
    
    nTookDamage(nRnd) = nTookDamage(nRnd) + 1
    
    Select Case nRnd
    
      Case 1
    
        TookDamage = "You Twitted something really stupid and now everyone is laughing at you."
    
      Case 2
    
        TookDamage = "You missed an important deadline."
    
      Case 3
    
        TookDamage = "The Board of Directors would like a word with you."
    
      Case 4
    
        TookDamage = "Karen demanded to speak with you."
    
      Case 5
    
        TookDamage = "Something went wrong on the production line."
    
      Case 6
    
        TookDamage = "A group of McGuffins screwing around on a Segway ran over your foot."
    
      Case 7
    
        TookDamage = "You disappointed your Mother."
    
      Case 8
    
        TookDamage = "You were looking at your cell while driving and caused another accident."
    
      Case 9
    
        TookDamage = "You got banned from the CoD server because you were just too good."
    
      Case 10
    
        TookDamage = "You heard a strange noise in the woods at night and decided to investigate all by yourself wearing nothing but underpants."
    
      Case 11
    
        nCount = nCount + 1
    
        Select Case nCount
    
          Case 1
    
            TookDamage = "NASA abandoned you on Mars and left you with nothing." & DBL_RETURN & vbTab & "Also, you have a sucking chest wound."
    
    
          Case 2
    
            TookDamage = "NASA abandoned you on Mars and left you with nothing but a potato." & DBL_RETURN & vbTab & "Also, you're in the middle of a Martian dust storm."
    
          Case 3
    
            TookDamage = "NASA abandoned you on Mars and left you with nothing but a potato and a packet of ketchup." & DBL_RETURN & vbTab & "Also, you exploded yourself a little bit when you played with fire around flammable gas."
    
          Case 4
    
            TookDamage = "NASA abandoned you on Mars and left you with nothing but a potato, a packet of ketchup and part of a rocketship." & DBL_RETURN & vbTab & "Also, you're out of ketchup."
    
          Case 5
    
            TookDamage = "NASA abandoned you on Mars and left you with nothing but a potato, a packet of ketchup, part of a rocketship and a fire extinguisher." & DBL_RETURN & vbTab & "Also, the front of the rocketship is missing."
    
            nCount = 0
    
        End Select
    
      Case 12
    
        TookDamage = "You can do it!" & DBL_RETURN & vbTab & "wait... no you couldn't..."
    
    End Select
    
    ShowChoiceCount "nTookDamage", nTookDamage
    
    End Function
    
    
    Public Property Get GotBuffed() As String
    Dim m_CallStacker As New cCallStacker
    Static nGotBuffed(1 To 9) As Long
    Dim nRnd As Long
    
    m_CallStacker.Add NAME & ".GotBuffed(Public Property Get)"
    
    nRnd = RollDie(9)
    
    nGotBuffed(nRnd) = nGotBuffed(nRnd) + 1
    
    Select Case nRnd
    
      Case 1
    
        GotBuffed = "You've been hitting the gym!"
    
      Case 2
    
        GotBuffed = "Great job on those TPS reports!"
    
      Case 3
    
        GotBuffed = "The Board of Directors would like a word with you."
    
      Case 4
    
        GotBuffed = "Karen demanded to speak with someone else."
    
      Case 5
    
        GotBuffed = "You found a Thing!"
    
      Case 6
    
        GotBuffed = "Tour Mother is proud of you."
    
      Case 7
    
        GotBuffed = "You rescued a stray animal."
    
      Case 8
    
        GotBuffed = "Your favorite " & Relative & " gave you something special."
    
      Case 9
    
        GotBuffed = "You missed your ride back to Earth from Mars with NASA but they sent someone back to get you." & DBL_RETURN & vbTab & "Also, they have ketchup packets."
    
    End Select
    
    ShowChoiceCount "nGotBuffed", nGotBuffed
    
    End Property

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,418

    Re: Need more randomness

    Show the code for RollDie

  3. #3
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,946

    Re: Need more randomness

    Buy a magic eight ball...it covers it all
    Attached Images Attached Images  
    Please remember next time...elections matter!

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,731

    Re: Need more randomness

    Also why is this on chit-chat?
    I don't have and issue but since this is chit-chat the previous eight ball answer is perfectly legit.
    If you need code correction or code creation please post in the corresponding thread.
    Thanks.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #5
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,946

    Re: Need more randomness

    Quote Originally Posted by sapator View Post
    Also why is this on chit-chat?
    I don't have and issue but since this is chit-chat the previous eight ball answer is perfectly legit.
    If you need code correction or code creation please post in the corresponding thread.
    Thanks.
    Seems like you have an issue even though you said you don't...the post isn't about code as I read it. It was asking for suggestions for replies. Hence the eight ball.
    Please remember next time...elections matter!

  6. #6
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,731

    Re: Need more randomness

    No it's you who has the issue.
    I was politely asking why is this on chit chat and pointing out that the answers might be chit chatty if the OP does not have a problem with that, more power to him. But you had to desperately find something to annoy me again (not that I am annoyed, I don't care really). Maybe do something else with your life rather than trying to call me off on every few posts? Go for a walk or something, play with your grandkids.
    A friendly advice.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  7. #7
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,946

    Re: Need more randomness

    Quote Originally Posted by sapator View Post
    No it's you who has the issue.
    I was politely asking why is this on chit chat and pointing out that the answers might be chit chatty if the OP does not have a problem with that, more power to him. But you had to desperately find something to annoy me again (not that I am annoyed, I don't care really). Maybe do something else with your life rather than trying to call me off on every few posts? Go for a walk or something, play with your grandkids.
    A friendly advice.
    Your funny...you said you don't have an issue when it is obvious you did. Why else comment about code when the thread was not about code. Then you say "(not that I am annoyed, I don't care really)" when you obviously are.
    Please remember next time...elections matter!

  8. #8
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,731

    Re: Need more randomness

    Ok man.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  9. #9

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    TookDamage = "You got into a fight on the internet."

    Thanks!

  10. #10

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    Quote Originally Posted by Arnoutdv View Post
    Show the code for RollDie
    It was in (I think) the first code I posted yesterday but here it is again with the fat trimmed. The "fat" being just reporting to the user and tracking number or die rolls, etc.

    Also too, Tyson is right. This post has nothing to do with code. I was asking for more blurbs for TookDamage and GotBuffed.

    Code:
    Sub RollABunchOfDie
    Dim nResult As Long
    
    nResult = RollDie(0)
    
    MsgBox nResult
    
    nResult = RollDie(1)
    
    MsgBox nResult
    
    nresult = RollDie(2)
    
    MsgBox nResult
    
    nResult = RollDie(2, 4, 6, 8, 12, 20)
    
    MsgBox nResult
    
    nResult = RollDie(2000, 4000, 8000, 12000, 20000)
    
    MsgBox nResult
    
    End sub
    
    Public Function RollDie(ParamArray Die()) As Long
    Dim nTotal As Long
    Dim n As Long
    Dim nValue As Long
    
    ' Returns Sum of all Die Rolled.
    
    nTotal = 0
    
    For n = LBound(Die) To UBound(Die)
    
      nValue = Int(Rnd * Die(n)) + 1
    
      nTotal = nTotal + nValue
    
    Next n
    
    RollDie = nTotal
    
    End Function
    Last edited by cafeenman; Jun 13th, 2024 at 09:30 AM.

  11. #11

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    Also too, ALL of this kind of thing is currently in a Module named bResource to remind me that it doesn't belong in the code. It's there for now to make it simple to work with but eventually it will all be moved to an external file - probably the same DB as the rest of the game data. I could use a resource file or roll my own thing but I honestly just don't want to mess with that or maintaining it. So probably a db or maybe even a text file.

  12. #12
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,731

    Re: Need more randomness

    Quote Originally Posted by cafeenman View Post
    TookDamage = "You got into a fight on the internet."

    Thanks!
    That's why this thread should be in some place other than Chit-Chat. That's an awesome reply.
    My usual boring signature: Nothing

  13. #13
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,343

    Re: Need more randomness

    Quote Originally Posted by Shaggy Hiker View Post
    That's why this thread should be in some place other than Chit-Chat. That's an awesome reply.
    I'm like sapator, curious why they haven't been moved. You been busy down in the Amazon??? https://currently.att.yahoo.com/news...013149271.html
    Last edited by wes4dbt; Jun 13th, 2024 at 09:29 PM.

  14. #14

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    Because it's about chit-chat, not code. What is so difficult to understand about that? Where would it even get moved to?

  15. #15
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,343

    Re: Need more randomness

    Quote Originally Posted by cafeenman View Post
    Because it's about chit-chat, not code. What is so difficult to understand about that? Where would it even get moved to?
    It's not difficult at all to see this is a question about solving a programing problem. So it belongs in one of the programming forums. If not the one for this exact language then try the "General Developer Forum". It will get move views and probably more feedback.

    This is the first time I've seen the mods leave this type of question in Chit Chat. That's why I'm curious why it hasn't been moved.

  16. #16

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    It absolutely IS NOT a programming problem. There is no programming problem. It's asking for suggestions for blurbs - things to say when the player takes damage or gets buffed. That is the question.

    I don't care if it gets moved but again, where do you think it should be moved to and I'll do that next time.

    You're right though. The only "suggestion" I've gotten I came up with myself.

  17. #17
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,343

    Re: Need more randomness

    Post where ever you like. You seem to mistake being curious for caring.

    It's asking for suggestions for blurbs - things to say when the player takes damage or gets buffed.
    Then I didn't read your post closely enough. To be honest I though this was a continuation of your previous thread in Chit Chat that was about your program always producing negative amounts.

  18. #18

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    Thread gets moved to programming something or other.

    Other user: "What is your programming question?"
    Me: "I don't have a programming question."
    Other user: "Then why did you post this here?"
    Me: "Don't ask me. I didn't want to put it here. A couple other people said I should put it here."
    Other user: "Well, the mods should move it to chit-chat or something because it's not about programming and it doesn't belong here."
    Me: "Ummmm....."

  19. #19

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    Quote Originally Posted by wes4dbt View Post
    Post where ever you like. You seem to mistake being curious for caring.



    Then I didn't read your post closely enough. To be honest I though this was a continuation of your previous thread in Chit Chat that was about your program always producing negative amounts.
    And I didn't read this post by you before I posted again.

    So we're even.

    peace

  20. #20

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    PS. This app covers a lot of things so my questions are going to be all over the place. Most of my real questions are about game balance and logic issues, not actually about the coding. The problem is what to code, not how to code it necessarily.

    For example, say I have a look-up table of people that I want to insert into whatever string.

    "Your " & Relative & " Loves you. He/She etc...."

    So how to create a system that knows what pronouns to use. I mean I can come up with something that will work but I can guarantee it will be convoluted and unnecessarily complex.

    And that's just an example. There are all kinds of things like that coming up during this project that I have to figure out how to address and don't know what's the best tactic to use.

    I've been writing in this language since Quick Basic and have it down well enough that I don't have many coding questions any more.

  21. #21
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,946

    Re: Need more randomness

    Quote Originally Posted by cafeenman View Post
    PS. This app covers a lot of things so my questions are going to be all over the place. Most of my real questions are about game balance and logic issues, not actually about the coding. The problem is what to code, not how to code it necessarily.

    For example, say I have a look-up table of people that I want to insert into whatever string.

    "Your " & Relative & " Loves you. He/She etc...."

    So how to create a system that knows what pronouns to use. I mean I can come up with something that will work but I can guarantee it will be convoluted and unnecessarily complex.

    And that's just an example. There are all kinds of things like that coming up during this project that I have to figure out how to address and don't know what's the best tactic to use.

    I've been writing in this language since Quick Basic and have it down well enough that I don't have many coding questions any more.
    There may be some irony about it but try asking ChatGPT.
    Please remember next time...elections matter!

  22. #22
    Lively Member
    Join Date
    Jun 2023
    Posts
    79

    Re: Need more randomness

    Taking damage:
    Code:
    While buying lunch, a local protest mistook you for someone else and beat you with their signs.
    A pack of stray dogs decided to munch on your legs.
    While taking a stroll downtown you were mugged by a group of improv comedians.
    At a routine check-up your doctor accidentally circumcised you... a little too much.
    You were viciously attacked by a woman and a large flock of pigeons while taking a walk through the park.
    You tripped down the stairs and fell 285 floors.
    You decided to visit a fortune teller. You don't remember anything and woke up in an alley missing a kidney.
    Someone at work played a prank on you and you **** your pants. Everyone made fun of you.
    You wanted to see how many licks it actually takes to get to the center of a Tootsie Pop. It got really sharp and cut your tongue. You tried to bite it and your teeth exploded. Time to call the dentist!
    While eating a sandwich you accidentally inhaled a whole pickle. That can't be healthy.
    An angry mob stormed your building demanding you stop poisoning their water. You explained that your company isn't poisoning their water supply but they thrashed you anyway.
    While watching a parade you fell and were subsequently stomped by an entire marching band.
    You took a drink of water and accidentally inhaled some of it. The resulting coughing fit caused you to pass out and void your bowels.
    Mixed up in a prank gone awry, you accidentally drank tainted water. You couldn't leave the restroom for a week.
    Someone knocked on your door and, upon your answering it, they punched you square in the face then left.
    Your assistant forgot to put away their collection of extra sharp thumb tacks. You tripped and fell face first into them.
    You tried to poke fun at someone online and they ratio'd you hard. Take the L.
    During a particularly heated moment, you mistook chemical hair remover for personal lubricant. That burns. A lot.
    Someone flicked you in the eye.
    While out shopping for new suits, the tailor accidentally stabbed you in the ear. Why was he measuring your ear?
    Someone broke into your home while you slept and farted directly into your eyes. Hello Pinkeye!
    You stubbed your toe on a table leg and cried.
    While on a dream African Safari, a lion ate all of your skin. You might need that.
    A new intern mistook you for some sort of ape-monster. It turns out you're just really ugly. Burn.
    Getting buffed:
    Code:
    You received credit for a large project at work and were given an ample bonus. Don't let anyone know you have no idea what they're talking about.
    You decided to give a homeless man money for food. It turns out he was a magic genie that grants wishes to those he deems honorable. You wished for longer fingers.
    There was a horrible car accident outside of your office involving a car and a snack cake truck. You collected two hundred free snack cakes from the street. 
    You received a letter in the mail that contained mysterious pills. You decided to take them and your legs have gotten six inches longer.
    You had a great jog through the local park. An entire crowd was cheering for you. At least, that's what you're going to believe.
    You received a lifetime supply of 'Anti-Ugly Cream' as an apology for being mistaken for some sort of ape monster. Thanks?
    Someone at work **** their pants and now no one remembers that you did.
    You find a shiny penny while walking to the office! Takes a penny.. to make.. a penny? Whatever. You keep it.
    While walking home from work one evening, a dog keeps barking at you. You start following the barking dog and it leads you to a shiny, new Volkswagen Beetle. 
    You decided to actually sit down and study work-related articles while at work. You actually learned something. That can't be right...
    You were named 'Executive of the Year' in 'Dumbass Executives Monthly'. What an honor.
    You find a tiny gnome living in your office desk. In exchange for a granola bar, he bestows upon you the power of having eyes. Now you've got five of 'em. Huzzah!
    You managed to look cool in front of several people by winning a local 'Don't **** your pants' contest. That was never who you are.
    You enter your office one morning to find a small old man sitting on the floor inside. He starts monologuing about the 'Power of Having Eyes' and 'responsibility'. You call security and swipe his ears before they escort him out of the building. Free ears!
    While renovating your office you find a glazed ham hidden in the wall. You obviously eat it. It's delicious. Wall ham.
    These kinds of things are one of my favorite things to come up with. I have so many of them in my own programs and in the programs I write for work. If you want any more horrible ideas let me know, haha. I love coming up with these.

  23. #23

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    I love you so much!

  24. #24

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    Quote Originally Posted by TysonLPrice View Post
    There may be some irony about it but try asking ChatGPT.
    That might actually be perfect. Irony is under-rated.

  25. #25

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,749

    Re: Need more randomness

    Quote Originally Posted by themindgoblin View Post

    These kinds of things are one of my favorite things to come up with. I have so many of them in my own programs and in the programs I write for work. If you want any more horrible ideas let me know, haha. I love coming up with these.
    Yes, I will happily steal and use any horrible ideas you'd like to share. Think of me as a horrible idea enthusiast.

  26. #26
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,946

    Re: Need more randomness

    Quote Originally Posted by cafeenman View Post
    That might actually be perfect. Irony is under-rated.
    But it keeps your shirts smooth...
    Please remember next time...elections matter!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width