DAA79Game's Forum Posts

  • 12 posts
  • I usually use some character, for example ^. And then replace this character with newline expression.

    For example, you may have this text in the dictionary:

    Hello there,^general Kenobi!

    When you're showing it on the screen, you can do this:

    Text set text to replace(Dictionary.Get("greeting"), "^", newline)

    .

    And of course you can optimize the code by creating a function, which will return formatted text from the dictionary for any key.

    Thanks)

    But it is strange of course that the developers did not make a tag)

  • Another small question, maybe I couldn't find it, but how do I do line wrapping in a dictionary?

    The HTML <br> tag doesn't work, and as I understand it, C3 doesn't have its own tag for transferring?

  • No, I meant you only need to load one file. If device language is English, load English file, if Russian - load Russian. Use the same AJAX tag. So as a result, the dictionary will contain strings only for one language.

    Thank you, I didn't immediately understand what you meant)

    But now everything works as it should)

  • Check out this template:

    https://editor.construct.net/#open=languages-from-json

    I've also seen a few tutorials, you can try googling.

    I think the easiest way would be using a dictionary. Prepare a separate dictionary file for each language in the project, for example "Strings-EN.json", "Strings-FR.json"

    On startup when you detect device language, request the required file with AJAX and load it into the Lang dictionary. In this dictionary you can use codes as keys and translations as values. For example, the key can be "GameOverText" and the value in the French file can be "Jeu terminé!"

    And then you set text for your text object to Lang.Get("GameOverText")

    Thank you, it worked with the dictionary, but only with one. I connect the second one, just like the first one, but it doesn't work.

  • I know how to take values from an array(Lang.At), but I don't understand how to pass a string to the "Text" module. From the dictionary, too, it is not clear how to take strings.

    My game detects the language automatically depending on the language of the device, and am only need to do this check in the place, and substitute the necessary lines from the json file.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So you rotate the TankTower first, and then spawn particles? In this case you don't need pin.

    Try setting partciles angle to (loopindex=1?-90:90)+TankTower.angle

    Thank you so much, now everything is working as it should.

    Now one can try on the in main game)

  • Can you share your project file?

    I tried it on another project, and everything works, but the problem remains. Particles when rotated (here the tower rotates towards the mouse) stop being sprayed correctly(

  • You can use "watering"&loopindex as the name of the imagepoint where particles will be spawned.

    Or just add them on the layout and attach to the sprite using hierarchy.

    https://www.dropbox.com/s/6nh768em0c1ws4n/PinParticles2.c3p?dl=0

    I give up. In the example everything works well, but nothing works for me. I tried to do it both with the name and without the name, and all the same it feels like he does not find a point. Spawn particles by zero point and that's it (I don't have a hierarchy tab, and I found in the documentation how to do it.

  • Maybe I don't understand the task, but if you pin particles to the sprayer, they will work exactly as you described.

    https://www.dropbox.com/s/p2bmrms4opya4vo/PinParticles.c3p?dl=0

    A great example. But it doesn't work for me. I have everything laid out in animations, the points I need are in Sprayer2A - watering1 and watering2. I try to find these points through the cycle, but it does not find them, and therefore everything does not work (((

  • Add Pin behavior to Particles object. After your spawn them and set their angle, in the same event add "Particles Pin to Sprayer" action.

    Now particles will be attached to the sprayer, and will move and rotate with it.

    I tried, but it's not something slightly what I need. I don't have a problem that they are not rotating with the "sprayer", but that when the sprayer rotates, the "particles" leave their angle in -90 and 90 degrees. When the sprayer does not spin and turn right, then everything works, as should, some particles are up, and others down. But when the rotation begins, then the particles begin to sprinkle incorrectly. I need, regardless of the rotation of the "sprayer", the particles are static in the desired directions.

    Example: "Sprayer" will be rotated to the right "particles" spray one up, and the other down, turn down the "particles" is sprayed alone in the right, and the other in the left, etc.

  • You can use Pin behavior and pin particles to the sprayer object. Make sure to tick "Pin angle".

    Or create Hierarchy - add particles as children to the sprayer.

    Thank you for your help, but can I get an example? I'm still new to C3 and just learning it, and a lot is still unclear(

  • Hey, guys. There was a problem, I make a watering system, and there is a "Water sprayer" on the field, and it turns. Water particles are made through "Particles". The sprayer looks to the right, and the liquid is sprayed from the top and bottom through the snap to the points.

    I make the angle as follows: loopindex ("watering") = 0? -90: 90, and this works exactly until the start of rotation of the sprayer. How do I make sure that, regardless of the angle of rotation of the sprayer, the particles always spray in the right direction?

  • 12 posts