InadequateChris's Recent Forum Activity

  • I have an array of inventory items. The first column in the array is the item name, the second column contains a description of the item.

    I'm trying to show the description of the item when the player puts their cursor over the item. FOr some reason it's producing "1" in the text box rather than the value of the element. Where am I going wrong here please?

    + Mouse: Cursor is over inventoryItem
    + System: Trigger once
    ----+ itemList: For each XY element
    --------+ itemList: Current value = inventoryItem.ObjectTypeName
    ------------+ itemList: Value at itemList.CurX + 1 ≠ ""
    -------------> testText: Set text to itemList.CurValue
    

    I'm not really sure if I've even gone the best way about this, so if anyone is able to recommend me the best practise for this, I'd really appreciate it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Really helpful, thanks so much!

  • Thanks for all the advice oosyrag, it's really appreciated.

    Alternatively, you don't need to sync animations at all. This could actually be preferred if your game allows for it. Instead of setting animation states based on input, you would set them based on the result instead, locally. This could result in more consistent results in some cases.

    My first thought for this is to send a Message to the Peer when an event happens, and have a listener on the Peer's side that initiates the animation when the Message is received. Is that what you meant by that?

    It's a 2D side scrolling game where the two players share the screen a lot of the time, so it's important the Peer can see the Host's animations rather than seeing them float around.

  • 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:

InadequateChris's avatar

InadequateChris

Member since 2 Dec, 2020

None one is following InadequateChris yet!

Trophy Case

  • 4-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies