dop2000's Recent Forum Activity

  • 1. It would probably be easier and better for performance to create a function "ChangeDirection", which takes Player_Coll.UID as parameter. In this function you pick Player_Coll by UID, mirror/unmirror the body, update z-order for arms, change Sine magnitude etc.

    Every time a player changes direction, call this function.

    .

    I strongly suggest using a container. Container can only hold one instance of each object (one collision box, one body, one head etc.). So you can't put two arms in it. You'll have to make two identical sprites - LeftArm and RightArm. But this is a small price to pay for all the benefits you'll get.

  • You can use SpriteFont.TextHeight and SpriteFont.TextWidth expressions to get the exact size of the text, or calculate length using CharacterWidth, CharacterSpacing, CharacterScale. But this could be tricky if you don't want to break in the middle of a long word.

    So a much easier solution would be to break text manually. Just insert some special character where you want your breaks to be:

    "Oh... my god... I think that you ruined it...bks@You are so irresponsible after all...bks@now I'll have to do it by myself."

    Then use tokenat(text, 0, "@") to print the first part of text, tokenat(text, 1, "@") for second and so on.

    .

    For the typewriter effect search the forum or tutorials, there are plenty of examples. There is also a plugin by Rexrainbow.

    Also, check out this excellent dialog system (working link to capx is in comments):

    construct.net/forum/construct-2/how-do-i-18/zelda-dialogue-system-capx-and-117812

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Add a boolean instance variable "pathIsFound" to this object. Add this event:

    Object On Path Found -> Object set pathIsFound to true
    
     System Pick all Object
    
     Object boolean pathIsFound is set
     ..System compare two values: Object.Count=Object.PickedCount -> Object move along path
    
  • I did something similar in my game, only I made separate files for each language: strings_en.json, strings_fr.json etc.

    Also, you can use Browser.Language to get user's language code.

  • Well, I tried "AJAX Post to URL" action with the following settings:

    URL: "test.txt"

    Data: "some data"

    Method: "POST"

    I exported and uploaded the project onto the server, set folder permission to 777, but when I run it, the file is not created.

    If I create the file manually in this folder, I receive its content in AJAX response, but still can't write to it.

  • Do you get any error, what is the error message? Did you install the plugin correctly?

  • 1. "Trigger once" in events 24 and 27 doesn't mean "once per instance". This is a very common mistake people make. I don't like using this condition in sub-events, and especially in loops...

    2. In events 18-28 you loop through Player_Coll and pick their linked Player_Arms, but you don't pick the correct Player_Image instance for each Player_Coll. That's why there is a mess with z-order.

    .

    I suggest you read about containers. Put Player_Coll, Player_Image, Player_RightHand, Player_LeftHand sprites into a container. It will be much easier to manage them, you can create Player_Coll and other objects will be created automatically, just need to position them and pin.

    Same with destroying - just destroy one object and don't care about the rest.

    You will not need PlayerIndex variable, when you pick one object instance from the container, others will be picked automatically in the same event.

    So your event #18 will look like this:

    For each Player_Coll
     If Player_Image is mirrored -> LeftArm move in front, RightArm move behind
     else -> LeftArm move behind, RightArm move in front
    

    Easy!

  • Answering your second question - you can import the CSV file with all C1s/C2s into the project and then use this plugin to read it:

    construct.net/forum/extending-construct-2/addons-29/plugin-csv-csv2array-csv2dicti-41868

    You can load data from CSV into an array or dictionary, or create text instances, or just request individual values as you need them.

    Make sure to save the csv file in Unicode.

  • I think when you click a unit, event #5 sets isSelected to true, but event #6 immediately resets it to false.

    Also, you are moving the unit with MoveTo behavior, but checking if it's arrived using Pathfinding behavior event. Does it really work??

    It's pretty hard to figure out what's going on by the screenshot, could you post your capx?

  • It's hard to tell what's wrong by just that screenshot, you need to post your capx.

    You should probably add "System Trigger once" condition to events 48 and 49.

    .

    Also, it's quite weird to see string values "true" and "false". Usually you create a numerical variable and set 0 for false, 1 for true.

  • You can probably post a file with AJAX, but when I tested it didn't work. Maybe something was wrong with permissions or incorrect headers or something like that..

  • I'm not sure about saving files on the server, but you can save survey answers into a database.

    scirra.com/tutorials/346/online-high-score-table-ajax-php-mysql

    scirra.com/tutorials/4839/creating-your-own-leaderboard-highscores-easy-and-free-php-mysql

    Another option is to use Firebase:

    scirra.com/tutorials/5015/getting-started-with-firebase

    I also recently completed a little project where data from Construct 2 was sent to a Google Spreadsheet. If you want, I can explain how to do it.

dop2000's avatar

dop2000

Online Now

Member since 26 May, 2016
Last online 8 Feb, 2025

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies