oosyrag's Forum Posts

  • Check around the edges of your screen, maybe you moved it on accident and or is mostly hidden off the edge of your screen. Or possibly dual monitors?

  • As commented in the example:

    [quote:3cdpqirq]Note Construct 2 pairs up instances by default, so this action will get the corresponding sprite's instance variable, as long as there is an equal number of text and sprite objects.

    I guess this is a shortcut where expressions assume the IID of the currently picked object. I've been using C2 for 5 years now and I didn't even realize this existed... I can't find anything in the manual that documents this. Still, I wouldn't rely on it, as placement order matters and things can get messed up as you create/destroy objects or if you don't have equal instances of each object.

    Containers would be a more suitable method. Alternatively you can assign label/debug text an instance variable with the UID of the object it is supposed to be associated with, and use that to pick the correct objects to update the text with.

  • Tricky.......... here is my attempt. https://www.dropbox.com/s/vbn9xluozgmf8 ... .capx?dl=0

    I don't know if this is a good way to go about it though, in terms of efficiency or logic.

    I've saved each imagepoints' angle difference from the center point to an array, then sorted the array to get the two points with the largest difference.

    EDIT: Updated original capx to clean it up, and now also works for any number of imagepoints/vertices.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well nothing you are saying is really impossible.

    As I mentioned earlier, the most important step is to define for yourself what information each player will need from the server, what they need to provide to the server and when. If you can make a clear plan, then get working! As Jomo said, Firebase is more suitable for Client-Server, but if that is too hard to work with then it is definitely possible with the multiplayer plugin. When you get started and work through putting it together, you will run into more specific problems that people will be able to help you with rather than just trying to imagine the whole thing in your head at the moment.

    Basically - try it and learn!

  • From what I understand, Firebase would be more suitable for a persistent mmo/mud type game, but again I don't have experience with it myself. There are bandwidth and other cost considerations when using a third party service.

    The multiplayer plugin should also have all the functionality you need, but you may have to put in more legwork implementing basic data structures like a login system and database. You'll also need to have a system available to act as a dedicated host, with the network configuration that comes with that.

  • Probably use a global variable to store your current LayoutName upon exiting, and on the next layout place the player's start position based on that variable.

  • That makes a lot of sense. Here is the better one, for a two dimensional array.

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

  • Firstly, array as JSON:

    https://www.scirra.com/manual/108/array

    AsJSON
    Return the contents of the array as a string in JSON format. This can later be loaded in to the array with the Load action.
    
    Load
    Load the contents of the array from a string in JSON format. This must have been retrieved from either the Download action or the AsJSON expression. It could also be retrieved dynamically from the AJAX object.[/code:2lnb9dg4]
    
    So using the Array.AsJSON expression will give you the entire contents of an array as a single string. You can save this string to a variable, file, localstorage, firebase key ect.
    
    Loading that same JSON string will populate the array with all the information that was saved.
    
    About the multiplayer plugin, you would make your own login system. Peers can send a message to host, such as login information, and your host can pass back information to the peer (like the player's game data array in JSON format) after confirming the login info. Again, this is assuming you will have one dedicated host always running on a server.
    
    Regarding Firebase, sorry I'm not too familiar with the specifics so I can't help you much with details. I just have an idea of the general concept of using it, and haven't worked with it myself yet.
  • EDIT: Removed Link.

    As mentioned furthur along in the thread, this method is actually pretty terrible in terms of efficiency and should not be used :p

    Psuedocode:

    While a 1 exists in the array, pick a random array cell between 0 and Array.Width.

    Does the random cell contain a 1? If it does, add one to it and stop the loop.

    Otherwise, repeat.

    If you want to expand this to a 2d or 3d array, you'll use a similar method, but randomly pick XYZ coordinates instead. Not recommended because you will no longer be able to use IndexOf to confirm if the target value exists in the array, and can end up with an endless loop.

  • At the simplest level, Firebase is just an online database you can use to store and get information.

    For a MUD type game, you might not even need to use the multiplayer plugin if you are using Firebase, depending on your setup. Basically each player will upload their own information and request data from the Firebase server as needed, thus getting information on all the other player states.

    Otherwise, utilizing the multiplayer plugin, you would probably have a dedicated host which all peers connect to that handles all information. Then you wouldn't need Firebase...

    To proceed with Firebase, you'll want to answer the questions: What does each peer need to know about other peers, and when do they need it? What information needs to be saved? Then its just a matter of syncing the relevant information to Firebase.

    Generally speaking, if you can organize it properly, keeping all information that needs saving in an array would allow for a relatively simple import/export system via Save and Load Array as JSON (which is simply a standard format for saving certain types of information).

  • Add an instance variable to your EnemyBullet called "source". When you spawn your bullet, set EnemyBullet.source to EnemyShip.UID. Now every bullet has an identifier for which ship it came from.

    When destroying the enemy ship, add a sub event to pick all EnemyBullet by UID - EnemyShip.UID, then destroy EnemyBullet. Only the picked bullets well get destroyed.

  • XML sounds like the way to go.

    https://www.scirra.com/tutorials/search?q=xml

    Parse it into an array, and you'll have all the information available to you for use.

    Although you can't dynamically create object types at runtime, you'll have to set those up ahead of time.

  • Right click the sprite font and select clone.

    Although you really should just use a single spritefont object and learn how to pick the proper instance to manipulate instead. There are many ways of doing so.

  • Don't be intimidated by arrays! They are simply little spreadsheets with a bunch of tools you can use to manipulate them.

    The solution to update the array is simply to repeat the actions called on start of layout, with the simple addition of setting array width to 0 beforehand to erase the current array. So upon dropping a block, set array width to 0, then add each block's (new) x position and uid to the array again and sort by x position.

  • I think the multiplayer plugin could work too, have the program automatically connect to a host which would pass a certain variable back to the client to save in localstorage for a certain amount of logins. This can happen in the background and be non-critical for the function of your program. You can have this event run only before a certain date to future proof it, and or patch it out later in an update.