nimos100's Forum Posts

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The create is best overall. Because even if you have lets say 10000 hidden objects, you would have to make C2 not do something with these, that it should do with others, but to find out which is hidden you would have to check all objects to see if that's the case.

    Now 10000 objects are quite a lot :) but even with 500 and you having 35 events/tests that needs to check it, its quite a lot in the end.

  • Ok thanks :)

  • I downloaded the r150 beta, and now there are no Add action underneath the actions in the event sheet, is this on purpose or is it a bug?

    Its really annoying not to have it, anyone else uses r150 that can confirm it or not for me thanks.

  • That's a really nice solution I think. Thanks

  • I also have knowledge in computer graphics programs, such as max, cinema 4d, after effects, premiere pro, sony vegas pro, and other programs of its kind. But my intention was always to work with games.

    That's a huge benefit I think, as that's pretty much as complicated as programming in my opinion :D

    I've done several games using the tutorials and I created 06 games based on what I saw . This problem always occurs when I try to do something different than I have done . I can understand something, but some procedures are more difficult . This is the case of the "array " . Until today I do not quite understand how to use it .

    Yeah arrays can be a bit tricky, and I personally don't like them in C2 as well. So tend to not use them much, but do it some other ways instead.

    I'll create a portal of educational games for free access and I intend to create 15 games per month. This naval battle game, for example, when finalized, will be used to train multiplication tables, like a said before. I need a guy like you to help me. Do you have interest in give some advice on games that I have difficulty to build? I would like to pay you for it. If yes , how much you'll charge ?

    Sounds like a good idea. However making 15 games a month you are going to work a lot, even if they are simple :).

    But sure we can figure something out, ill send you a private message, so we can keep things separated.

    Family1 shipID = ship_1_mid.UID

    for each Family1

        ship_1_mid is overlapping Family1 : Destroy ship_1_mid

    There is going to be a conflict here.

    1. You start by selecting all ships which have the shipID equal ship_1_mid.UID

    So you have two objects (Assuming its a 3 part ship), "Front" and "End" part are the only ship parts that meets the condition. But what you actually want is to pick the "Mid" part by its UID. (The reason you want the UID, is because mid part doesn't actually use shipID, because its the part that controls the whole ship, the shipID is used by the other parts, so you know which "mid" they belong to.)

    2. Next you want to do something for each of these parts.

    3. ship_1_mid is overlapping Family1 : Destroy ship_1_mid

    You actually test if "ship_1_mid" is overlapping a ship. Which will select all "Ship_1_mid" that meets that condition. And then destroy them, since you haven't told it what "ship_1_mid" parts you are talking about it just pick which ever is overlapping and destroys them.

    But what you actually want to do is this:

    1. first pick a specific "mid part" check if that is overlapping another ship.

    a. If it does then destroy the ship. (Be aware that it doesn't destroy the "Front" and "End" yet.

    b. Else check other parts of the ship. (Front, End)

    2. Check if either "Front" or "End" with the shipID = Family1.UID overlap another Family1. But you have to make sure that you don't check against there own ship_1_mid. So you have to add another condition, that "Family1.shipID not equal Family1.UID".

    a. If it does, then Destroy ship_1_mid (Be aware that it doesn't destroy the "Front" and "End" yet.

    b. Else creation of ship was completed. Add +1 to ship_placed.

    To destroy the rest of the ship, you add an "on family1 destroyed" event instead that will handle the destruction of the parts. And in this event you pick all the parts of the ship that have the shipID = ship.UID

    For now that would work. However it will give you some problems later, as you start destroying parts during the game. But don't worry about that now.

  • First of all I haven't tried it my self :)

    But if you need to setup a local server you could try to see if a WAMP server can do the trick. But if that works with what you are trying i have no clue. But guess its worth a try :D

    You can get it here:

    wampserver.com/en

  • I use this:

    family1 shipID = ship_1_mid.UID

    for each family1

        family1 is overlapping family1: family Destroy

                                        System Subtract 1 from Nr_of_placed

    but not work. Maybe the problem is the subevent that verify if overlap happens?

    I think the reason it doesn't work, is because as you use For EACH you actually only work with 1 object of the family at the time. Meaning that if you have 2 part that match the "family shipID = ship_1_mid.UID" condition, it will first run 1 of them through the overlapping test, and then the next one.

    So actually the "For each family1" is being done 2 times with 2 different objects.

    You have to make it, so if it detects an overlap with one of them, you can stop the loop and pick all parts of the ship that matches the ship_1_mid.UID and then destroy them all, and subtract only 1 from nr_of_ships.

    In this case you subtract 1 when you destroy a part of the ship.

  • Before all, thanks for the tips and come here on Sunday to help.

    Sure no problem. :)

    I've noticed that the logical issues are very easy for you. For me, programming, even with so many facilitators as they have in Construct2, is more difficult. I know it's a matter of logic and commands are details. I think that I should invest in logic. Would you recommend something for this (book / website / etc). It has to be for beginners.

    I have a background in computer science, so that surely plays a part. But actually I don't really like programming, that's why I like C2 you don't have to type pages after pages with a lot of code to get feedback, on what you are doing.

    But I don't really know a lot of resources when it comes to programming, that I can recommend, because of my background knowledge, and the concept/idea is pretty much the same in construct 2 as if you had to program it all yourself in some programming language.

    But my best advice is to simplify things as much as you can, and break up what you want to do. And most things you have to do/program no matter how complicated it might seem, is pretty much just IF, THEN, ELSE statements, its just a matter of how complicated they are.

    But you can see it like this:

    If

       Apple is fresh (Conditions / Test)

    Then

       Eat apple (Functionality / Do something)

    Else

       Throw out (Functionality / Do something)

    When I started construct 2, I did the first tutorial with the Zombie shooter I think it was called, and then I just tried to create whatever I thought could be fun, and failed big time....I have dropped so many projects that I cant even count them :D

    But I always learn something, but my starting point is probably a lot different from yours, as I have also studied 2d/3d graphics and audio, so I have a somewhat good idea about the different things and how each part works, even if I haven't tried them before, I almost always have some idea of what is going on, and can pick up from there, if I don't understand something, and that is ofc a huge benefit.

    But if I were you, I would split up your game, and not even try to make an interesting game. But just spend some time trying different things. Here are some ideas.

    For instant, drop the battleship part for now, and just try to make a game where the player have to solve/answer 10 equations maybe within a time limit, and then make a score that add 1 point each time its correct, or based on how much time is left.

    And then don't worry to much if the game is not all that funny or not, but simply use it as a way to learn how timers works, adding numbers, how to present things to a player, how to get interaction from a player, and test if its correct etc.

    Then when you are satisfy with that, make a game where the player have to control a square through a maze, and if they hit the wall the loose a life and have to start over again or something. And just focus on player controls and collision.

    And then you continue with for instant mouse control. Maybe some dropping boxes at different speed and sizes that the player have to click on. And maybe use something that you used in your former projects.

    The basic idea is you know that you are making something that might not be very exciting at first....but each time you do something like this, you will slowly start to see that its pretty much the same, and you start to spend a lot more time on "How and what you would like to do" and that will suddenly be the hardest part, because then you start to think, well maybe my game is pretty boring... and then you drop them because of that rather than because you don't know how to do it. Also at some point you will start to drop project because you loose track of what is going on. And then you can start looking at functions and after that you will use them as much as possible to not loose track...and just keep trying new things, even if they never end up with anything useful.

    And even though battleship seems simple because it is as a board game, its actually a lot harder to do, than to make a object walk around with path finding in C2 or something.

    Think that's the best advise I can give you.

  • I found very difficult to use "while". I only had used REPEAT and FOR before.

    No worries you don't really need "while" anyway and in most cases its best to use a "for" loop instead anyway. And you can get it to work as a "while" loop as well.

    As you said, the ships are still overlapping others ships. I thought to include the condition "Ship_1_mid is overlapping family" in the group "Ship overlapping checker"? Anyway to use "or" and "and" together in the same conditions block?

    Yeah there shouldn't be any problems in modifying the code so it works for that as well. Its pretty much the same.

    What you can do, which I personally like to do, when I have to work with complicated tasks, is to write in short text what I would like to do, before I even start coding anything.

    For instant in your case it could be like this, you can just write it as comments (Q hotkey).

    1. Spawn mid part of ship at random location.

    2. Choose size of ship.

    3. Give ship a fixed rotation (0,90,180, 270)

    4. Spawn rest of the ship parts.

    5. Check that ship is within game area, and is not overlapping boundary.

    6. Check that ship is not overlapping another ship.

    Whether it should be exactly like that for you I don't know, but it kind of give you some overview/guide of what needs to be done, and you can focus on one task at the time, and make sure that it works before moving to the next.

    Avoid overlapping of ships with the border sprites is simple. However, to avoid overlap of ships of other ships, divided into several parts is very complicated, mainly because I will have to create 05 different types of ships. Perhaps the hardest part of the game.

    Actually I don't think its a lot more complicated, since you can just test:

    ship is overlapping ship

    Ship UID not equal to the UID that you are currently checking

    Then it will check all other ships, except the one you are currently checking for overlaps. It might sound complicated I agree, but if you think about it like this, if we assume that you want to check that a destroyer with a unique name of "King Paul" is not overlapping another ship:

    Check if a ship named "King Paul" is overlapping another ship, but don't check against ships that are called "King Paul".

    Then it doesn't sound that complicated, it actually sounds pretty straight forward. Since the UID of an object in C2 is unique, we can use that, its just a number rather than a name like "King Paul". :)

    If you compare it to the boundary, and we assume that we only want to check the right boundary for whatever reason:

    Check if a ship is overlapping a boundary. But the boundary must be on the right side.

    Its pretty much the same, both have two conditions. If you compare that to the actual boundary check that you use, which only have one condition:

    Check if a ship is overlapping a boundary

    Its not really all that more complicated, you just have to check each ship part, that are "linked" to the ID of the ship. Like if "King Paul" is made up of 3 parts, you have to check all ship parts, that have the name "King Paul" in the Ship_ID variable, and you can do that with a loop, like is:

    Ship_ID = "King Paul" (Will pick all ship part with that name)

    For each Ship

    [Then you do the checks]