nimos100's Forum Posts

  • Well, I'm using C2 for a quite large project, so I thought the pre-load at the beginning would take a very long time.

    So, is there a way to load each layout separately?

    Thanks a lot.

    You can change the start layout from default to the one you want in the project properties settings.

    click the background and you will see the layout properties in that list there is something called "project settings - view", there you can change it.

  • Problem Description

    Everytime I try to export a project to html5 I get this message:

    Have had this problem for a long time. I normally just zip the tools folder (where the whole pngout is) and when it happens I just extract it to the C2 installation folder again. Think it might be related to Antivirus or maybe Windows security settings or something, however haven't been able to solve it. So just do it that way whenever it happens.

  • OK bear with me here I got that part - where can I find the "If X found" function? The only similar thing I can find is for pathfinding "On path found"

    Its not really a function, why I put it in <> to just show that if it was the case, then what would happen.

    <If tree found> is automatically done if its true.

    To explain it, imagine this:

    3 workers
    2 Unoccupied tree
    
    For each Worker <---- Will run 3 times in a row since there are 3 workers.
    Tree.Occupied = False  <---- Will pick all tree which are not occupied. In this case 2.
    Pick Nearest Tree to Worker   <--- C2 will check the distance from each tree to the current Worker and select the nearest one.
    <If tree found>   <--- Since it picked a tree it must be true otherwise it of course couldn't pick any and therefore false. 
    
    So when the first two workers have been assigned a tree, there will be no one left for the last worker and therefore it wont be true. In which case you can throw in an else.
    
    <If tree found> 
    ----> Go to tree
    <Else>
    ----> Do something else 
    [/code:305s3aic]
  • Aha! I thought it would be something like this, thanks. One thing - I can't seem to find the "Pick nearest " action in the Pick section. Am I missing something?

    Its an object functionality not a system one, and its actually called "Pick Nearest/Furthest" you can find it under the section Size & Position

  • nimos100 have you seen this tutorial?

    https://www.scirra.com/tutorials/1118/path-finding

    Not really sure what that solves, I assume you mean using path finding without obstacle map? but that pretty much ruins the whole purpose of it? Because in that example the path finding is just used to move a unit to the castle and stop when it hits it. But what if there are 5 castle behind each other and you want the guard to go to castle 4, then it will hit castle 1-3 and stop? But how would you make it move around the castle, if there are no obstacle map?

    This is not a self created problem and since the OP is really old back when C2 was r182, and I haven't heard or seen any updates that solves this problem and someone not long ago posted the same issue which made this old post appear again <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> I assume that the problem still exist.

    As stated earlier in this post I made a bug report and Ashley answered the following.

    [quote:18u42xvi]The problem is there is only one global obstacle map used for the pathfinding behavior. Everything pathfinds on the same map. So if you have object A with two obstacle types, and object B with no obstacle types, you have a conflict: should the one global map have those objects as obstacles, or not? In this case it happens to pick the global map where no obstacle types are defined. If you delete the red object there's no conflict any more and it uses the right obstacles.

    I'm not sure how to resolve this - having multiple maps becomes memory inefficient and possibly slower, but on the other hand perhaps the obstacle types should be global as well to avoid this situation... the easiest thing to do is to make sure you have the same obstacles added for every object using the pathfinding behavior.

    And again unless this have been fixed without me knowing I don't think it have been solved.

  • Hello!

    I recently started playing around with Construct 2 and I have some little experimental thing going where I have AI Pathfinding units that chop down trees and bring the wood back to store it.

    Currently all my units will go to the same tree and the one that gets there first will chop it down, the rest of the units that went to the tree are beaten to the task by the first unit and get confused. How do I make the Pathfinding AI units go to the closest tree that doesn't already have a unit on the way to it? I basically want to have a unit call dibs on a tree/object and then have the other units know that it is taken and go elsewhere.

    Thanks for any help you can give!

    You almost answered you own question A way to do it is to mark the tree as "occupied" the moment a worker "select" it.

    For each Worker
    Tree.Occupied = False
    Pick nearest Tree to worker
    ----> <If Tree found> 
    ----> Tree.Occupied = True 
    ----> Worker.Go to tree
    [/code:3b0gfoir]
  • if I have two big objects collide is there a way to get the X,Y coordinates of where these two objects are hitting, or overlapping so I can add an effect there? like collision X, y ?

    or maybe there are some behaviors that can track collision points?

    Edit: or get nearest image point, or anything like this?

    If your objects are the same size, this can easily be calculated like this.

    And if they are different sizes you can probably add some math magic and calculate that as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not anything I've messed withthis , but if I understand your problem...defining the other sprite as an obstacle and refreshing around each every x seconds should work...or so I would think. Both sprites much be obstacles respectively. I've been running multiple copies of the same sprite and defining hits on overlap...works fine and kinda the same issue. Just havta be careful not to refresh the whole thing each time or you'll run at negative fps lol

    It shouldn't matter whether you keep refreshing the obstacle map as there are only one. Besides that if you refresh it constantly you will most likely ruin performance.

    The problem occurs as each units might need to have different obstacles. Like a ship, plane and car.

  • Hi can this be done?

    Play audio from a folder on disk. (Node webkit)

    I want the music in my game to be loaded that way.

    Kind Regards.

    Savvy001

    Shows how to do it.

  • nimos100 Thank you for your time and help.

    To confirm, this DID work for you and you were able to PLAY audio files that were sitting on your "local C: hard drive" and NOT the "sounds" folder within C2, correct?

    I tried this exactly, but was not able to make your workaround work, even for files sitting on my local C drive. I followed your example exactly as described. Do you think that you can share a simple .CAPX, just to see if i missed something.

    Thank you in advanced for your continued assistance...

    nimos100 & Animate

    i tried the example as well without success .... a sample .CAPX would be a huge help!

    thanks!!!

    -Rik

    Here is an example that will let you load and play an audio file from your computer.

    Capx:

    https://dl.dropboxusercontent.com/u/109921357/Play%20sound%20file%20from%20disk/Play_sound.capx

  • Hi,

    I have a question about creating objects and then triggernig On Created. Basically, if have different enemies, all in one family, if let's say I create enemy10 will then On Family Enemies created will work for that particular object? And what if I create number of different enemies at the same time? Thx

    All objects that are part of the family will trigger both there object and family On created event. Since "On created" is a trigger it will trigger for each object so this shouldn't be a problem if you spawn more at the same time, as they will be handled individually.

    The priority of triggering the "On created" is object first then family. So family settings will overwrite the object settings.

  • Ok, do you know another way to do the same thing?

    From what I understand you are trying to make it so every time the mouse cursor moves over one of the sprites they switch place right?

    Here is an example of how you could do it. I haven't used any families etc. to keep it simple:

    Each sprite have a Boolean variable called "Active" and only when this is true the switch will take place and will be switch for each of the sprites when the mouse cursor is not over them to avoid them flashing.

    Capx:

    https://dl.dropboxusercontent.com/u/109921357/Sprite_switch/Sprite_switch.capx

  • You have to remember that the "Else" is linked/based on the former event. Which means that as long as mouse cursor is not over sprite8, the "Else" will trigger true. So your code switches between "Mouse cursor over sprite8" being true, which moves sprite8 to 2000,2000 and then the next tick the "Else" will be true moving it back again. Which explain why you see it flicker or flashing.

  • imgur . com /py7PPIR

    The link doesn't show anything, even when spaces are removed.

  • Sorry (maybe a bit slow today) but doesn't the manual state that after setting the source the video would be paused and would need the 'Play' action to start it?

    [quote:2zgxklw1]Set source

    Set a different video file to play. As with the object properties, three formats can be specified. Setting the source does not automatically start playing the video; use the Play action to start it after changing the source.

    So wouldn't this mean it's working correctly?

    No, it means that the manual is not very precise or correct regarding this

    Because it doesn't matter whether you change source or not. If Autoplay is set to "Yes" it will play whenever a source is set.