nimos100's Recent Forum Activity

  • DEMO:

    https://dl.dropboxusercontent.com/u/109921357/Spritefont_scrollbar/index.html

    I guess im not the only one that would like to use lists made of spritefonts instead of the normal lists that comes with C2. Since I needed them for my own game I decided to see how I could do it. So if anyone need something similar you can use this.

    I have made It so it can be place anywhere on the layout and should work without changing any code, I have also made it so it can be copy/pastes into any project, it simply need to have "function" available.

    EDIT:

    Found some bugs that made It not work when size of the list was increased, it have been fixed now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • nimos100 just tell the game to wait 1*dt seconds or 0.016 seconds, both are just 1 (ONE) tick worth of waiting. Don't know any human on this planet that can be bothered of having to wait 1/60 of a second for something. do you? xD

    Yes me

    Just kidding , I agree the problem is not really the wait in it self even if you use a wait of 0.1 its equal to 6 ticks if im not mistaken, so its hardly noticeable, so its not really a problem. The problem is that wait in it self even If it only have a duration of 1 tick can cause problems that can screw up things.

    Here is an example:

    [quote:2lh8k2e3]Repeat 10 times

    ------- Call function("Spawn enemy")

    Function Spawn enemy

    Create enemy()

    Call function ("initialize enemy")

    Function Initialize enemy

    Call function ("Create enemy weapon")

    Function Create enemy weapon

    Create Enemy_weapon

    Then suddenly things starts to go wrong as I see it.

    Because now there are actually two objects that doesn't exist yet, The Enemy and the Weapon that you want it to use. So if you throw in a Wait different places to solve it, It might work. However at the very start we are actually repeating this 10 times, to create 10 enemies which will then create 10 different weapons, so suddenly you might have 20 objects that actually doesn't exist, and then it seems to go wrong. Whether that's completely true im not 100% sure about, but it seems that a function doesn't count as a top level, which I find to be logic if its the case, but I haven't seen anything saying that it ain't which is why im not certain.

    I solved this by implementing an object handler which I use every time you would otherwise use a wait. This completely replaces the need for using waits, except for this problem with behaviours because it runs after all "Events" so in that case it cant solve it. But since I didn't knew that was how C2 handles behaviours, I thought my object handler could just fix it as well, but now that I know how C2 handles behaviours it makes perfect sense that it doesn't work with them. But since I made a work around for that as well, I can or should just be able to do that if I have problems with behaviours again, but I haven't actually had any problems with them except for the pin one, so doubt it will be a huge problem.

  • [quote:2hjuguqp]What Ashley mentions is that the behaviours become more noticeable with 2 pins. But there is pin lag and it's in C2 architecture. But by all means if you feel it's a bug. Fill one out.

    The order as I think I understand it is

    EventSheet

    Engine

    I don't think its a bug, that's why I added it as a suggestion here. But I see what you mean and think you are correct that its because the Pinned objects is not actually moved before all other actions are done. So guess its not possible unless that got changed and doubt that its going to happen

  • Wait action is my fav work around

    Im not happy with the Wait solution so that's a no go for me, I don't want to slow down my game on purpose . And have solved it without using wait, so its just that I thought it could be possible and just curious if it could be done, as the work around is just a lot more complicated, than putting in a wait.

  • nimos100

    Already been asked

    You will just have to use a work around.

    Im not really sure its the same, It a bit difficult to see I think. Because Ashley writes:

    [quote:3jpifp5g] As you can see from this modified example there is no lag at all if you only use a single pin:.........

    .............The problem comes from using two behaviors at once.......and the second pin updates before the first

    So it sounds like this have to do with two pin behaviours, but this example is only using 1.

  • [quote:iulvo9u3]what you're doing with the "wait x seconds" actions, is effectively tell the game to wait for tick 1 to finish, at which point green's locations is stored at the destination.

    Yeah I know. However "Pin" is a behaviour so there must be some code behind it, which C2 uses to tell it that this particular object needs to be stuck to another object. So when you use the functionality to move an object to a new location there again must be some code in C2 that does that. If that code got expanded so if the object it tries to move is flagged as being pinned or having objects pinned, it could be possible for it to move all the objects which it involves before finishing the code. My guess is that the functionality that move any object in C2 just take 1 object and move it to wherever it needs to and it do that for each object in turns.

    So when the parent have moved all the children then get flagged as also having to move and it then happens again for each of these. It just happens so fast that it seems like it all happening at the same time. But I don't see why it wouldnt be possible to extend the "C2 move object functionality" to check for this first. But as I don't know how its done and just guessing I hope that Ashley can explain whether it could be done

  • [quote:2actupvp]are you saying that a 1 tick delay is messing up your game??

    I don't really see how that's relevant, whether its 1 tick or 15 ticks? if something happens in 1 tick that screws up things it will screw up things.

    Its more that its not logic I think and I would assume that it could be done in the same tick. Since it must know how far the parent have moved it should be able to move the children that amount as well.

    Here is an example of the problem.

    Which is pretty simple the green square is getting pinned to the blue parent and moved to 250,250. The purple square is then told to move the green child. The result looks like this.

    If you add a wait it works.

    The last screenshot if you remove the wait, is how it should logically work if you ask me, because as mentioned above if it knows how far the parent moved it should know how far to move each children as well. But im just not sure if its actually possible so that's why I ask

    If you change it to go to the parent it works fine.

  • Would it be possible to update the pin object functionality so when you pin an object to another and you move the parent object, that the child object(pinned object) moves along in the same tick instead of the next one?

  • [quote:2ygxggyq]Haha, I think there is a large gap in the market for old school RPG style games with modern elements.

    I honestly don't think there are a lot of people that remember those games, but the gameplay in them are amazing the only thing I didn't really like about them was they always had level caps which annoyed me, because then you would always have the feeling that you would reach the end soon.

    [quote:2ygxggyq] Any idea on how long until a demo/release or is it an as and when you are done scenario?

    To get the game to a very early personal alpha is not that far away I hope and that is my current goal. But it will be so all the major parts of the game works. Which would be that the player can walk around the map, enter dungeons and cities and engage in fights.

    And at the moment the walk around the map works you can enter dungeons and Dragonhelm is the only city available at the moment that you can enter and interact with while inside, but it is enough that it should be fairly easy to make it so you can enter the rest, which is more a matter of making the cities them self. Then I actually "just" need to make the tactical combat system, with the things that it requires like some enemies.

    Then it would be in a state where it more a matter of expanding the things and fill in all the gaps and make them work. So hopefully I can get to start working on the combat system. Which is only hold up as im doing some fixes to the character sheet, but I hope to be able to complete it today and then ill start working on that.

    But to get the game into the first real alpha that I will release will probably take a bit longer, as I don't want to release it if to many things are off and not working correctly. There is also a lot of work to be done with menus and such still which would make an alpha impossible as it would most likely crash all the time when used wrong.

  • You should post the video here as well. Its reminds of Terraria. The Physics are awesome, looks very funny when he falls like it hurts a lot

  • The big empty space in the view area is that the problem?

    Also you don't need margins that big, it just let you set the blue area around the workspace, where you can place objects during design.

  • Can see you are a bit confused about IID and UID and how to do it, so here is how you do it correct no matter how many cactus you have and how big you tilemap is, with a better explanation.

    IID and UID:

    Are not something that are unique for tilemaps. In fact all objects you add to your project will be assigned these. My best advice for now just to completely forget IID and only think of UID, I have used C2 for quite a long time and have yet to run into any problem where IID would be useful.

    UID is a "Unique identification number" (I think that what it stands for) but even if it doesn't you can think of it like that. Its different for all objects so you will never have any sprite, tilemap, button etc with the same number. This make UID very good for picking things, because you know it will always only pick one.

    If you look at the screenshot below of the correct code for exactly what you want to do.

    The loops are nested, which is the normal way of going through a lot of elements like in a tilemap or an array.

    If you look at the tilemap, the tile in the top left corner have a position of 0,0 the one to the right is 1,0 next 2,0 and so on.

    Since the program doesn't know where in the tilemap we have placed the cactus, we need some way to let it know. So we use loops to go through each tile to see if its a cactus. Since we don't know where to start we "set" the position to (X,Y) by default (You wont actually do this.)

    The first loop "Tile X" will start at 0.

    So now it would be (0,Y)

    Since the next loop is a sub event to the first loop and goes through the Y and also starts at 0, we get. (0,0)

    So it checks if (0,0) is equal to 15, which in this case it ain't so It loops again. However since "Tile Y" loop are the last one it will continue this one first before going back to the "Tile X" loop.

    So next time it will be (0,1),(0,2),(0,3).........until it reach the end of Y. In this case I have set it to int(Tilemap.Height / 32), this is because this will always give us the correct number of tiles to check in Y, the reason I divide with 32, is because each tile is 32x32 and int simply does that we always get an integer as you cant be sure that the tilemap height is always an integer if you scale it and then divide it with something, but the loop requires an integer to work or will go into an endless loop, which will make you have to force close the program, so that's not good, but happens quite a lot.

    So if the tilemap is 128 pixels in height we divide it with 32 and get 4.

    So the loop will run from 0 to 4, so in fact if we were to be 100% accurate we could subtract 1 from it as the tilemap starts at 0. So it should actually only run from 0-3 as the loops include both 0 and 3.

    But anyway when it reaches the end of "Tile Y" loop it will go back to the "Tile X" loop and increase that one, so now you would get

    (1,Y)

    And it would go into the "Tile Y" loop again and it would then be (1,0) and then keep doing that until also X reaches it limits.

    Hope that didn't confuse you

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