Announcement

Collapse
No announcement yet.

Best way to light a campfire? Character or campfire blueprint?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Best way to light a campfire? Character or campfire blueprint?

    Hi, I created a blueprint that is a campfire. I can light the campfire by using a trigger box so when my character walks close enough it lights. When the player leaves the trigger box the campfire goes out. I used the trigger box just to test if the fire would start and go out. I want to be able to light the campfire with my lighter that is in my characters inventory. What is the best way performance wise?

    Should the blueprint check my characters inventory for a lighter or should the character check if it has a lighter and a campfire close enough to light it then set a Boolean in the campfire blueprint that it is light and light it? This is probably simple but I'm just looking for the best practice to go about this.

    Thanks

    #2
    Originally posted by MrNubbin View Post
    Hi, I created a blueprint that is a campfire. I can light the campfire by using a trigger box so when my character walks close enough it lights. When the player leaves the trigger box the campfire goes out. I used the trigger box just to test if the fire would start and go out. I want to be able to light the campfire with my lighter that is in my characters inventory. What is the best way performance wise?

    Should the blueprint check my characters inventory for a lighter or should the character check if it has a lighter and a campfire close enough to light it then set a Boolean in the campfire blueprint that it is light and light it? This is probably simple but I'm just looking for the best practice to go about this.

    Thanks
    Imo the best is to keep logic in campfire bp... lets say you have MMO game, if you keep all code in character then it would be pretty huge mess, so if you decide later to delete campfire out from your game, you will also delete needless code in it.

    Comment


      #3
      This would be a great use for an 'Interaction interface' on the campfire.
      Marketplace code plugin: AesTargeting - Make your Actors targetable =)

      Comment


        #4
        Thanks guys for the input. I was thinking of making a Interaction interface widget that pops up with some options you would select with the mouse scroll-wheel. All other input is welcomed

        Comment


          #5
          How I see it:
          You have an "Interactive" interface.

          You have an interaction logic in the player character (he can have a permanent raycast in front of him which checks if the hit actor is an interactive, or you could set up a box / overlap system). In any case, you end up with a reference to an Interactive Actor.

          Your interface could return an array of parameter: what is the distance at which I can interact with it, what kind of item I need to have to interact with it, what kind of text it displays and so on and so forth...

          The character would get these parameters when trying to interact and return interact success / fail depending on them. Maybe even return a string message to help the player understand what's going on ("you're too far", "you need a lighter").
          [Released] Multiplayer Combat Editor
          A-RPG Sacred Swords
          Auto-Chess Live Development
          Youtube Tutorials

          Comment


            #6
            Thanks for your input on my question, much appreciated.

            Comment

            Working...
            X