Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Atributes

Atributes

Scheduled Pinned Locked Moved Unsolved Help and Support
6 Posts 4 Posters 1.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DGames135D Offline
    DGames135D Offline
    DGames135
    wrote on last edited by
    #1

    I really don't get how atributes work. When you set an atribute to an object with the atribute of another object does it like give the same behaviours to it. In conclusion how atributes work?

    Jack de WildeJ 1 Reply Last reply
    0
    • Michael KhalfinG Offline
      Michael KhalfinG Offline
      Michael Khalfin
      wrote on last edited by
      #2

      First, create an attribute - it doesn't matter what object it's on! However, take the note of the object, because that's what you're assigning the attribute to.

      With the get attribute behavior you get the value of it so that you can do stuff with it. For example, you can have an attribute for the speed of a character, and get the attribute to input his speed into another behavior.

      With the set attribute behavior you can change that same attribute. Set attribute usually works well with the simple math behaviors in te "logic" section. Maybe every 2 seconds you want to set the speed 2 seconds faster.

      You can use this logic to move values easily through behavior chains found in all types of objects. Or you can use attributes for organization and temporary storage. Think of them as related to arrays, dictionaries, box containers, etc.

      1 Reply Last reply
      0
      • DGames135D DGames135

        I really don't get how atributes work. When you set an atribute to an object with the atribute of another object does it like give the same behaviours to it. In conclusion how atributes work?

        Jack de WildeJ Offline
        Jack de WildeJ Offline
        Jack de Wilde
        wrote on last edited by
        #3

        @DGames135 you can use attributes like box containers, they just Store a value. The advantage is that objects can get each others' attributes.

        1 Reply Last reply
        0
        • DGames135D Offline
          DGames135D Offline
          DGames135
          wrote on last edited by
          #4

          I still don't get it

          Jack de WildeJ 1 Reply Last reply
          0
          • DGames135D DGames135

            I still don't get it

            Jack de WildeJ Offline
            Jack de WildeJ Offline
            Jack de Wilde
            wrote on last edited by Jack8680
            #5

            @DGames135 what don't you get? Set attribute sets an attribute to a value. For example, you can have an attribute called age and add 1 to it every second. Get attribute can then get the value associated with it, so if your character has an attribute, other objects can get that attribute.

            For example, say you have a tower defence game and you want your towers to attack enemies and lower their hit points. You could give each of your enemies an attribute called HP and then when an enemy is in range of the tower, the tower can get its HP attribute, subtract 1, then set its HP attribute to that every so often to simulate an attack, then destroy the enemy when the attribute is 0.

            1 Reply Last reply
            0
            • MurtazaM Offline
              MurtazaM Offline
              Murtaza
              Admin
              wrote on last edited by
              #6

              To address your original question, no it doesn't give it the same behaviours.

              Attributes are sort of like box containers. They're another way of storing data. BUT the key difference is using the GET attribute or SET attribute you can find out about a value from another object.

              Say you have a game where you have some enemies, each with their own health.
              Before attributes you would have a complicated way of handling the logic because it wasn't so easy to get each enemies health. You would either need to have all your attack logic on each object, use send/receive message, or do other messy things. Now every object can share it's health with any other object in the scene.

              So essentially, attributes are a way for objects to tell other objects about them self.

              Another example is the built in physics behaviours, each object has a gravity, mass, etc. These are attributes predefined by hyperPad. We have "Set Gravity" and "Get Gravity" and you can do that to any object in your scene.
              But with attributes you can do things like "Get bannanas" Or "get sdgldfjkgjldkfgsd" what ever you want. Now what you do with those heavily depends on the rest of your behaviours.

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Search