nimos100's Forum Posts

  • What I would like to change :

    Right now, if I want to change something in the way damage is dealt to monsters, I need to update more than 800 events! And I will need to update this code many times in the following months... So I'm looking for a solution to avoid this.

    I hoped I would be able to do this with functions, but if I'm correct, it appears that functions doesn't allow to define a certain object to which the function should be applied.

    Is there any simpler way to deal with that part of the code?

    Thanks in advance for any ideas!

    Functions work on whatever you tell them to work with. So you can define exactly what objects you want and don't want. It depend on what you call it with. Unless I misunderstand what you mean?

    Initially by looking at the code you have posted, it seems like you have a lot of unnecessary code due to the way you have made it. Meaning you have X amount of enemies, which I assume all share the same properties, like health and so on. But from the screenshot you are referring to each of them as individuals, like Wolf, Rat and so on. But if you had a family and some other structure of events using functions, you could have used the family instead, except for spawning them. Meaning for instant in event 799 and 795 you basically do the same thing, dealing archer damage to an enemy. But since all enemies have health you could simply put this in a function if you had family. like so:

    We pass two objects to the function.
    0 Param = Enemy
    1 Param = Player Character
    
    Function "Deal damage to Enemy"
    Pick Fam_Enemy.UID = Function.Param(0)
    Pick Fam_Player_Character.UID = Function.Param(1)
    //Now you have both the enemy and the player character picked.
    Fam_Enemy.Health = Fam_Enemy.Health - Player_Character.Damage
    
    //Now it doesn't matter if its a Wolf, Bat or Rat. So you can get away with a lot of events using functions and families.
     [/code:2o38iop6]
    
    Now this is just an example as im not sure how it works exactly in your game. But using families and functions are crucial in my opinion, because as you say yourself, you now have 800 events and having to go through them and correct them will take a long time. And to turn it all into using families and functions will also take a while, as you have to remake a lot of code. But if you plan on making lots of changes the next couple of month, my best guess is that you most likely would benefit the most from organising your project so it uses families and functions correctly. So the base for further developing your game is in order. 
    
    Anyway since you are only showing a small part of your program, this is just my initial view from looking at the code in your screenshot, so might of course not be true.
  • Due to the popularity of 90/120/144hz monitors in the gaming scene (and its growing) and the way C2 runs in sync to the refresh rate, would it be possible to force 60 hz rendering for the engine?

    This is to prevent some possible bugs as well as to limit excessive CPU usage.

    Not sure what you mean, FPS is not the same as Hz. FPS is how many images are processed by the software per second and Hz is how fast the monitor is refreshing the view or display.

    So limiting the FPS to 60 doesn't really matter in terms of how fast the monitor refreshes. Or do you mean something else?

  • i can't figure out how i have tried so much stuff but they are all not working..... there is a method but than he spawns endless and it gives a error... i have fixt this but there not spawning... only 1 piece...

    Anyone?

    If I understand what you mean, you would like to know how you can make sprites spawn next to one another?

    In that case you can do it like this:

  • No the container should be fine, if it works for what you need

  • Hello. So I guess this is a basic stuff but somehow can't manage to make it work.

    I have a player box and a player skin set to player box on every tick. This works great for my player but when it comes to enemies, since they're clone of eachothe, the set position only works for the very first enemybox and the other ones remain invisible since they have no skin attached.

    How can I attach a skin to an enemy box so it shows up in every enemybox clone?

    If I understand what you are trying to do to. You can do it like this.

    Since you always have an EnemyBox and a Skin for each enemy. You make a variable in you Skin object called "Enemy_UID" and here you store the Enemybox.UID.

    Every tick

    For Each EnemyBox

    Pick EnemySkin.Enemybox_UID = EnemyBox.UID

    ---> Set Enemyskin.X/Y = Enemybox.X/Y

    However the Pin behaviour should be able to do the same, using a similar setup, you just have to be aware that if you need to pin more objects together than 2 you always have to pin to the same main object or you will get "ghost trails" or what to call it.

    So:

    Pin -> Main <- Pin (That's fine)

    Main <- Pin <- Pin (Last object create ghost trails)

    However this might be true for every tick positioning as well. I cant remember. But anyway only important if you pin more than 2 objects together.

  • I truly appreciate the input. Thank you, everyone! Any other suggestions or ideas? Send 'em my way!

    Think your way of doing it is fine, and the other people uses as well. The only thing C2 is really missing when it comes to organisation of projects, is that you could "Ctrl+Click" a function call and it would jump to that function in whatever event sheet it was defined. Scrolling through so much code when doing larger projects looking for functions, it would save SOO much time.

  • Hey thanks alot, this is almost the behavior I am looking for! This really helps me understand the logic behind it.

    How would I go about making them snap to the locations instantly instead of the bullet speed though?

    I tried implimenting nimos100 solution and looking at yours as a reference as to how things are set up, but I can't get it to work

    Forum had some problems so I couldn't post any reply. Seems to be working now!

    The idea I posted doesn't use bullet behaviour, it just moves the object to another object position. You could do it without and just change the coordinate (X,Y) to where you want your object to go to. But using 3 small sprites and just move the object to one of those depending on the index, you can move them around screen and the object will always go to the correct position. So its simply so you can make the functionality one time and then you don't have to keep updating the X,Y whenever you want to move them. If you want it to move instantly as I understand you want, you don't need the bullet behaviour, think that will only mess things up.

  • I don't know if my code is wonky or if this is a bug of some sort, but my npcs are not moving although they should be. Any way, I can't figure out what's wrong so I might as well post the .capx. Thanks. https://www.dropbox.com/s/j2fzvrip0uf3c ... .capx?dl=0

    The way you use path finding is not good and is used a little wrong, that's why it doesn't work.

    Move along path is an action related to an object in this case your NPC, and should be used together with "On path found" and not every tick.

    Here is a modified version that works:

  • Hey guys,

    If i have a platformer mainly with 20x20px tile size and characters around 30x30, what happens if i load for example 40x40px tiles and manually scale them to 20x20 so they have better definition? It affects game performance?

    The larger images you load the more image memory will be used. This is based on the original size so if you load 40x40px images and scale them to 20x20px it will still use as if it was 40x40px.

    Scaling 40x40 image down to 20x20px wont improve quality, as you have less amount of pixels to show the same amount of information.

    40x40 px = 1600 pixels

    20x20 px = 400 pixels

    So as you scale down big images you loose details and thereby quality, if you scale up images you have more pixels available to show information that there are in the original image, and therefore you will start to get more blurred images.

    The best you can do if you want the best quality images is to make them the size you need and not scale them, but in most cases you can get away with scaling as long its not to much.

  • You just add both condition to the event?

    If A = True

    If B = True

    ---> Do C

  • This is by design: because the fade behavior is active on startup, it retrieves the opacity to fade to when it is created, before 'On start of layout' triggers. After that it controls the object opacity, so your 'Set opacity' action is overridden.

    The workaround ought to be to have the fade behavior inactive on start, and use the 'Start fade' action after the 'Set opacity' action. However I noticed this did not work, but fixed that for the next build.

    Cheers Ashley much appreciated

  • >

    > Your approach:

    > Object collide with tile on tilemap that have a certain ID

    > Find coordinate

    >

    >

    >

    Why do I have to find coordinate?

    my approach is :

    Object collide with tile that have a certain ID on tilemap

    and that's all. I just want to interacte with tile that have a certain ID on tilemap if this tile is collided by an object, whatever coodrdinate.

    Yeah guess it could be done, if C2 made all the checks. So you are actually requesting a feature, more than asking for how to do it I guess?

  • When I talk about improvement, I mean that all you say would be handled by C2 in background process.

    The actual way to specify tile by ID is really useful in many case but also tedious for non programmer users.

    So, the "improvement" that I talking about is only ergonomics :

    if the user add condition > on collision with another object > tileMap (indicate tile ID in text field below)

    C2 should manage to write all the things that you explained to me in the code (comparison tile at, for...loop, etc).

    I'm glad to learn what you explain to me, but I think that kind of improvement should be coherent with the principle of "no coding" developpement software.

    But what you want to do is like it is, you just want to use Tile ID first instead of coordinate. But regardless of which approach you use, you are going to have to check the tile coordinate anyway.

    Your approach:

    Object collide with tile on tilemap that have a certain ID

    Find coordinate

    C2 approach:

    Check if object is colliding with a given coordinate

    Check if its a certain ID

    But its not really coding as I see it, its math using a very basic coordinate system.

  • Thank you very much for this explaination.

    So, if I understand well, I have to specify coordination for all tiles wich have same ID?

    If I have 30 tiles "ID:3", I must create 30 conditions for each tiles if I want add an action "on collision/ is overlapping"?

    It's sounds crazy.....

    No, the coordinates and IDs are automatically created by C2. For the coordinates as shown in image (4) these are the same no matter what tilemap you use. So top left corner will always be (0,0) regardless of your tiles being 32x32 px or 128x128px.

    The tilemap object it self use its own coordinate system. Might be easier to understand if you try to make a tilemap and set the tile width and height to 1 px. Then it works the same way as the normal C2 coordinate system (X,Y) that you use whenever you make an object and move it around, all objects then have a X,Y coordinate that tells you where on the layout they are placed.

    Its the same for the tilemap except it also have it owns coordinate system that it uses for placing tile correct in the tilemap.

    So you don't specify a coordinate for each tile, you check a certain coordinate to see if it contain a certain tile.

    If you have 30 tiles with a tile that have ID:3 you use a "For..loop" to go through each tile and check whether a tile have an ID:3 tile at that position.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To test on iPad I download from a Dropbox link and select "add to home screen" - it's un-playable still and with chrome on the PC achieving a mere 40fps after export -I am now concerned.

    I have not yet decided to pay Apple the annual fee, so cannot export with Cordova or Intel XDK. Is that correct?

    Is there no way of just exporting as an iPad app (for Dev testing only) which could then be dumped into iTunes and synced to the iPad? I tried all the older tutorials on here and set show depreciated exporters but haven't found anything that may help.

    Should also mention I'm still running C2 Beta 210, pretty desperate for the stable release but I started out that project using it.

    Unfortunately, I have to admit that my knowledge regarding performance on IPads and Phones in C2 is not my strongest point, I don't make anything for those, so only know what others are reporting about it, and from what I understand you are not the first one to experience performance issues with those devices.

    But I really don't know what you can do to fix it, but hopefully someone with mobile developing experience see the post and can give you some tips.

    But if you loose 20 fps in Chrome after adding the menu, something could indicate that you are doing something wrong in that part. Especially if you say that its very simple. The screenshots you posted was that the whole menu?