robit_studios's Forum Posts

  • Jayjay - I've considered this idea but I don't think it'd give me much more of an advantage over just using "overlap at offset" events. Maybe I'm wrong though?

    Yaottabyte - Thanks for taking the time to make that example. This is actually similar to how I have the enemy setup currently. It definitely works but I was hoping to find a method to avoid having to put a bunch of sensors on the corners of all the platforms.

    Ok, I put together an example CAP. If you try this you'll see that it works SOMETIMES.. but other times the enemy just randomly flys off the screen. It uses "overlap at offet" and "overlap at point" to detect the edges.

    https://dl.dropbox.com/u/28484936/crawling_enemy.cap

    Edit: Ok, after toying around with FPS settings I see now that the problem has everything to do with how fast the enemy is going. If I set the enemy speed to 80 - no problems. If I set it to 120 if will occasionally fly away. If I turn off v-sync and pump up the FPS to 200 I can make the enemy move very fast with no problems. Since I can't expect the game to run at 200 FPS I still need to come up with a solution for this.

  • I've been struggling with this enemy behavior for hours now and can't seem to come up with a decent solution. The game is a platformer, BTW. What I'm looking to do seems simple enough and is illustrated by this image. I just want the enemy to follow along the edge of a tiled background objects.

    <img src="https://dl.dropbox.com/u/28484936/enemy_problem.png" border="0" />

    Think of those little spiny enemies in Metroid that can crawl around a platform.

    <img src="http://www.consoleclassix.com/info_img/Metroid_NES_ScreenShot4.jpg" border="0" />

    I've been using a lot of "overlap at offset" events to set the enemy's speed and direction but I keep ending up with the object floating into space or moving through the background. The only solution I can come up with is to place a series of sprites at the corners that act as sensors, but it's not a very elegant solution. If anyone has an idea on how to make this work, I'd really appreciate it.

  • tulamide

    Thank you for the quick response. Your example worked great and I was able to plug it right into my current dialog system.

    You made my day!

  • I'm using the text object's "write text" action to make dialog text appear one character at a time. It works fine except that when the text is being displayed I also want to set the game's timeScale to 0 to pause everything else that's going on. But, this also pauses the "write text" action.

    Is there a way to make the text object's "write text" action over-ride the game's timeScale?

    Thanks.

  • Ashley

    Fantastic. I can't believe I was unaware of that event. It will actually help me in a couple of other places too. Thanks again!

  • Is there an event that will run only once when a group is activated? It'd be like a "Start of Layout" event but for events within a specific group.

    The reason I ask is because I have a series of inactive groups that have "start of layout" events in them. I want to pick one of those groups to be activated at the "start of layout". But for some reason even though I'm activating the group with a "start of layout" event earlier in the sheet, it ignores the "start of layout" events within the group.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is a topic I've been interested in too. It would make it very easy to allow the player to choose which control scheme they would like. Does anyone know is it's possible with the default Keyboard object?

  • Yann

    Fantastic! I could have sworn I tried that, without success. But it's working now.

  • Geo

    Thank you! That explains it very nicely actually. Using a "local variables" sprite seems like a good way to go. I appreciate you taking to time to explain your method.

  • I know that if I make it a global variable (which is what happens if I move it above event 1)it will work. But, this is just a simple example to show what I'm trying to achieve. In my game I want to avoid making global variables when possible.

    It seems like what I'm trying to do (have an triggered event that changes a local variable) should be possible. Maybe it's just not implemented yet?

    Thanks for your help. I guess for now I'll switch it to a global variable.

  • I feel like this might actually be a bug - but I'm not sure. It's very simple. I'm just trying to add 1 to a local variable when I click on a button. Here's the entirety of the code:

    <img src="http://i.imgur.com/wBnv5.png" border="0">

    And here's a capx file: http://dl.dropbox.com/u/28484936/add_to_local_var.capx

    For some reason it won't add to the "number" variable.

    Anyone have a clue? Thanks/

  • aridale - No, it appears that C2 does not have a chr() function. Thanks, though.

  • Is there a way to remove line breaks from a string in C2?

    For example: I'm importing text from a file using AJAX that looks like this:

    name1|001|Dialog 1|

    name1|002|Dialog 2|

    name2|001|Dialog 3|

    When it's saved to a string variable I want it to become this:

    name1|001|Dialog 1|name1|002|Dialog 2|name2|001|Dialog 3|

    I'm familiar with the "replace" system event but I don't know how to have it search for a linebreak. I tried newline and "/n" with no luck.

    Thanks.

  • I'm attempting the same thing. I have WAMPSERVER/localhost setup with a PHP file on it. I want to be able to access that file with AJAX in preview mode.

    I added "header('Access-Control-Allow-Origin: *');" to the index.php file on my localhost and I'm still unable to make it work. If I export the project and put it on my local server it works, but I don't want to have to do that every time I want to test the game.

    Any ideas on why this might not be working for me? Are there any browser settings I have to change, etc?

    Edit: This is the browser error I'm getting:

    XMLHttpRequest cannot load localhost/dialog_test/dialog.php. Origin localhost is not allowed by Access-Control-Allow-Origin.

    Edit 2: Figured it out. I had to add "header('Access-Control-Allow-Origin: *');" to the PHP file I wanted to access. It's working now.

  • Just wanted to verify that this issue has been resolved for me. Thanks Ashley!