goldexer's Recent Forum Activity

  • Greetings! I know I can change one object by another in big tree of events. That is good to create another type of game obj simply copying entire previous sheet.

    Today there was need to change root point position of sprite and to make another sprite point responsible for many calculations.

    Okay, CTRL+F and... 51 results cannot be replaced automatically. Do I need to click on every result and change all distance or another comparison expressions manually?

    Seems I just missed the location of some menu...

    Because, how about 891 results found case to change them all from «object.X» to «object.ImagePointX(2)»?

  • Also, your jump-thru object can have multiple animation frames with different collision polygon for each frame. If it does, select «Apply to whole animation/all animations» from right-click menu of polygon.

  • So moved them once again to the root of group but made them static. Now works.

    Non-Static variables in programming languages are reset every call of function, but not every tick, so that's why I missunderstood.

    Why do they need to be non-static by default? Is there so much profit?

    Thankyou guys for answers, you gave me right way to dig it out!

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • { "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!

goldexer's avatar

goldexer

Member since 22 Oct, 2016

None one is following goldexer yet!

Trophy Case

  • 8-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies