InadequateChris's Forum Posts

  • Is hero.animationname a string? Sync instance variable doesn't work with strings iirc.

    Just checked with the documentation, this is right, oosyrag, thanks.

    What would be the smartest way to ensure the Peer sees all the same animations that the Host sees?

  • The Problem

    I've got two players in a platform game environment. The Peer can see the Host moving around, but can't see them animate, so they're stuck in the Idle position as they move.

    My method

    Am I going the right way about this?

    Each character has a currentAnimation instance variable attached to it, and the host is updating the variable whenever the animation changes, like so:

    + HeroBase: playerID = Multiplayer.HostID

    + Hero: characterName = HeroBase.associatedHero

    + Hero: Animation frame = 0

    -> Hero: Set currentAnimation to Hero.AnimationName

    -> testText: Set text to Hero.AnimationName

    I'm using that testText in order to check that the instance variable is updating on the Host's screen, which it is.

    I've synced currentAnimation like this:

    -> Multiplayer: Sync Hero variable currentAnimation (precision Normal (float, 4 bytes), interpolation: None, client value tag: "")

    And on the Peer's side, I've tried to translate that instance variable in to an animation for the Host's character:

    + System: Every tick

    ----+ HeroBase: playerID = Multiplayer.HostID

    --------+ Hero: characterName = HeroBase.associatedHero

    ---------> Hero: Set animation to Hero.AnimationName (play from beginning)

    ---------> testText: Set text to Hero.AnimationName

    But the testText on the Peer's side just keeps showing "Idle" and the Host is just floating around.

    The question

    Is this the right method to keep animations synced? And where have I gone wrong please?

  • You do not have permission to view this post

  • Never mind, I found a smarter way of doing it.

    I made the SpriteFont object fill the entire UI space and added each line of text as a newline.

    Pretty much the same as in the Multiplayer tutorial but using a SpriteFont object. For some reason I didn't think it could be done that way with the SpriteFont object... silly mistake.

  • Hello!

    I have a chat feature in a game in which I'm creating a new SpriteFont object for each line of text, and then moving all the previous lines of chat upwards by the height of the SpriteFont object, like so:

    The problem is that the user may have entered more than one line of text, in which case only their first line of text is being displayed. The SpriteFont object appears to be a fixed height at the moment, and I was wondering if there was a way to have it auto-size to however many lines of text it contains.

    Any help appreciated!

  • Thanks oosyrag

    I'm reading the documentation on Tween(Value) and it appears to tween some numbers, but I'm not sure how to keep applying that number to the opacity of the textInput over time.

    I'm already using CSS to set the initial Opacity to 0.

    Any more help appreciated!

  • Hello!

    I'm trying to fade in (and out) my input text box.

    Input text boxes don't seem to have an Opacity property so I can't set it to start at 0 without using CSS - and the Tween behaviour doesn't tween CSS.

    I've tried using the Fade behaviour too, but that doesn't seem to work - it doesn't fade at all.

    What's the correct way of doing this, please?

  • Hi Maverick, thanks for that - it worked.

    Why, though? In the CSS file, I've written

    @font-family:'lunchtime';

    so why does it use the tag rather than the font-family name?

  • Hello,

    I've managed to apply a webfont to a normal text object, but can't get it working on an Input Text object. All the tutorials I've found on the web seem to be for Construct 2, so I was hoping to learn the proper way of going this in Construct 3 please. The Documentation doesn't seem to cover it.

    Here's what I'm trying at the moment:

  • Worked perfectly, thanks BaconSwagg

  • I'm using the platform behaviour and have a character walking left or right.

    I then stop the player if they hit a button at a certain point like so:

    On Keyboard Press W

    Set Group "Movement Controls" Deactivated

    Set Platform Disabled

    Start ignoring Platform user input

    Tween Position to Location.Y

    And that moves the player to a new position perfectly.

    The problem comes when returning them to the Platform:

    On Keyboard Press S

    Tween Position to Floor.Y

    Wait for previous action to complete

    Set Group "Movement Controls" Activated

    Stop ignoring Platform user input

    Set Platform Enabled

    At this point, when the player has returned to the ground, their motion from their initial walking continues as if it was never interrupted. So if they were moving right before hitting W, they now go back to moving right after hitting S, until they decelerate and stop.

    Why is the movement carrying over? Is there a way for me to kill it upon the press of W?

    Thanks for any help.

    Tagged:

  • Ahh, I've seen that being used in other projects and wasn't sure why - I guess that's it. Thanks so much for your help WackyToaster.

  • Hi all.

    I've used the Platformer behaviour, and when the player keeps walking towards a wall, they keep 'bouncing' off it rather than stopping. I've noticed the Platform has wall condition but I can't figure out what actions to implement.

    I've uploaded my file here if it helps.

    Thanks!

  • Ah, I managed to figure it out!

    I set the walk and run speeds as variables, and created a tween between the two on release of the run button.

    And I have a listener waiting for when the tween is playing - which updates the Platform maximum speed to match the tween.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks BaconSwagg. Would I need to use an Every tick to get it to keep updating to where the tween is at? And how might I do that from a Key is Released condition? My understanding is that it would only execute once, when the key is released.

    I'm still learning so any help is appreciated!