Fengist's Recent Forum Activity

  • So, here's the issue. I have several elements on a layout. Whenever a layout loads or the browser gets resized, I run a function to position these elements based on the viewport variables.

    Aside from the fact that this gets damned confusing because depending on how you resize the browser the Viewport vars can actually go into the negatives, I'm having issues with different behaviors on different machines using the same save file.

    For example. On one machine, I can set the width of the element in the properties and it keeps that width regardless of the browser size. On the other machine, same save file mind you, when the browser width changes, the element's width changes.

    Same thing with position. I tell it to position an element based on another element's x position and width. On one machine, it's position stays where it should when I resize the browser. On another, it moves left and right depending on the browser size.

    Now I thought maybe this was because of resolution or some such. But I'm basing my location on fixed coordinates and not percentages.

    On one machine, this perfectly positions and scales the SkillsInfoBox based on the location of the SkillsBox and it perfectly resizes the SkillsInfoBox based on browser size.

    -> SkillsInfoBox: Set position to (SkillsBox.X+SkillsBox.Width , SkillsBox.Y)

    -> SkillsInfoBox: Set width to ViewportRight(0)-SkillsInfoBox.X-20

    On the other machine, in order to achieve the same effect, I have to do this:

    -> SkillsBox: Set width to SkillsBox.X+750

    -> SkillsInfoBox: Set position to (SkillsBox.X+980 , SkillsBox.Y)

    -> SkillsInfoBox: Set width to ViewportRight(0)+ViewportLeft(0)-SkillsInfoBox.X-20

    You'll note that these lines of code are quite different. On one, I can set positions and width based on the SkillsBox position and width and the Viewport vars. On the other, I have to manually set width's and I'm having to add in the ViewportLeft(0) in order to correctly calculate the element width.

    So I can only come up with 2 reasons why this would happen. Either the viewport calculations are vastly different on one machine than they are on the other (which doesn't explain why an element resizes on one machine and not the other) or some setting that I'm totally missing isn't getting saved in the save file.

    Here's a visual. The SkillsBox is on the left, the SkillsInfoBox is on the right with the red border (so I can see the x position and width better)

  • Create a text element and add a bullet behavior. Uncheck 'set angle' on the behavior.

    And, here's your code:

    + System: On start of layout

    -> Text: Set position to (ViewportRight(0)+1, 0)

    -> Text: Set Bullet speed to -150

    + System: Text.X+Text.Width+1 < ViewportLeft(0)

    -> Text: Set X to ViewportRight(0)+1

    This is a very, very basic 'ticker.' If your text is static, this will do the job. If your text changes, you're going to have to come up with your own way to set the width of the text box because that's how it decides when to reset back to the beginning.

  • F = 0
    Толчок = 0
    
    Press space:
    Accelerate 30
    Толчок=15000
    
    F=0+2
    Accelerate 30-2+2 = 30
    Толчок = 14000
    F=2+2
    Accelerate 30-2+4 = 32
    Толчок=13000
    etc..
    F=28+2
    Accelerate 30-2+30 = 58
    Толчок=0
    
    Press space again:
    Accelerate 30
    Толчок = 15000
    
    F=30+2
    Accelerate 30-2+32 = 60
    Толчок = 14000
    F=32+2
    Accelerate 30-2+34 = 62
    Толчок = 13000
    etc...
    F=58+2
    Accelerate 30-2+60 = 88
    Толчок = 0
    

    It's doing what you're telling it to do, increasing the speed.

  • Well, the brief look I took, I saw the numbers over the blocks being displaced. By anchor, I meant, did you use the anchor or pin behaviour on those numbers in order to lock their position over the box?

  • Did you 'anchor' the text to the blocks?

    • Post link icon

    Well, wasn't really a correction. You provided more details so I could provide a better answer. I'll be interested to see what you create.

    • Post link icon
    • Post link icon

    irrelevant

    stop misleading

    Misleading? Irrelevant? I don't know what planet you live on but the physics on my planet dictates that a cell phone is NOT going to host 1,000 players simultaneously. Period.

    Furthermore, the physics on my planet is dictated by the speed of light. Whether the player is farther away or closer to the server has ZERO relevance on how the server is communicating. DISTANCE determines the delay in the signal whether it's UDP, TCP, FTP, HTTP, Websockets or a tin can on a string (ok, so that last one is dictated by the speed of sound. Same principle).

  • Well, until recently, I've been able to right click elements on my layout and 'inspect'.

    Now, when I run in preview I'm having to "open in chrome", go to the dropdown menu, find dev tools, open that up, click on the element tab and then drill down through the html to find the element I want to look at.

    • Post link icon

    Multiplayer in C3 is now "thing of interest" for me or how to say it. :)

    I would like to ask about connection with Multiplayer plugin in C3, I read all these manuals as Ashley mentioned and yea it is difficult but thanks Ashley that it is very well described. I also tried chat example and experimenting with it.

    1. When I am on same WiFi network it works 100% like Lan.
    2. When I am on different WiFi there is sometimes problem then peer is disconnected so I guessing that host must be behind proxy, NAT or blocked some ports etc.. am I right? Simply host is not visible for peers.
    3. I also tried it via mobile data connection and it did not work. What is different in this case?
    4. What about publishing the multiplayer game (via C3 and their signaling server) on Google Play? Can there be a problem with the content (referring to the server) or requirements of additional permission on mobile?
    5. Lastly what about predefined Google play games API for multiplayer similiar to Google play games Leaderboards etc is it possible to implement it in C3 and may it be better?

    Sorry for maybe strange questions but I am begginer in this area and I will be really glad for further explanation and tips for better understanding of whole thing. :))

    I'm afraid you're delving into an area where few have traveled. I am working on a multiplayer game as well but mine will be purely web based and won't need to keep track of player movement. Thus, my ability to answer your questions is limited.

    A lot of things can affect your connection. Something as common as Windows Firewall can deny a connection.

    There will be additional requirements if you publish on Google Play. You're going to need to research their actual terms to figure out what you can and can't do. I do know that you can connect remotely to other devices. Plenty of apps do that.

    As for leaderboards and handling real-time multiplayer connections, I suggest you look into websockets and creating your own websockets server as well as Ajax communications with web based servers. While the multiplayer plugin does work and will work for low latency connections it does have it's limitations. Since a game client acts as the host, the number of connections to that game client is going to be limited both by the power and the location of that device. If your host is in Germany on a 10 year old cell phone and all the other players are in Australia on desktop's, it's going to have issues.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Has right-clicking on elements to bring up the Chrome menu been disabled in 152? I usually run my project and right-click to get to developer's options so that I can examine my HTML in detail and look for any JS errors. Now I did have code that disabled right clicking in my custom js but I took that out.

  • I forgot there was even still any documentation up on scirra.com. It's probably years out of date. The up-to-date SDK documentation is here.

    Thanks!

    Years ago I ran a site that was a 'search engine' for MUD's (Multi-User Dungeons). One of the things I did was to keep track of all the things people searched for and rank them on an inside page. Over the span of a week or so I noticed the hits on my site went through the roof. When I got to digging I found out why. On that list of top searches, someone had searched for Pokemon ***** Google snagged that and within a week, it ranked my site as the top destination for Pokemon *****

    Seems your inside page was #3 ranked for "Construct 3 developer mode."

    scirra.com/doc/c3sdk/enabling-developer-mode.html

    Google, sometimes it works too well.

Fengist's avatar

Fengist

Member since 6 Nov, 2015

Twitter
Fengist has 7 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies