goldexer's Forum Posts

  • Here is quote from manual:

    Local variables

    Local variables are variables placed nested under other events, or inside a group. They also show with a different icon to global variables.

    A local variable

    The main difference between global and local variables is local variables can only be accessed in their scope. A local variable's scope is its level of sub-events. All other events at the same level of indentation, or lower levels, can access the local variable. Events above it (less indented) cannot access the local variable.

    For example, if an event variable is in a group of events, it becomes a local variable. Then, it will only appear as an option for a variable in events inside that group. In other groups or in other event sheets it does not appear at all and cannot be accessed. This makes the variable local to the scope in which it is placed.

    Local variables convenient for temporarily holding variables over a short range of events, such as to calculate an average value (where a temporary sum variable may be necessary). It also helps keep the project simple, since it prevents the need to create more global variables, which appear everywhere in the project even if they are not needed everywhere.

    The scope of local variables is designed to mimic how the scope of variables works in real programming languages.

    ------------------------------------------------------------------------------

    Found in manual, page 115:

    Static

    Only applies to local variables. By default, local variables reset their value to the

    initial value every tick. However if Static is checked, the local variable's value will

    persist permanently, like a global variable. Static local variables differ from global

    variables in that they can still only be used within their scope. Global variables

    always hold their values permanently so the Static option does not apply to them.

    For more information about local variables, see Event Variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi! Maybe we need to submit this as a bug:

    If I define a local variable in ROOT of a group, but OUT of in-group events, then all inner events must see it's value, right?

    Otherwise, a variable defined INSIDE an event of a group must not be visible for other events (i.e. zero-valued), right?

    So why my variable, defined in root of group is reset to zero in every event?

    Does somebody knows? Is this okay?

    So if this is okay, we must be aware of using local variables, because we don't know exactly in which part of event-hierarhy it can be broken...

  • Does it happening with any other png-image file or only exactly this one?

  • Answer is yes on both questions!

    But later I decided to cut all trees as single images.

    I will keep in mind that I can add «disabled» entries as many as I need on any tilemap. ...until better solution will be done by construct developers))

  • 1536x2048 with 16x16 tiles = 12288 tiles. Yes, I've added 12288 entries as mentioned above.

  • I don't think it's a good idea to be honest.

    In C2 I was using "polygon-sprites" to make collision outline. But I think it's not the best approach to not to use things that are created for their special purpose.

    There MUST be a button or checkbox to disable collisions on selected (in tilemap bar) rectangle of tiles. I can't imagine how can this be there is no such button. It's game develop software! Like using stone hammer in 21st century((( Its possibility but not the way.

    Thank you! I apreciate your help! I will dig onto deeper.

  • { "name": "tm_MountainsPass", "plugin-id": "Tilemap", "sid": 424572617616130, "isGlobal": false, "instanceVariables": [], "behaviorTypes": [], "effectTypes": [], "image": { "width": 1024, "height": 1024, "originX": 0.5, "originY": 0.5, "originalSource": "", "exportFormat": "png", "exportQuality": 0.8, "imageSpriteId": 2977033, "useCollisionPoly": true }, "tile-collision-polys": {} }

    This code is contents of "objectTypes/tilemap.json"

    Changing "useCollisionPoly" does nothing.

    Tile options array must be elsewhere...

  • However, if you really have 150K tiles, this change will probably add many MBytes to your project size.

    1 Megabyte file right now, five layers with ground/grass/trees/secret areas and obstacles. 16x16 tiles on 5000x2000 small level with 800x450 viewport.

    This includes two big tileset textures, player with animations, buttons and other menu sprites, two parallax bundles, some enemies and so on...

  • If you are doing it just to hide collision polygons

    Yes. Editor works with 5-10 fps with collision grid turned on when looking on 4x viewport size area. While really need to see only one hundred of collision cells.

    If you feel confident editing raw project files, you can modify objectTypes/tilemap.json

    Oh, thought "disable multiple cells" already was implemented in C3 (was not in C2). Very sad.

    But your advice can be really helpfull! I will test it now! Thank you!

    P.S.I had some cases when I wrote few lines of code in Visual Basic.NET to search and replace a lot of different symbols in couple of huge files. It's not a big problem, but can be a fast solution!

  • Just place them in right order:

    Set group "First group" deactivated

    Set layer "First" invisible

    Set layer "Second" visible

    Set group "Second group" activated

    ...Or insert Wait(0.1s) if unnecessary touch still working on second layer immediately after making changes, like

    Set group "First group" deactivated

    Set layer "First" invisible

    Set layer "Second" visible

    Wait(0.1s)

    Set group "Second group" activated

  • Hi! I can't find how to disable collision on many selected tiles, like doing this by unchecking «Use collision» checkbox in «Tile properties»?

    I have 10 variations tilesets of 100x100 tiles per ground layer, one more 100x100 per trees and grass layer and so on.

    There is no option to disable «Show collision polygons» checkbox for specefic tileset only, so trees/grass/spikes draw their own collision grid. I can hide entire layer, but this is not an option, because I want to see ground collision greed relatively to all level assembled, not only the bald ground.

    Don't you want to say disabling 10 bundles of 3sets of 100x100 tiles using half of them = 150.000 tiles I need to do this manually?

    This cannot be true with such many years developed spicific software, so I think I'm just unnatentive. Point me, please in right direction. Thank you!

  • Yes that's right for the first problem. For the second problem look at your collision boxes on the sprite.

    Set to bounding box resolved this! Thank you very much! I was thinking collision polygon doesn't apply on tap event, after other engines this looks strange to me)

  • Okay, strings must be with quotes in some places and without quotes in other, that is summary.

    How about tap-freezes in example with 4 unnamed buttons? Any thoughts?

    P.S. I can't find «edit» button on topic, where it is?

  • Already found one answer:

    After setting value to string instance variable you need to delete quotes in C3 editor. They defaultly appear and there is firing compare event with string in «double-quotes»

  • Hi! Yesterday I bought C3 licence to do some tests and maybe to start work with.

    ...Aaaaaand logic of work in Construct 2 here is unacceptable or I have encountered some bugs (don't realy think so due to lack of experience)

    First problem is that "compare instance variable" doesn't work with tap-object event, even as sub-event. In a new clean project with few images. But I don't understand why? Because it working in the same C2 project (((

    Second problem occured while I was trying to make another project just to show first one on simplified example. And when I'm trying to tap on sprites tap event fires sometimes and sometimes not.

    I've tested this on pc, notebook, and phone. Even compiled it doesn't work.

    How can this be that it's only second day with C3 and it doenst work as expected? How many other surprises I will face? And why all of this was working on C2 like a charm?

    Thank you in advance! I really need some help, please)

    Links to proj files:

    Problem:https://drive.google.com/file/d/1tWo1snqJTJP7Y2NpVwTWYK-kFs32ODew/view?usp=sharing

    Problem:https://drive.google.com/file/d/1ojPvp-BOwBy4jjHA8OF75lTym1uYWL2s/view?usp=sharing

    Working:https://drive.google.com/file/d/1kx6edfWKBk26QE5Ar6QMp0LoJHfgOzxd/view?usp=sharing