oosyrag's Forum Posts

  • I have no idea what you're trying to do with the first two events. CData2.json is an array asJSON, and you're trying to load it into a dictionary object.

    https://www.dropbox.com/s/4xm47y1ltmy59 ... .capx?dl=0

    Here is what is happening:

    Create a new list item with the inputted name (EntryName.Text).

    Select the new list item

    Create a dictionary key with the same name as the selected list item (List.SelectedText), with contents from textbox (TripReportTextBox.Text).

    You should probably familiarize yourself with how to use expressions. Everything you are trying to do is very clearly documented in the manual.

  • While I don't know the specifics, I'm pretty sure the tilemap at most generates a separate collision box for each tile, rather than having a single collision box for the entire map. With that said, according to the manual, there are optimizations built in already.

    [quote:3ji5sxww]The Tilemap object can optimise collision detection and rendering in a way that should scale well even with extremely large Tilemap objects.

    I believe there is also some built in collision culling based on distance as well.

    I can't say if it is better to have a visual tilemap with solid helper objects, but that is definitely a viable approach. I wouldn't worry about which way is better until you visibly notice performance issues using the tilemap as solids (more likely to happen if your tiles are itty bitty). Then it would be a simple matter to remove the behavior and collisions from the tilemap and place helper sprites instead. Start with using the tilemap's collisions because you are going to have to set up your tilemap regardless anyways.

  • The second question has to do with angles and Delta T.

    The character in the game is holding a flashlight. The angle of the flashlight follows the mouse cursor. It is currently set up where the base of the cone of light on every tick moves to the base of the flashlight, and its angle on every tick rotates towards the X and Y position on the mouse. This code does not use Delta T for the angle of the flashlight, so I'm afraid that on a slower computer the flashlight would rotate slower. What would be a better way to code the angle of light incorporating Delta T?

    How many degrees are you rotating towards the mouse every tick? If it was 1 degree, then you should use 60*dt degrees. Multiply or divide accordingly if it was not 1 degree.

  • I do not know the answer for certain, but have you tried the browser/invoke download option?

  • Add a For Each Turret condition to have the event run separately for each instance of your turret, this will solve your simultaneous firing issue.

  • Currently it is only saved per session. If you want the data to persist between sessions or be shared among multiple users, you will indeed want to save the json data to either localstorage or a web server like firebase.

    To save by name, you'll need to enter a name when saving (another textbox, or automatically based on something else like their login name). You will create the list item with that name, and save the name in the dictionary as the key. When you retrieve it, you will once again refer to the name.

  • I don't work with plugins.

    Good luck!

  • You've got plugins, so most people can't open your capx file to help. Neither can I, but I can give you some general advice.

    Your goal is to move to the nearest valid position on mouse click. One way to do this is to use a helper sprite (invisible) with the custom movement behavior set to push out solids, nearest, and the solid behavior on your tilemap and areas outside your tilemap.

    When you place the helper sprite on click, it should move to the nearest valid location and then you can set your pathfinding based on the new location of the helper sprite.

    I'm actually not sure if the solids behavior works properly with tilemaps. If it doesn't, you'll have to overlay each solid tilemap tile with additional invisible solid helper sprites.

  • Dictionary.CurrentKey only works in a "For each Key" loop. If you aren't in a loop, there is no "current" key.

    So you're still missing how you want to organize and store your entries. Are you going to refer to each entry by time? date? name?

    You shouldn't update a key every time the text is changed, only when you press the save button. When you save, you want it added to a new key.

    Here is an updated capx. Each entry is incremented by 1, based on the number of items in the list, using the list.itemcount expression. You'll want to update the List - add item action to change whatever you want to name your entry.

    https://www.dropbox.com/s/0mmv7nmte4fl1 ... .capx?dl=0

    Also generally you want to avoid the tap gesture, it is not very responsive for UI purposes, it is better to use on touched object or on touch released with an is touching object condition.

  • Timescale only affects dt (and behaviors), which you should be using anyway. If you move a fixed distance in pixels per frame, timescale will not affect your projectiles.

    https://www.scirra.com/tutorials/67/del ... dependence

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Something like this? https://www.dropbox.com/s/8xnl5tx7tq020 ... d.c3p?dl=0

    There are compromises, but you can pretty much do anything. Just depends on how much work you want to put in to deal with custom movement behaviors.

  • How you want to organize and load your keys is up for you to decide. The first step is to determine exactly what you want to do, then you will be able to ask specific questions about how to do specific things. If you are not specific, people are much less likely to help you. It is not easy to give advice to do "something".

    To display a key, use the Dictionary.Get("key") expression. For example,

    On Trigger -> Text Set text to Dictionary.Get("input_Name").

    This will set the text object to whatever was saved in the dictionary under the input_Name key.

    To add all keys to a listbox,

    On Trigger

    Dictionary For Each Key -> List Add item Dictionary.CurrentKey

    To use the list to select a key,

    List On Selection Changed -> Text Set text to Dictionary.Get(List.SelectedText)

  • I was saying that you literally did it right, but your event sheet was not linked to your layout so your event was not taking effect.

    https://www.dropbox.com/s/0mmv7nmte4fl1 ... .capx?dl=0

    As you type into the textbox, is is written into the dictionary object.

  • tx for thanks!

    I like the idea of xi and xf

  • AFAIK the only way to do it without families is to use two separate body segment objects (they can look the same), and alternate each segment.