dop2000's Forum Posts

  • Sorry, that was obviously a typo, I meant event sheet, not event list.

    I understand and agree that your solution is more flexible, but it's still a hack :)

  • That is very bad for the editor. I don't know if you've ever made a large project on Construct 2 or Construct 3 or any game engine.

    I have and you are not making any sense.

    Say I have an event sheet named "General Functions" with functions like "getValue()" and "setValue()", which I need throughout my project and therefore have to include it in all other event sheets. Which is a bit of a nuisance. What I'm suggesting is a single checkbox to mark this event sheet as Global. How is it different (performance-wise) from including this event sheet to all other event sheets?

  • vectorX = (Sprite.Bullet.Speed)*cos(Sprite.Bullet.AngleOfMotion)

    vectorY = (Sprite.Bullet.Speed)*sin(Sprite.Bullet.AngleOfMotion)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, you can select all events and press "R".

    The objects you are replacing should have the same instance variables, behaviors etc.

    .

    There is a big chance that what you are doing can be done much easier and more effectively with families. When you have to copy-paste the same code for different objects, it's almost always can be optimized with families.

  • That "E_Config_something" - is it some object, like a sprite, with Health instance variable?

    .

    Unfortunately, what you are trying to do is not possible. You can't refer to objects or variables using their string names.

    If you give more details about what you are trying to achieve, I may be able to tell you how it could be done better.

  • That said, I have no idea how or why this suggestion could have gotten 106 votes in just a few days

    Yeah, it got me puzzled too :)

    .

    I would probably like to see a different feature implemented - a Global Event List. When you mark an event list as Global and it becomes "visible" from all other event lists, without the need to include it. Would be useful for generic events and functions.

    EDIT: Event Sheet, not Event List, sorry.

  • Like I said, you have logical errors in your code. In events 5 and 6 you are changing animation without updating the Ball variable. That's why when you press Z after that, the variable changes, but the animation doesn't.

  • You can use "Between values" condition:

    tilesMap.TileAt(tilesMap.PositionToTileX(player.X), tilesMap.PositionToTileY(player.Y)) Between 60 and 64

    .

    You can use the "|" operator like this:

    Set variable tempTile=tilesMap.TileAt(tilesMap.PositionToTileX(player.X), tilesMap.PositionToTileY(player.Y))
    System compare two values: (tempTile=60 | tempTile=61 | tempTile=62 | tempTile=63 | tempTile=64) EQUALS 1
    
  • You can keep these values somewhere else in your C2 project and pass them to JS function as parameters. Something like this:

    Browser execute JavaScript "yourJSFunction('" & serverName & "');"

  • Yes, you can call back a function in C2 using this code from JS:

    c2_callFunction("FunctionName", [return_value]);

    .

    Here is a demo:

    dropbox.com/s/f9vte9290eidvm6/JS_Callback.capx

  • Please post your capx or at least a screeshot of your events.

  • I didn't notice the attached file, sorry.

  • The Function_Advanced is fully compatible, just not available.

    It's a very simple plugin, yet a masterpiece.

    [...]

    If it were, we could have done it on Construct 2 long ago.

    What are you talking about? What function_advanced, what plugin?

    Does a plugin that allows calling functions from another event sheet already exist in C2?

  • I know they look and sound scary - AJAX, JSON, ARRAYS, OMG!! - but they are really not!

    Just start using them and you'll see. Download a few examples from the tutorials section, try changing some bits. You only need two or three lines of code to load something with AJAX, you don't even have to understand how it works, just copy them from someone else's project.

    Same with JSON - all you need is Array.AsJSON expression to convert array to string, and "Array load from JSON" to convert it back. Two lines of code! Again, you don't need to know anything about JSON, its format, structure etc.

    .

    You can save individual variables to Local Storage if you wish. But to save/load 20 variables you will need like 60 events!

    To save/load an array or dictionary with the same 20 values, you will only need 3 events. See what I mean?

  • This could happen on some keyboards if you press 3 or more keys at once.

    If this is not the case, then there is probably something wrong with your code, please share your project file.