dop2000's Forum Posts

  • You are using a deprecated version of the tween plugin.

    Try replacing it with a new version:

  • Are you using "Dictionary For each Key" or "System For each"?

    Instead of using for each, you can set your text to Dictionary.Get("Name")

  • C2 is more suitable for arcade kind of games - where objects are moving, interacting with each other.

    Yours is more like a tabletop game. It doesn't really require any graphics or animation (unless you want to add it).

    But it does require a lot of data manipulation, maths etc.

    I don't know which development software might be better for this game - Unity maybe? Simply because in Unity you can actually type the code, while in Construct you build it in visual editor and it's not very convenient for a task like this.

    However, if you are new to programming, go with C2, it's much easier to grasp for the beginner.

    Yes, by "dice" I meant random number generator.

    Effectively organizing all game data might be the most important and challenging task in this project.

    CSV is a text file containing list of values.

    You can basically create them in Excel and import to C2.

    For example, your list of enemies may look like this:

    Name, ATC, HP, GP

    Skeleton, 1, 1, 50

    Goblin, 2, 1, 100

    Bandit, 3, 2, 250

  • You should remove this detailed description of the game from public access.. Someone might want to steal your idea.

    So this will be a text based game? Lots of text, number, buttons, lists, dice and some static images?

    Construct 2 may not be the best tool for this kind of game. But you can still make it in C2 if you want.

    I suggest you start with implementing one mechanics - for example trading or combat. And then add more.

    You need to think about how you are going to organize and store all the data. Read a few tutorials about arrays, dictionaries.

    Install CSV plugin - you'll definitely need it.

  • CurrentKey and CurrentValue only work inside the "For each key" event

  • If every action in your text object is followed by a line break (newline expression), then you can remove the oldest lines from the beginning of the text before adding new lines.

    For example, your text object can display 4 lines.

    When you need to add the 5th line, remove 1st line from the text. You can do this using find(text.text, newline) or tokenat/tokencount expressions.

    aaa        bbb        bbb
    bbb   ->   ccc   ->   ccc
    ccc        ddd        ddd
    ddd                   eee
    [/code:3bo0spi6]
    
    Alternatively, you can try rex's "Text Scrolling" plugin.
  • Why don't you apply force to boosters? See this demo:

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

    (I don't have much experience with physics joints and I'm not sure if I'm using them correctly)

    You can also try Chipmunk behavior, it has "Apply force at offset" action, so you should be able to apply force at the point where the booster is placed.

  • I don't think it's possible. You can open two projects and copy/paste objects from one capx to another.

    If objects in all capx are identical and you need to combine layouts, you can unzip capx and try copying or editing xml files, but there is a good chance that this will corrupt your project..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried replacing ^ with value*value, didn't notice any change in fps.

    And when I'm using actual sprite coordinates instead of random values, surprisingly distance() expression is faster!

    distance(Sprite.X, Sprite.Y, Sprite2.X, Sprite2.Y)<500

    is about 3-4 FPS faster than

    (Sprite.X-Sprite2.X)*(Sprite.X-Sprite2.X)+(Sprite.y-Sprite2.Y)*(Sprite.y-Sprite2.Y)<250000

    Anyway, I will stop worrying about using distance() in my games

  • Dictionary stores data in pairs - key and value. For example:

    "Name": "Small sword"

    "Damage": 25

    "Weight": 10

    It's quite easy to use and everything is covered in the official manual.

    https://www.scirra.com/manual/140/dictionary

    Here is a lengthy tutorial:

    http://javajdk.net/tutorial/construct-2 ... -tutorial/

  • justme5555

    It crashes because you made an infinite loop.

    here is my capx:

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

  • ,

    I read about square root being CPU costly before. After your comment I decided to compare (in C2):

    When I disable either event #3 or #4 and run the project in debug mode, there is almost no difference between two methods.

    With distance expression I'm getting 21-22 fps, and with squared values about 22-23 fps. CPU load is the same, around 97-100%.

    Is the difference really that small or am I doing something wrong?

  • Nice work, but how is it different from array? What are the advantages?

  • netdzynr

    You function sometimes produces results like "hellowXrld" when limit field is set to 3.

    Here is a slightly shorter version:

    The word should contain at least 3 letters, otherwise it will go into an infinite loop.

    You can add another condition to the While loop, for example "Loopindex<50" to prevent this from happening.

  • You can't pick any "abstract" object by UID.

    What you can do is to add all sprites to a family. Then in your function you pick a family member by UID.

    If you want your function to be even more universal and be able to process not just sprites, but also text objects, tiledbackgrounds etc, then you need to make several families, and your function can look like this:

    On Function "ApplyEffectToAnyObject"

    ...SpriteFamily pick by unique ID = Function.Param(0) -> do something with picked SpriteFamily instance

    ...TextFamily pick by unique ID = Function.Param(0) -> do something with picked TextFamily instance

    ...