Skip to content
  1. May 22, 2023
  2. Nov 02, 2022
  3. Feb 08, 2021
    • Nathan Lovato's avatar
      Merge pull request #202 from theraot/bugfix · 17dae66f
      Nathan Lovato authored
      Use drop chance correctly
      17dae66f
    • Theraot's avatar
      Use drop chance correctly · c87a8246
      Theraot authored
      Given that `randf` output is in the range [0, 1] inclusive, and we want `chance = 0` to mean never, and `chance = 1` to mean always, we need to worry about the edge cases.
      
      We need the `>=` because when `randf() == 0` and `chance == 0` just using `>` would give us the wrong result.
      
      We need to compare against 1 because when `randf() == 1` and `chance == 1` we would get the wrong reasult due to the `>=`.
      
      This is the from I found easier to read.
      c87a8246
  4. Feb 07, 2021
  5. Jun 12, 2020
  6. Jun 11, 2020
  7. May 12, 2020
  8. Apr 14, 2020
  9. Feb 01, 2020
  10. Jan 02, 2020
  11. Dec 11, 2019
  12. Oct 14, 2019
  13. Jun 27, 2019
  14. Jan 21, 2019
  15. Jan 15, 2019
  16. Jan 11, 2019
  17. Jan 09, 2019
  18. Jan 08, 2019
  19. Jan 07, 2019
  20. Jan 06, 2019
    • Nathan Lovato's avatar
      Close #167: Now all InteractivePawns can handle quests · eb521518
      Nathan Lovato authored
      There's more refactoring to the quest system with this commit. It removes extra
      code and scenes.
      
      Quests work from start to finish technically-speaking, although there's more
      work left to get the QuestBubble to display properly and to solidify
      interactions from the player. I haven't decided yet where to handle that last
      part: on the actions themselves or in the QuestSystem.
      
      Now, Quests are the one element that emit signals about their state (started,
      completed, delivered).
      
      To use the QuestSystem, you have to get the real quest object in the
      QuestSystem's database using the reference scene in the corresponding MapActions.
      
      The quest doesn't pass itself through these signals. If you need a reference to
      it on callbacks, you have to bind the quest as the last argument in the connect
      method:
      
      ```quest.connect('completed', self, '_on_Quest_completed', [quest])```
      
      One of the advantages of this code redesign is that each NPC should only connect
      to and track the quest that's referenced in its `[Give/Complete]QuestAction.`
      Thus there's no need for safety checks anymore or looping over all existing
      quests in the game to find which is active, if it's the tracked quest, etc.
      
      The system's functionality is limited but imo we shouldn't try to create too big
      of a system, as we won't have the content to justify it. Now I see how time
      consuming a quest system can be, and it'd be easy to go down the rabbit hole
      trying to make an advanced one (handling all possible events, cinematics,
      spawning npcs or modifying the game world, etc.).
      eb521518
Loading