AllanR's Forum Posts

  • if there is a frame on screen, then you can't have the next frame slide on - unless it is a separate sprite. (you could alternate between two instances of the same object to achieve that)

    if you are advancing the frame while it is in touch, that will event will get executed 60 times a second, so it will flip through 20 frames in less than half a second.

    it gets a little tricky... do you want to swipe one way to get to the next frame, and swipe the other way to go to the previous frame? does the speed of the swipe matter? what happens if you start to swipe but then stop?

  • glad you figured it out!

    this is a quick sample I made to show how I might handle it...

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

  • you can use uppercase(text) or lowercase(text) to convert the text to be upper or lower as required.

    if you need to know before you take any action, you could compare two values like this:

    if TextBox.Text = uppercase(TextBox.Text) then you know it was already all upper case

    or

    if TextBox.Text = lowercase(TextBox.Text) then you know it was already all lower case...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • should be fairly easy to directly access the values in the main array - this is a case where I would use a dictionary to help make the code more readable.

    if you have a dictionary that has entries like: Warrior|0, Wizard|1, Knight|2...

    and entries like: Strength|0, Agility|1, Speed|2, HitPoints|3...

    then you could access the desired value like this:

    arr_ClassSheet.At(dictionary.Get("Wizard"),dictionary.get("Strength")

    (each character sprite on the screen would have an instance variable that identifies what type it is, so that can be plugged into the statement above).

    if this doesn't help, then make a small sample file for us to modify...

  • the easiest way I know of is to create a family, put the pin behavior on the family (not the soldier sprite).

    then you can pick the soldier sprite that is the chief, and pin all the family members to it.

  • yeah, it entirely depends on what your world looks like - is it a top down view? side scrolling? isometric? what kinds of obstacles are there?

    path finding would be another option.

    see this thread for a "Pet Follow" example I made for someone a while ago...

    https://www.construct.net/en/forum/construct-3/how-do-i-8/stack-movement-sine-behavior-140036?kws=pet%2bfollow

  • there is no native support, so you would have to create a pluggin... but it is possible.

    you might want to try QR codes (basically the same thing). There was a C2 pluggin, but that wont work with C3.

    An easier option would be to generate short codes that the player would type in to unlock something. But you would want a back end server to validate the codes and make sure they can only be used once.

  • the dialog box would be floating above the everything else - and not listening to events from construct anyway, so disabling mouse events in Construct probably wont help.

    if it is a bug in NW.js, they will have to fix it. Most people know not to double click a button.

  • you will probably want to use a field type of BLOB in your database for the base64 string - but I haven't tried that to see if there are things to watch out for.

    if you want to store the data in your MySQL database using the field names you show above, then you would have to use json_encode and json_decode in your php scripts to send or receive data from Construct3.

    (you would build an array in php from the data you read from the database and then use that with json_encode to get a json string to send to C3, when you receive data from C3, json_decode will give you an array that you loop through to build queries to update your database.)

    or do it manually like you are tying but with safe deliminators. I do a lot of database work with Construct and MySQL - I use a delimiter that can't be typed on the keyboard (unless you hold down the Alt key and type 0166). I use ¦ for a field deliminator and ¶ for a record deliminator. (alt-0166, and alt-0182).

    php doesn't like those characters typed in that way so I set variables like this:

    $f="%c2%a6"; $r="%c2%b6"; // field and record delimiters

    and then use them like this:

    echo $rows['Name']. $f . $rows['DictJson']. $f . $rows['OtherData']. $r;

  • I would use instance variables on the turrets (and buildings and other unit types) so that every unit knows its level, dps, health, cooldown, time to next level, etc.

    then I would store all the values for the different levels in an array.

    I sometimes use a dictionary with the array to keep the code easier to read.

    so, the dictionary might look like the: turrets | 0, buildings | 1, tanks | 2, ...

    and then to see what a level 4 turret dps should be:

    dps = array.at(dictionary.get("turrets"), 4)

    the dictionary and array can be read from local storage, or read from a project file or from a database using AJAX.

  • from the manual:

    "Get all key names"

    Retrieve a list of all the key names that currently exist in storage. This triggers "On all key names loaded" when the list has been loaded, where the KeyCount and KeyAt expressions can be used to access the list.

    another option would be to store all the data in an array, and then just save the array to local storage so there is only one key to set and get.

  • when you add the fade behavior to a sprite, you can set the "Active at start" to "No".

    that disables it until you tell it to start. there is no way to disable it with code that I know of.

  • awesome work! :)

    I am going to have to think of a reason to use this - it looks like a lot more fun than the database work I do!

  • just make the parts one pixel wider - it will be much easier to make it look right.

  • as far as I can tell (and I just tested it), that should work.

    did you move any code or delete lines in between?

    try deleting the else lines, and then adding them back in.