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. How to change value during game

How to change value during game

Scheduled Pinned Locked Moved Help and Support
5 Posts 4 Posters 1.3k 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.
  • F Offline
    F Offline
    Flame Games
    wrote on last edited by
    #1

    Hi everyone,
    Just asking. In my game I want the speed of the character to change only when it collides with something. I currently use patrol platforms to move the character (because it doesn't need to stop) and I have values connected to their X and Y's. How can I change the value connected to all of them (Because the character consists of 4 parts) to make the character go faster. Basically the current value is 7 m/s and I want to change it to 20m/s during game then change back to 7m/s afterwards. Does this make sense?

    If I could get a response as soon as possible that would be nice because this is currently delaying the game build.

    Cheers,
    Ash

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

      @Evolution

      What you are trying to do makes a lot of sense!

      Every behavior has something called an input field... If you go into the settings for the patrol behavior, you can click right next to the speed option in order to change that input field.


      Experiment with the behaviors...

      Maybe:
      -Collided with __
      -If (input (drag from behavior)) = (smaller value)
      -Change input field (by tapping next to the setting, and put on the restart behavior option) = (larger value)

      -Stopped colliding
      -Change input field (by tapping next to the setting, and put on the restart behavior option) = (smaller value)

      Or:
      You can get the smallest and largest x and y values, and define parameters. Using if-behaviors, you can figure out whether they are colliding, and then you can have the same follow-up behaviors.

      Or:
      Depending on the other behaviors and how many speeds you will eventually have, you may want to turn on and off "change input field" behaviors. The idea is the same, but you're activating and deactivating the functions in this case.


      I am not good with screenshots... I can make an example though... as long as @Aidan-Oxley and @Jack8680 do not beat me to it XD...

      1 Reply Last reply
      0
      • HakanH Offline
        HakanH Offline
        Hakan
        wrote on last edited by
        #3

        Use behaviour on and off behaviours.lets think an object patrols 5 speed when object collided another object behaviour off patrol 5 and behaviour on patrol 10 and if you want to patrol 5 again you can use wait(or collided) after 7 seconds again behaviour on patrol 5 bahvşour off patrol 10

        Michael KhalfinG Jack de WildeJ 2 Replies Last reply
        0
        • HakanH Hakan

          Use behaviour on and off behaviours.lets think an object patrols 5 speed when object collided another object behaviour off patrol 5 and behaviour on patrol 10 and if you want to patrol 5 again you can use wait(or collided) after 7 seconds again behaviour on patrol 5 bahvşour off patrol 10

          Michael KhalfinG Offline
          Michael KhalfinG Offline
          Michael Khalfin
          wrote on last edited by
          #4

          @Hakan Naw...

          1 Reply Last reply
          0
          • HakanH Hakan

            Use behaviour on and off behaviours.lets think an object patrols 5 speed when object collided another object behaviour off patrol 5 and behaviour on patrol 10 and if you want to patrol 5 again you can use wait(or collided) after 7 seconds again behaviour on patrol 5 bahvşour off patrol 10

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

            Set input fields are probably slightly better than behaviour on/off, but both would work depending on what exactly you are trying to do. I don't get exactly why you're using patrol to move the character, but if you want to change them alł easily, you could use a single broadcast message, and use receive message in each part. In the broadcast message select a box container that you set to the speed, then use the output from receive message as the speed of the patrol.

            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