nimos100's Recent Forum Activity

  • I think you should use the angle of the object instead. So I would imagine that right before you change it to 8 direction behavior you can just save the angle of the player character and just do what you did already with that angle.

    Player: Set Angle -> Angle_as_Bullet

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can just add a pick nearest to the part that does the "hit check" and just "pick the nearest enemy to the arrow"

  • Maybe I misunderstood you, but then you can just ignore my post :D

    But if I understood you correct, you have several slots which each have a name of an animal attached.

    Some pictures of animals then needs to be match to the correct slot?

    If that's the case, I think the easiest would simply be to "hard code" the solution in C2, for the 3 objects.

    1. Textbox with the name of the animal

    2. Slot where the picture of the animal should be placed.

    3. Animal picture.

    For each of these objects you add a variable called "Animal_name" and you simply use this to make sure that they match.

    A way to do this could be like this:

    1. When the game starts you set the variable "Animal_name" for the textbox to a random animal name.

    2. Copy this animal_name to slot where the picture of the animal should be placed. So now both the textbox and the slot have the same "Animal_name"

    3. Since you already know what animal each picture shows, you can add the correct animal name to the picture in C2.

    4. When the player drag a picture of an animal over a slot. You just compare that the "Animal_name" is the same for the slot and the picture dragged.

    Anyway hope that answers you question :)

  • I just tested what you are actually trying to do as far as i can understand. And had the same problem as you had, unfortunately I weren't able to fix it either, as it seems to be hardcoded into how the pathfinding behavior works, so it seems to want to smooth the movement.

    In general the behavior need a bit of updating in my opinion, it seem to be in a state of "just" being useful, with all the feature that would make it very useful not being there, but hopefully they will update it soon.

    However depending on how you want to use it in your game, you might be able to use some of it.

    In the testing I did, I wanted a "unit" to move around like you would see it in a game like Dwarf fortress, so its not based on "over time" movement. but 32 pixel at the time. If that is what you are looking for. You can use the path finding to find the path for you, and manually move the unit yourself, using very simple "If statements".

    In my test i used a tilemap, which give you a grid from 0 - X, 0 - Y and you can transform a sprites(X,Y) to these tiles. So what you can do is to transform the nodes from the pathfinding into these tiles coordinates, and use these to know where to move the sprite.

    So if the pathfinding find 2 nodes to reach the destination, which converted to the tile coordinates are:

    (0,5) and (5,3)

    And your sprite is at 0,0 (tile coordinate)

    You can simply check if the sprite X value is the same as the first node X value, if that's the case you check the Y value, since the node Y value in this case is 5. You can add 1 to the sprites Y value, so now its at (0,1) and you just keep doing that until the sprites position is the same to where you want it to go.

    I guess you could add animation to it, if you wanted but i haven't tried that.

  • "@nimos100, and others, how many parameters do you typically use in your functions?"

    It varies a bit but normally not more than around 5-9, but are working on a game that are quite complex. And the items in it can have quite a few settings and different ones depending on which item it is. And therefore i original decided to just add all settings into a single item object. However due to the functions not being able to handle them all, i had to redesign the way it worked. This is not a huge problem, but was just the way i found out about the bug. So even though its not that big a deal, i thought i would just make them aware, so they could fix it if they feel like it.

    The renaming part of parameters i suggested because when you check parameters you might have several "Function.parametre(0,1,2,3,4,5,6) = 1 or 24 or whatever) But these doesnt tell exactly what ir is. And it would just be handy if it instead was "Function.Is_weapon(0) = 1" and so on. I do use globals in some cases especially if i use text for testing, as its easier to avoid mistypes that way. But having a lot of global variables can also be a bit annoying as the list when you need to use one can be quite long.

  • You should most likely post this in the How to section, then you have a better chance of getting help i think :)

  • Hi I really like and use functions a lot. But it would be really nice if you were able to rename parametres so instead of them being called Parametre(0,1,2,3..etc)you could name them yourself.

    Since the function is added as a single object to the Whole project im not sure if thats possible.

    But a way it could work was kinda like dictionaries in the way they are added to a project. So each time you needed a function you just added a new function object. And you could add parametres to it like you would add variables to a normal object. Then you could name them what you wanted.

    Anyway if something like that is possible it would be great i think. Would most likely also solve the 25 limit parametre UI bug i think :D

  • Link to .capx file (required! If link is blocked remove the http and www parts):

    http://

    This is just something that i noticed by mistake.

    Steps to reproduce:

    1. Cant add more than 25 parameters to a function

    2.

    3.

    Observed result:

    If you add 25 parametres to a function call, the window "screws" up.

    Expected result:

    Expected that it would simply show a scroll bar on the right side so you could scroll through them.

    Browsers affected:

    Chrome: yes/no

    Firefox: yes/no

    Internet Explorer: yes/no

    Operating system & service pack:

    Construct 2 version:

    157

  • So im playing a bit around with tilemaps and path finding, but cant seem to get it to Work correctly.

    I have two tilemaps. 1 tilemap just contain the Graphics, and the 2nd one i use as an obstacle map.

    So when a graphic is placed on the graphic map that needs to block movement i update the same tile on the obstacle map.

    However after i have updated the obstacle map for the unit with path finding it get stuck. Some times it can move two times.

    I have tried to lower the cell size to 1 (which is pretty extreme) but still it get stuck.

    I have also tried to reduce the size of the collision mesh on the obstacle map. That doesnt help either.

    Anyone had any success using these two things together? And if so have any suggestions what im doing wrong?

  • Not sure if its a bug or not, but it very confusing if its intended, as it make it hard to know pinned objects actual position. Seems that if you press the button a second time it shows the correct position. If you add a wait 0.05 it works. So seems that it doesn't get updated straight away, which is very confusing.

    Link to .capx file (required!):

    dl.dropboxusercontent.com/u/109921357/Pin%20test.capx

    Steps to reproduce:

    1. Pin an object to another object

    2. Move the parent object

    Observed result:

    When you print out the X,Y value of the pinned object, its not correct.

    Expected result:

    That the pinned object had the X,Y value of its current position.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7

    Construct 2 version:

    r151 beta

  • You just make a Global variable and give it a name.

    Like: (You just right click an empty area in the event sheet and choose "Add global variable")

    Global Last_frame = -1

    Then in the event you just add: (System->set value -> choose the variable and set it to the value of the frame number that was chosen, in the random roll)

    Last_frame = <the frame nr>

  • You can just save the last frame in a variable (Last_frame) and test against it after you make a random roll, and if they match make a new roll, else store that frame number in the "Last_frame" and change the frame.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies