AllanR's Forum Posts

  • the normal way to handle this is to put the player in a family. then check for when the player collides with the family. The player object will be the one that caused the collision and the family object will be the one collided with.

  • I looked at this earlier too, and I think you don't need the "For each xy element" loop.

    you know the id from loopindex("x"), so you can directly set the text and animation without searching through the whole array looking for it. Since the objects were just created, they will be the only ones picked.

    so, get rid of the loop and use loopindex("x") instead of Array.CurX, and use 1 instead of Array.CurY (or whatever y element the data you want is in - I can't really tell from the image).

  • did you turn off default controls in the Platform behaviour properties?

  • for question 1, arrays and dictionaries are global by default, so you can access them from any layout.

    I don't understand question 2. When I said you were loading them twice I meant you were reading them from local storage twice - once with the "Check if item exists", and then again with the "Get item" action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Lionz is correct, you shouldn't have to load/save between layouts...

    the reason you are having trouble is that the AJAX loads are only happening if the local storage item is missing. That is why it works one time after clearing local storage. Right after that the item is missing so it executes the AJAX code. Once the inventory is saved to local storage it is no longer missing, so then the AJAX call does not get made, and the AJAXLoading_1 variable will not get set.

    Also, you do not need to do a Get Item after a Check item exists action. If the item exists then the LocalStorage.ItemValue is already set with the stored value, so there is no need to then issue the Get item action. The way you are doing it will work but has to load the item twice for each array.

  • you can also create a css file and load it at the start of your project. Then you can use the exact css code from other sources. Although css code only works on form controls, not other construct objects like the text object.

    see the sample below for how I load css.

    https://www.rieperts.com/games/forum/textinput_css.c3p

  • here is a sample I was playing with last week that sets units animation based on the moving angle.

    you select units with the left mouse button, and send them to a location with the right mouse button.

    I borrowed the player unit from the Demonoire game demo...

    in another sample I am still working on I use pathfinding to choose a path for the units, but then I use MoveTo to get the units there. Pathfinding only takes units close to the destination. If you want units to got to an exact spot you have to use MoveTo, add waypoints found with pathfinding, and then set the final waypoint to the spot you want the unit to arrive at.

    https://www.rieperts.com/games/forum/SelectUnits.c3p

  • You do not have permission to view this post

  • just for fun, I made a quick mock-up with an animated chart. The lines aren't very smooth because there aren't very many data points. The Drawing Canvas object doesn't let you do filled polygons that self-intersect so I changed the filled area on the chart to something it could draw without a lot of extra work.

    https://www.rieperts.com/games/forum/ChartUI.c3p

  • the short answer is yes, it is possible.

    the longer answer is that there is a lot going on with that UI and it would be a LOT of work to make something look that good, easy to use, properly handle multi-touch, interact with a server for security and data, graph the data in various ways, etc.

    I use C3 to do a lot of database work, and have figured out many of the stumbling blocks so I can help out. But you will need to break it down into smaller tasks and build it bit by bit, and ask specific questions.

    one of the hardest parts is making it responsive - adapting to various screen sizes, and handling input because form controls hover over the canvas which means nothing can easily pop up over them. You can make you own input methods, but then you lose copy/paste/spell checking/etc.

    I haven't done much with graphs yet, but it is something I plan on doing, and have played around with various types. ROJOhound has done some examples graphing equations. Animating graphs like in the image you linked to raises the difficulty quit a bit.

  • well, if the object isn't moving, then the moving angle doesn't mean anything. The fact that it stays the same after it stops is useful and lets you know what direction it was coming from, allowing you to set the objects angle accordingly.

    I do like the idea of it having an index indicating which waypoint it is heading towards. Although it would be easy to add an instance variable and increment it at each point.

  • I like the fact that every waypoint is a trigger - it allows you to change animations and do other things. You can add another condition "MoveTo is moving" to determine if it is at the last waypoint or not.

  • your "Load Game" function doesn't actually load any values from local storage. You are using the Compare Value event, but that will not have a value until after a "Get Item" or "Check Item Exists" action is performed.

    You can save values separately in local storage if you want, but you will end up with a lot of Save actions and then Get actions, and I have heard people complain that that makes their game very slow.

    You can load lots of variables into one array or dictionary and then save those all in one operation. It is ok to save several items separately, but I would try to keep that number as low as possible.

  • the way you are trying to load the values from local storage is not going to work.

    Also, you should not save each value in the array separately - you should save the whole array

  • You can create a separate layout and call it something like ObjectRepository or ObjectDump and place an instance on there.

    you don't ever have to switch to that layout or use it in any other way. Just having an instance that exists allows you to set the default settings you would like to have set.