Methuselah's Forum Posts

  • Thanks for the reply, I was hoping there would be some common error that people knew about. I just ran the example file and it works...frustratingly.

    Here's my c3p:

    https://drive.google.com/file/d/1U2mbak1Bv3-feF6AZXa_sUaoG5PuEnrN/view?usp=sharing

  • In order to learn the tutorials better, I tend to follow them line by line and rewrite them. I am 99% sure that I have made the game the same, and for the host the game works perfectly, but the peer somehow sets both paddles' peerid variables to the peer's own id. So on the host side, the paddles move separately and the scoreboard shows up the same, but on the peer side, both paddles move at the same time (since both paddles have the peer's MyID) and the scoreboard is messed up (since it can't find a paddle with the HostID). What gives? Any help is appreciated!

    Host:

    Peer:

    Host:

    Peer:

    Tagged:

  • Hi pirulitao,

    I think I see what the problem is. So a lot of events are checked every tick, or every 1/60 of a second. This includes your first two events: 1. Is the mouse over the door? and 2. Is the mouse not over the door? Basically, every sixtieth of a second, the computer is looking for where the mouse is.

    Now compare that to your "Click on the door" event: it is a triggered event. Notice the green arrow next to the event that the "mouse hover" events lack. This means that it is looking for the click, and only then will that event fire. Once it does, it's done until the next mouse click.

    Finally, rethink about how events are thought of: every sixtieth of a second, the events sheet goes down the list, top to bottom, checking each event and then making an action if any event is true.

    So! The instant you click on "Open Door," the three events in question fire in their order: Is the mouse hovering over the door? Then, is the mouse not hovering over the door? (One of those will always be true while the other is false) Then, did the mouse click "Open Door?" True! Set the animation to Door2 (the open door animation). This is good!

    NOW, the next tick (1/60 of a second later), the sheet cycles through the events again: Is the mouse hovering over the door? Then, is the mouse not hovering over the door? Note that one of those will always be true! So one of those events will trigger, and the door animation will flip to either closed or highlighted. Then, did the mouse click "Open Door" this tick? It didn't! It did last tick, but not this one, so that doesn't fire.

    Hopefully this makes sense: with your current code, you get the desired open door for 1/60 of a second before it resets itself.

    To fix it, I think you should add a global variable! Name it something like "doorOpen," keep it as a number, and then when you are checking the mouse hover (your first and second events), also check if doorOpen is 0. When the mouse clicks on "Open Door," set the animation like you have, but then also set the variable doorOpen to 1. Finally, add another two actions to that event: first, Wait 1.0 seconds, and then set the variable doorOpen to 0. Both the set global variable and Wait actions are in System. All in all, this should set the door to Door2 animation for 1 second, and then close it again.

    Hope this helps! Let me know if you have any more questions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, I have a game made in Construct 2 that has music imported into the music folder, as usual. However, while the game works great on Android devices (I exported as html5), the music breaks down on iOS devices. The command I use for the actual playing of the music is simple as well:

    On start of layout > Audio: Play "file" looping at -10db (tag "bgmusic")

    But about a minute into the song, even while doing nothing in the game, the music starts to sputter and eventually breaks down entirely. I have a video on Youtube that might help illustrate the problem, and in the interest of getting help quickly, here is the modified link (please replace * with .):

    https://youtu*be/03bxRP6h8cA

    Any ideas? Is it this particular iPad I'm testing that's making the audio suffer? Is it something about how I uploaded the music (used C2's sound importer to convert from wav to m4a and ogg)? Is it the amount of stuff being called at any given time/a slowdown problem? Thanks for any ideas.

    Tagged:

  • OKAY... this is going to sound a little crazy, and it's a long story.

    So basically, I'm recreating a game from another engine. This game uses tilemaps, which is cool. It used specific .layer files to generate its levels, but these files are little more than big CSV files: each space in the tilemap has the appropriate number for the tile sheet grid. I'd like to import this CSV into Construct 2, but it seems that tilemaps only work with .tmx files, using Tiled.

    Upon downloading Tiled, I can't find any place to import a map file, although there are tons of ways to export files. I figured the best way to get around this would be to create a dummy .tmx file, copy the CSV info into the appropriate section, save this new .tmx file, and import that. However, I get the "Check this file is a valid .tmx file" error message when I try to import it into C2.

    I guess I have two questions:

    1. Is there a way to easily import a CSV into Tiled so that I can export a valid .tmx file from Tiled and bring that into C2?

    2. If there isn't, what constitutes a valid .tmx file? How can I manipulate a .tmx file correctly so that it will be grabbed by C2?

    The main thing I'm trying to avoid is doing the same work twice. I have the numerical tilemap data, I want to use it!

    Tagged:

  • Also, I got my "horizontal" and "vertical" backwards in my OP, so oops.

    But thank you both! R0J0hound, that is exactly the thing I was looking for. brunopalermo, your example is totally what I want to have in my game. Thanks again!

    Hello all,

    First of all, if this is not the right place, please let me know and I will move this question elsewhere.

    Second, I am having a bit of an issue with a new computer. I recently bought a new laptop with an i7 core, 16GB of RAM, GTX 1060, 4k monitor, the works. It runs Windows 10. It's a bit more powerful than my home desktop (except for the RAM)! However, I use quite a few plugins for my work. On my home desktop, the 50+ plugins don't impede C2's performance at all; it loads up quickly, no slowdowns over time, totally a breeze. On this new laptop, though, having all those plugins in made C2 load super slowly. Right-clicking would show a blank rectangle for up to 15 seconds before it was populated with the correct text, start times were over a minute, etc. Note that this is not the games themselves that are slow, but C2 itself. I have since removed all of the plugins and done a complete reinstall, and it loads pretty well, but certainly not on the same level as my desktop.

    Things I have tried: running as admin, reinstall of the plugins, updating my graphics drivers, setting C2 priority higher. These did not have any effect on the startup and run speeds of C2. The only current fix is to not use any special plugins, which are needed for my work.

    Are there fixes for this? Can I set something up that would give C2 more RAM on startup? Is it software? Let me know your thoughts. Thank you in advance.

  • Hey all, I have a quick question. I'm trying to make a card game that will have a hand of cards with between 0 and...let's say 30 cards. The hands would probably average between 4 and 6 cards in it at any given time. I am familiar with a wonderful little tool in Adobe Illustrator that allows one to select several objects and arrange them evenly in an area, much like this:

    I start with five randomly-placed squares:

    And then I use the "Horizontal Align Center" command:

    And then i use the "Vertical Distribute Center" command:

    This last step is what I'm after. I would love to have events that count the number of cards in hand and vertically distribute them so that they are evenly spaced and easy to read. Is there an event action that can make this happen? Thanks for your help!