robotpencil's Recent Forum Activity

  • Hey! This is a demo build of our game Centurium! Go check it out on Itch.io

    deadrockgames.itch.io/centurium-demo

    Also you can watch a playthrough of it here on youtube!

    Subscribe to Construct videos now
  • The solution I have now is as follows

    I basically determine the sine by code.

    I create my own Magnitude variable (To determine how far it will move)

    And created a Speed Variable (To determine how fast)

    And I just incrementally add to a MoveAmount Variable (To make sure the sine function is constantly adding)

    And just get the player's position based on what I want to sine, and it just works

    Looks something like this.

    • Is Player Visible >
    • Set Position of Pet X = to Player.X + some offset value>
    • Set Position of Pet Y = to Player.Y + (sin(MoveAmount) * Magnitude)>
    • MoveAmount = MoveAmount + Speed.

    But Again if there is a built in function for this, i'd love to know.

    Also I reset my MoveAmount to 0, once sin(MoveAmount) = 0. Just so I don't have a value forever counting up.

  • So let's say I have attached to my character a basic platform movement.

    I then want let's say a Pet to follow my player, and attach a sine behavior on vertical. (So it floats up and down)

    When I do this, the sine behavior acts as if it doesn't work. If I don't have the pet follow the player, it works fine, but as soon as I do (Either through pinning or whatever) it doesn't anymore.

    Now I understand why this is happening at some level, but intuitively it shouldn't. Basically it's just overriding the sine behavior in favor of maintaining the position you asked it to follow.

    In other game engines this is usually no big deal. Because you have things like local position and world position. Something where you can have your player move in world position, have your pet follow in world position AS WELL as having the pet have it's own local position to move within (the floating up and down)

    All this is usually calculated for you and presented as a 'parenting' system.

    Just wondering if people have a solution for this outside of just doing the math. It seems like a no brainer feature for such a user friendly tool as Construct, but I get that the devs have other things take priority or if it exists already, I have no clue where it is.

    Some help on this would be amazing :D

  • https://robotpencil.itch.io/fire-everything

    Sometimes the link doesn't work so here it is in code:

    https://robotpencil.itch.io/fire-everything[/code:1yxvit03]
    
    [img="https://img.itch.zone/aW1hZ2UvMjE0NzI5LzEwMTI0MDkuanBn/315x250%23c/pg82Xg.jpg"]
    
    Your crew has been allowed to escape as you buy them time going against ungodly amounts of enemy crafts. 
    
    Your only weapons are your two pistols, your head which shoots lazers, and your wits. 
    
    How long can you survive. Can you beat a score of 20,000? psh... no one can. 
    
    Keyboard Controls:
    A, D to move side to side.
    Left, Right Click shoots pistols
    Spacebar shoots lazers.
    Esc to go back to title screen and Enter to play the game.
    
    Gamepad Controls:
    Left,Right analog stick to move side to side.
    Left, Right trigger to shoot pistols.
    A button to shoot lazers.
    Start button to go back to title screen or play game. 
    
    This is just a prototype made in 4 days. Was testing my speed on creating the art, gameplay and coding. Donate if you are cool. If you don't donate... I guess you're still cool.
  • So something weird happened.

    It works now. Not sure why but it does.

    So I decided to do a remote preview and copy the link into a different browser like Mozilla, and now.. it works!?

    In fact, when I came back to using a regular preview it works now on chrome. I'm bewildered.

    Also when I try to see the UserAgent it's picking up as Mozilla 5.0 on chrome. Is that normal?

  • I have it set up simply by having player 1 sprite controlled by Gamepad index 0, and player 2 sprite controlled by Gamepad index 1. I also did a console log to see how many gamepads were recognized and it would say 2, if both plugged in, and then 1 if I unplugged one of them.

    So I assumed it should work right out of the box, but it doesn't The browser supports it and recognizes there is another gamepad but nothing happens when I actually press the buttons. I'm sure I'm missing a simple thing.

    Here is a link to the game file.

    https://www.dropbox.com/s/ep7z36oqenotdee/kidsgame.c3p?dl=0[/code:1tmbu9rj]
  • > This.Is.Perfect.

    >

    > Do you have any documentation on this? Like how to change the values within the event sheets?

    >

    > I'm not sure how to actually have it dynamically change like you are doing! I've done this in the past in other engines not sure how to get this effect in Construct 3.

    >

    Check out the original thread scirra.com/forum/effect-normal-map-extended-1-01-updated-13-jul_t149650 normal-map-extended for more details.

    Here's an example C3 project for the image at the start of this thread. kindeyegames.com/forumfiles/NormalExtendedNoSF.c3p NormalExtendedNoSF.c3p

    For 'correct' rotating normal maps using this effect and changing parameters in events, see my scirra.com/forum/effect-normal-map-extended-1-01-updated-13-jul_t149650 posts in the original thread.

    Awesome! I'll give this a go later! Thanks a lot for the conversion and reply!

  • This.Is.Perfect.

    Do you have any documentation on this? Like how to change the values within the event sheets?

    I'm not sure how to actually have it dynamically change like you are doing! I've done this in the past in other engines not sure how to get this effect in Construct 3.

  • robotpencil I think you can do the same with 8-Direction. Disable standard controls, set acceleration=10000, deceleration=0, On key pressed simulate controls.

    To clarify,

    I started with 8 directions, the problem was no gravity. So I switched to the platform since I didn't feel the need to program gravity since it was already built in. Seemed easier to overcome the jump up(as many times as you like) and jump down mechanics. Which was pretty simple.

    Again the best solution would have been if the force physics didn't delay the lerp. But I'm discovering that having a lerp camera at such high speeds may not be needed at all lol. But we'll see what's up!

  • I have figured it out perfectly using the platform controls! Too bad the force stuff isn't applicable right out of the box, but this works fine!

    Thanks again to everyone who helped me out!

    The physics lerp follow is still a bug, but no worries this will work for me

  • There was something wrong with your project, some bug maybe. I created a new project with the same Physics movement and scrolling and couldn't reproduce the jittering.

    So yeah, use 8-Direction and everything will be fine.

    Actually, I think it has something to do with animation. Watch here is lerp without animation on my sprites.

    You can see as he slides on the platform it's fine. NOW, once I added a 4 frame animation on the idle at speed of 4, POPAGE.

    Here is the project file to test yourself. I did start from scratch too. >>

     https://www.dropbox.com/s/7rj6upn1rrtkhgd/testPhysicsControls.c3p?dl=0
    [/code:1yatzy7n]
    So I'm thinking there is some weirdness with the physics engine + animation + scrolling, almost like the animations lag behind. Not sure why though and I would love for people to replicate this and see if they have this bug occur for them.
    
    Now Using 8 direction and Platform controls do an acceleration approach, that isn't ideal for the controls I want. Meaning that if I press and hold a button it will keep accelerating the character in the respected direction, whereas the controls that I want should be on key tap. Press up, go up. Press and hold up, go up, but begin to fall since holding the button shouldn't do anything. 
    
    I can obviously code it so that once you pressed a button you should slow down. But I would only do this for the sake of a smooth camera move and the code/logic made to replicate the controls I'm looking for to me seems like it'll bloat the event page. 
    
    Thanks again for the awesomeness yall, let me know what's up! Also reported this as a bug so perhaps in the next patch this will be fixed and BAM lerped Physics yo!
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Maybe you are right! I'll do some more tests to be sure. And report back!

    It may be that I scaled my sprite to be smaller.

robotpencil's avatar

robotpencil

Member since 1 Jan, 2018

None one is following robotpencil yet!

Trophy Case

  • 6-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies