strangeDays's Forum Posts

  • Thank you for your suggestion. I tested it and it adds 1 additional collision check per tick for every solid in the level. Not too shabby.

    But in the meantime I have found another solution which adds no additional collision checks per solid.

    When the player collides with a solid, a helper object is created at the same position of the solid, but with two differences: It is a little bigger than the solid and it does not have solid behaviour so that the player can overlap with it. So now you only have to check one single object for overlapping with the player. If the helper object overlaps with the player, the solid "kind of overlaps" with the player, too. If the helper object suddenly doesn't overlap with the player anymore, neither does the solid. In that case, the helper object is destroyed and the text is changed to "not on collision".

    Now of course it's gonna get a little tricky when you have different types of solids with different forms and sizes but maybe rexrainbow's nickname plugin can be of help then. If I decide to investigate that matter further, I will check back to this thread.

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

  • Hello,

    I was wondering since quite some time: Is there any good way to check whether an object is not touching a solid?

    Example: When the player collides with a solid, the text changes to "is on collision". Now when the player moves (or jumps or falls) away from the solid and does not touch it anymore, the text is supposed to change to "is NOT on collision".

    Below you can see one possible solution, but I think this is very hard on the memory because at every tick, it has to check every single solid whether they are the nearest to the player and then whether they are (almost) touching the player. Or am I misunderstanding this?

    I am looking forward to better ideas. Thank you!

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

  • You do not have permission to view this post

  • Thank you. You are right. You have do it in Construct, too, it's not enough to place the files in windows explorer.

    You have to go into Construct, Projects Window, scroll down to the Files folder, right click and import the file. So simple, but easily overlooked.

    It works with the JSON already. I struggle to successfully read and print the contents of the .csv, but that might be a .csv-specific problem that I'll surely be able to find a solution to in the csv-plugin thread.

  • I have exactly the same problem. I've put a .csv file into the "Files" folder where those .pngs are and also a copy of the .csv with a different name into the root folder, but neither works. And with a .json instead of a .csv it doesn't work either - although I know that this should work, because I've done it successfully in another project few years back.

    I use (and have successfully installed) rex's csv plugin of course.

    Any advice?

  • Like this:

    Subscribe to Construct videos now

    from 8:50min onwards

    (not my video)

  • Hehe okay I see. Like I said in the first post, I'd rather not have two families with the same content just for workaround purposes because then everytime I create or delete a new object I have to remember to do it in two families. But I guess this is the best solution at the moment. You can even put the whole code segment in a group that becomes active on Drag Start and becomes deactivated on Drop so that it only uses resources when in fact a dragging is in process. Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for your fast reply, 99instances.

    1.) Sorry about the debugger thing. I used the debugger in the bigger project (from where I extracted this problem from) and the number of checks per tick kept changing without me doing anything so I got confused. Should have looked at the debugger for this example project too.

    2.) Ok, so you are saying that after line 2 the Previous Picked Object List consists of only the one square that is dragging. But now let's say in line 3, I would change it to the following:

    This seems to work, so even though the circle is not on the Previous Picked Object List, it is still considered for this condition. Then why in this version

    all the instances and objects of the square family are not considered for this condition? Yes, they are not on the Previous Picked Object List, but neither is the circle. Is it because - in constrast to the circle - they have been excluded in line 2 from being considered for subevents after line 2? Why is that? I mean what is the reason for Scirra to have made it like that?

    3.) Hmmm. This doesn't bring us closer to the solution I think. I have to go work in the garden now, I will check back in later when I have come up with a solution or to see if someone else has found one.

  • Hey guys,

    if you could help me with my problem, I would appreciate it very much.

    Short description: Ten squares, all in one family with one family behavior: drag'n'drop. When you drag one square over another, call the action (in this case: restart layout).

    Problem: Version 1 is not working. Version 2 (same as version 1, but the order of event and sub-event has been inverted) is working, but I think it is way more performance-heavy and I also cannot use in my project since I need to call an 'else' later.

    Could you advise me on how to make version 1 work? Creating another family with another name, but with the same objects as in the first family is not an option.

    Thank you.

    Here is the .capx: https://www.dropbox.com/s/khlz8r2ewyv8v ... .capx?dl=0

  • Okay thank you. If I understand this right though, I still need to check at some point whether the enemy has the instance variable isInvisible is set to true so that the tower does not shot at it and the only point where I could do that is at this event:

    On turret shoot

    So to that event I would add a subevent that checks if isInvisible is set to true and to that subevent I would an else where as action I would do the whole "spawn bullet"-thing.

    But this would be a bit too late I think because the turret still follows the enemy with its barrel, I just doesn't spawn bullets right?

    Thank you also for the general advice, I just think that in my special case, I'd kind of need the opposite of having the same object in two families.

  • Hey guys,

    I'm looking at a problem that surely has workarounds but as I'm always striving to improve my construct skills I am looking for a better solution from more experienced people.

    So it's a tower defense with the family enemies. That family contains - amongst other enemies - the enemy object wolf.

    Now I would like to have an invisibleWolf that has exactly the same animations and behavior as the normal wolf, with 2 exceptions:

    • its opacity is set to 50%
    • it's not part of the enemy-family yet, because I don't want my towers to shoot at it (they have the whole enemy-family set as target). ONLY if one special observer-tower "shoots" at it, the invisibleWolf becomes visible and all the other towers can shoot at it (as if it was just moved to the enemy-family).

    Now I could just destroy the invisibleWolf and create a normal wolf at the same position when the invisibleWolf is shot by the observerTower, but then the new wolf would first turn and need to find the path again so it would basicly stop there for a second whereas I am looking for a "smooth" transition:

    just turn the invisibleWolf into a normal wolf, as if that certain instance of the invisibleWolf was moved to the enemy-family (so that it becomes a target for ALL towers) and has its opacity set to 100%.

    It's problably not that easy so I am not disappointed if there's no quick solution. Then I'll just do it with a workaround. But thank you in any case.

  • Ok here's a pretty dirty way to do it:

    [attachment=1:2qqnaum2][/attachment:2qqnaum2]

    So basicly it says: when a certain event is triggered (in this case a button is clicked), it sets a group active and in that group it generates a random number between 317 and 700 at every tick. Then it checks in the subevent if that number does NOT lie between oldLocation-100 and oldLocation+100 (meaning: it does NOT lie within range of 200px of the oldLocation). So if that's the case, it sets that good number as newLocation AND oldLocation, generates an object at that location and sets the group inactive. Until you click the button again.

    I'm sure the more experienced guys here can provide you with a better solution because this is probably not that good performance-wise.

  • Maybe I misunderstand, but the minimal distance of the movement already is 317. The method looks like this: random(minimum, maximum).

  • Edit: capx fixed

    Hey guys,

    since there was some talk about different kinds of enemies, but no actual project with that feature except for the Space Shooter (or I am blind), I went ahead and gave it a shot. I am a beginner, so it really caused some meltdowns in my brain during the last 3 days and there's probably still a lot of room for improvement perfomance-wise.

    As I am working on a tower defense with several levels, I made it so that each level can have its own .JSON-file where the data for the Enemy-Wave-Management can be stored and fed to an array which the events have access to. If you double-click on the JSON-file, you can easily access and change it. (It opens with your standart software. I use JSONedit.):

    [attachment=1:1a443rk2][/attachment:1a443rk2]

    I probably could have saved some events, if one were able to address members of families or instances of an object that have a certain instance variable not only in conditions, but also in actions, somewhat like this:

    [attachment=2:1a443rk2][/attachment:1a443rk2]

    So all in all I think it works but again, since I'm new to this, if someone doesn't find it too complicated to have a look at it, knock yourselves out.