oosyrag's Forum Posts

  • Ok, the key here is that you pick the menu object by touching it, then compare the contents of that specific menu object to do something. In this case I would want to follow a similar system/logic for a keyboard press, so I don't have to remake all the actions for every menu option again separately.

    The question should be - How do I pick the correct menu object On Return pressed? There are a several ways. Use your marker, which is presumably next to the relevant menu object, by:

    a. Menu Object - Pick Nearest to Marker.X, Marker.Y

    b. Menu Object - Compare X position equal to Marker.X

    c. System - Pick by Overlapping Point - Marker.X

    Now that you have the correct menu object picked, the rest should work as expected.

    Here is a screenshot of how to set up the sub-eventing, since you'll want an or block in there.

    If you've touched to pick the menu object, the subevent doesn't matter because there is only one instance to pick from anyway. If you used keyboard, none of the menu objects are picked, so the subevent will pick the one you are interested in. Every sub event below that will only care about that one menu object that you picked.

    I noticed that you used a Family to destroy all the menu objects (since if you used destroy on the object itself, it would only destroy the picked "active" menu object). Just wanted to note an alternative - there is a "Pick All" condition in System that would let you reset the picking within a subevent to properly destroy all the objects. This is mostly for the reference of people demoing C2, without access to families.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. Generate a random set of numbers using the random() expression. To determine the number of random numbers generated, you can use a loop - repeat random(4,10) times. Create text, set text to random(x,y). Random() can be set to a negative number

    2. One way to sort your randomly generated numbers in order, probably in an array. There are multitudes of ways to do this. Ref: https://en.wikipedia.org/wiki/Insertion_sort Edit: Just use the sort action!

    A simple way I can think of to simulate the effect you are looking for, is to compare the selected number with ALL the other numbers. If ANY other number is less than the selected number, then fail and start over, set points, ect. Else if no numbers are less than the selected number, then delete that number and move on.

    This will only work for numbers, and in order from smallest to greatest or vice versa.

  • The keyboard plugin has no properties.

    After you add the keyboard object you can use keyboard conditions and expressions in your events, as described on the manual entry here. https://www.scirra.com/manual/113/keyboard

  • Can you give an example of some the texts on your layout, a sample of what a player can input, and which of your texts would count as "nearest"?

  • This is part of the learning process of coding. As you get more experience working things out yourself and exposure to other's solutions via the community, you will gradually build your own foundation for certain logical thinking.

    Otherwise, there is no shame in asking no matter how experienced you are. this community is great and other people have likely already gone through what you are stuck on. I myself find solving other's problems enjoyable, like small puzzles (the ones I can handle anyway). Helps me keep my mind off my own projects and problems I'm stuck on :p

  • So basically you want a motion that is NOT natural physics.

    You'll need an additional event to artificially cut the momentum of the object, either by comparing the distance travelled, time since launch, or height position, up to you.

    Edit: Or make an invisible solid ceiling for your sprite to bonk its head into.

  • A logically simple option would be to use invisible placeholder sprites, with rules in boolean instance variables for each direction - up down left right, either true or false

    Your base condition is

    Player is overlapping sprite

    Sub events

    On Right Key pressed

    Sprite.right is true | Move Right

    On Up Key pressed

    Sprite.Upis true | Move Up

    Basically, while on this sprite, if the sprite allows me to move in the direction I specify, then move.

  • [quote:30n3707h]Snapshot canvas

    Take a screenshot of the current display. This triggers On canvas snapshot when the snapshot is ready, and the resulting image can be accessed with the CanvasSnapshot system expression. This can then be loaded in to a sprite or tiled background, sent to a server, or opened with the Browser object in a new tab.

    [quote:30n3707h]Invoke download

    Invoke a URL as a file download in the browser. Even if this points to a web page or document, it will be downloaded as a file in the browser interface. The URL can point to any address on the Internet, or it can be the name of any imported project file, or it can be a data URL (useful for downloading canvas snapshots). The filename parameter allows you to choose the filename the browser gives to the download, which can be different to the name of the resource being downloaded.

    You would probably want load the sprites into your layout, position them together, resize the window, then snapshot and invoke download.

  • Here you go -

    https://www.dropbox.com/s/ffwojstcimlun ... .capx?dl=0

    Try to figure out sub menus based on this example, if you still have trouble ask again!

  • https://www.scirra.com/manual/183/memory-usage

    Images are loaded into memory per layout. In games with large levels and/or lots of artwork, video memory is often the limiting factor.

    As far as rendering/processing speed, you can also separate your event sheets per layout, so you don't run through a bunch of events that don't apply to the current layout, but I believe the performance effect is negligible/irrelevant.

    Edit: The biggest factor is the initial download time/size of your game - if you have tons of layouts and assets, those will all need to be downloaded when you first load your game.

  • https://www.dropbox.com/s/sjtjilffjvtdu ... .capx?dl=0

    They do receive the broadcast, but they do not run until you focus the tab again.

    Try downloading the example capx, preview, duplicating a few tabs. On the host tab, click anywhere to send the message to change layouts.

    On peers, they will receive the message, wait 3, then change layouts.

    You can switch to each tab to see that they all got the message to change layouts, but don't start their 3 second delay until the tab is active.

    In the event where your layouts have different event sheets, or when you send multiple messages in the same frame (before going back to the peer tab to process the original message), you may end up with issues.

  • I found this - http://t-machine.org/index.php/2012/03/ ... etization/

    Rotmg is a bullet hell type game in a MMO setting, with similar projectile mechanics to the kind I'm working with. They made some interesting decisions with the netcode that I don't know if I can duplicate in C2. Don't know if I want to either, as compromises must be made.

    I'm going to research and see if I can find any good articles on Quake netcode, as many Quake weapons are projectile based and not hitscan. Also competitive pvp has different netcode requirements than an MMO, which would influence compromise decisions in different ways.

  • That function is for the SDK for if you are building your own plugin in javascript.

    I'm assuming that is not what you are doing. What you should be using is UID, which you can get from object.uid. This can be stored in an array or variable when you create the object (pushing it to an array will give you the order each one is created in as well).

    Otherwise, the shortcut to use IID is to reference the newest instance of an object in an expression by object(-1).expression.

    You generally never need to know to know what the IID of any specific object is, as it can change as objects are destroyed.

    So IID basically is a way to get relative order for expressions - first, second, third, last, next to last, ect. UID useful to pick a specific instance of an object.

  • Thanks gumshoe, those are some excellent articles. I'm mostly familiar with the concepts of authoritative hosts, interpolation, and lag compensation. Ashley's own multiplayer tutorials also cover the concepts and walks through lag compensation for instant hit weapons.

    I'm a bit stuck regarding lag compensation for created objects in particular and working with the multiplayer plugin's object syncing system. If I were to create an object client side instantly upon receiving input to do so (similar to moving a player immediately client side upon input, then correcting position based on host version), the host would also create the object upon receiving the input and sync that object. The peer would then see two created objects instead of syncing the one that the peer already created...

    I'm starting to think I might need to create a "bank" of already synced objects located somewhere off the layout, and just move them around as needed rather than trying to create and destroy them dynamically.

    The other thing I'm thinking is to not sync the projectile objects at all and just have the peer display "phantom" objects as purely visual approximations.

  • Ok here is how I would do it. Remember there are may ways to implement it.

    Basically, you have a variable that you keep appending text to to keep track of what keys are pressed. You'll use expressions to check if the last x characters in this variable match your cheat code then do something.

    I'll add in an event to delete the leftmost character after the variable is x length, so it doesn't keep growing forever.

    https://www.dropbox.com/s/ki12vj9ylgsc3 ... .capx?dl=0