RafaelMatos's Forum Posts

  • Ashley Well, I was about to face this problem then because this is a really common feature in any rpg game, or in any game at all. Got goosebumps right now =[. So when we have an enemy that must have different obstacle map what would we do? Edit: The only thing I can think of is to re-add obstacles and wait for the next tick to find the path for this object. The problem is that it has a good probability to create glitches as others could use the wrong obstacle map.

  • The numbers can be interpreted as int, float or string. It dependes of what you want. I assume you want to get the coordinates from the key and use it to set the position of the object, so you have to break it down using tokenat expression, but if you want to use the coordinates to set a position then you have to convert it to int or float.

    example: var = 5-6-Tree

    Set X to float(tokenat(var, 0, "-"))

    Set Y to float(tokenat(var, 1, "-"))

    Set objName to tokenat(var, 2, "-")

    objName being an instance variable of the object

    **

    var = 5-6-Tree (string type variable)

    var = Tree (string type variable)

    var = 5 (int or float type variable)

    var = 5.5 (float type variable)

  • Ashley Good to know. Thanks.

  • Ashley , let me use this topic to ask something. The layout size doesn't affect performance and it's a question that were asked many times throught out the years, but the pathfinding behavior take it into account to scan the playable area and can result in a huge array of coordinates, which I assume that's how it's done behind the scenes. Would affect performance when trying to calculate a path?

  • Bootfit , blackhornet already answered you.

    The following "Score%10 = 0" is checking if it's a whole number, therefore telling you if the score is divisible by 10 or not. The "Zero" means that this division have 0 remains, so it's a whole number.

    Then...

    If Score%10 = 0 (If whole number)

    sub-action{Do something}

    Else

    sub-action{Do something}

    in Order to not call it every thick, you can do it by what blackhornet said or put it inside a Function which will be called every time the Score changes. Like this:

    On Function "Check Score" Called

    If Score%10 = 0 (If whole number)

    sub-action{Do something}

    Else

    sub-action{Do something}

  • -1(int) is not equal to -1(string). They are different types of data. You have to convert them to the same type before comparing.

  • For Collision why not use an invisible sprite. In 2d games, most cases using this method is precise enough. Regarding to frame duration, simulate it in your own animation in a way that what you export from your program is exactly what you expect. Of course, would be awesome to export the sprite strip again and construct automaticly update everything, but that's not the case.

    edit: if the size of your character changes a lot, you can update it by events so it fits the sprite, but it dependes of what you are looking for.

  • You just need to have a Count Var and Scan your array. Each element of your array that has dialog, applies the token count. It's pretty straight forward. Here is an example I've made. You should test it more though.

    https://drive.google.com/open?id=1brpQS6vwmuht63ddxNWfskSO_PBPui73

  • Can't you just keep the first line of each colunm to name it? The same for the lines, meaning each Y of your array is a dialog, and again, you can save the first colunm to name it. Scan the array and it's done.

  • Yes, you can. Right of the bat the first thing I can think of is tokencount. Use space as separator, and then each token is a word.

  • Of course! Even math not being my strongest side I should have seen this lol. Thanks newt

    edit: here is the example capx I've made so other people can use it. It is in c2 so people without c3 can use it too.

    drive.google.com/open

  • I'm using this formula but It's actually picking in a square area.

    (cos(random(360)) * radius) + posx

    (sin(random(360)) * radius) + posy

    posx and posy is the center, which is player's position.

    radius is the attacking range of the enemy.

    The goal is to pick random destinations but within attacking range of the enemy, so he can walk around while his attack is in cooldown.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • I've never knew which approach to take in order to achieve the best performance when it comes to animated VFX object. Should I use one single object holding all vfx animations or several objects for each one?

    I believe that when you create an object, all animations are loaded in memory, so creating a bunch of these objects unnecessarily holding all animations could take too much memory, but I don't know if it's true.

    Basically, the question is: create the vfx object holding all animations in the game and setting its animation accordingly, or creating the spcefic object with that animation only?

    In my opinion 100 objects holding all animations in the game have a worst performance than 100 objects holding its own animation only but I'm not sure.