nimos100's Recent Forum Activity

  • Im a bit confused, so in my event which is triggered by a right click, that create an object and depending on the object that is created, it have to do certain things with it. So for it to work I would have to add an "on create event" and based on a variable or something that could track what is suppose to happen with it, do it in the "on create" event?

    And those sub events in my old event,that depend on the state of the object, I would have to move to separate events/functions?

  • Sounds a lot like the problem I have as well. Wrote a post earlier - Post

    I have problems picking them as well. :(

    However my problem is in a mouse right click event, but tried the function thing as you are doing as well and that didn't work either.

  • First of all, I think its a really hard task you have in front of you, and thank god its not me <img src="smileys/smiley36.gif" border="0" align="middle" />

    I haven't actually made any platform games, so not that much into that part and what problems are typical for them. But maybe I can give you some ideas to try, as all the games im working on, uses random generated maps. However this seems a lot more complicated, as I don't think I have the same limits as in a platform game.

    Anyway ill just use a game as Mario as reference, since that's what you mentioned, so if your game is not like that, you can just ignore those parts.

    To generate the map:

    You need to take into account that the character can only jump so high, so you need to make sure that all objects that are part of the map are reachable. As it wouldn't make sense to place an object in the top, if there are no way for the player to reach it, or to place an object just out of jump range.

    So what you could do, is to divide the whole map into a "hidden" grid of lets say 128x128 px tiles, lets say its a 10x10 map. Each grid tile could hold some sort of map object.

    Now you need to fill the grid with map object, and think it would make sense to start from the bottom up.

    Since the player shouldn't be able to fall off screen, you know that all the tiles in the bottom needs to solid. So you can add solid map objects to all of them.

    Then you could go through row 2, and just make a random roll to see if there should be an map object in a given tile or not.

    If you want to go higher, I think I you would have to make a tester of some sort, that would pick a tile and the surrounding 8 tiles. To see whether one is present or not in a given tile. To explain it a bit easier:

    Lets assume that:

    O = empty grid tile.

    X = Map object.

    T = Location of the tester

    Tester looks like this, with the number to represent the tiles needed to be tested:

    7 8 9

    4 T 6

    1 2 3

    So if you want to test the tile marked with the T, to see whether you should/could add a map object here. It would look like this:

    OOO

    OTO

    OXO

    XXX

    The tester will check the 8 tiles surrounding it, to see whether it can add an map object or not to its current position. Since the player can only jump 1 grid tile (128px). So testing the grid tile at position 1, should return "bad position" or something, as it doesn't have a map object, so placing a map object at T current position would make it look like this:

    OOO

    OXO

    OXO

    XXX

    And impossible for the player to jump there.

    Then you would go through each row of the grid and test each tile like that.

    Spawning random monsters

    Assuming that you made a tester as above you could use it to spawn random monsters as well. Either by marking tiles as "containing" a monster, and based on whatever conditions you want, make it so it can not spawn 2 monster on two tiles that are next to each other.

    Anyway, think you could make it like that. But it would probably need a lot of extra work, as the maps might tend to be rather boring, the you could ofc add tiles that trigger something when the player is on them, but that will make it even more complicated....but think it will be very hard to make regardless. As I can only guess the amount of bugs it could create :D

    But anyway maybe you can use it for something, if not its fine as well :D

  • Sorry I don't know, I haven't actually looked at that effect at all. I just know a little about it from doing 3D. And even there I haven't used it a lot. And whether you need an actual normal map in C2 or whether you can just fake it with a grey scale bump map and still get that effect I have no clue. But will try it at some point because it looks cool :)

    However think this is a very good page that you can go through to learn more about normal maps, lighting etc. And see if you can apply it to C2. I haven't looked through it all, but first impression is that its really good, and will probably give you a good starting point, to understand and creating your own normal maps, so they work in C2.

    Normal mapping and lighting

  • Im not sure how he did it, but might have been done, but adding a normal map to the floor. So my guess is he used/might have used a program to generate the normal map and then use the bumpmapping effect in C2. I cant see if the normal map is "accurate" or not. So that's why I said he might have used a program to calculate a correct normal map, or maybe just a "fake" one.

    However it works like that.

    "To calculate the Lambertian (diffuse) lighting of a surface, the unit vector from the shading point to the light source is dotted with the unit vector normal to that surface, and the result is the intensity of the light on that surface. Imagine a polygonal model of a sphere - you can only approximate the shape of the surface. By using a 3-channel bitmap textured across the model, more detailed normal vector information can be encoded. Each channel in the bitmap corresponds to a spatial dimension (X, Y and Z). These spatial dimensions are relative to a constant coordinate system for object-space normal maps, or to a smoothly varying coordinate system (based on the derivatives of position with respect to texture coordinates) in the case of tangent-space normal maps. This adds much more detail to the surface of a model, especially in conjunction with advanced lighting techniques."

  • Another way if its not a lot of numbers just store it in a local variable.

    Then add:

    Roll = 3

    Roll = 5

    While()

    And in the Action add Roll = round(random(59))

    Then if its roll 3 or 5, it will roll again. and continue if it doesn't.

  • Hi

    I have a function that can generate objects when passed a parameter for instance "Stone" and it will then create a stone at the player position, and set a global variable "Last_generated_item" to its UID.

    However If I in the next sub event do "pick item with UID = last_generated_item" it doesn't select it. I am aware of the newly picking thing problem. However if I use "wait 0" it still doesn't work.

    I have also tried adding a "system object with UID exist" in the next sub event and print out the UID of the "last_generated_item" to a text object and it works fine. So I guess the object must be there to be selected as I can get the UID of it.

    However if I move the text object to the event with the "pick item with UID last_generate_item" it doesn't react to it.

    Now the weird part is I do the exact same thing else where in my game, and it have no problem selecting the "last_generated_item" even without a "wait 0". So why it doesn't work here is really weird.

    I have also tried to return the UID of the object created in the function and use the "returnvalue" instead and it give same results as using the global variable.

    The only difference that I can see, is that the first ones were made in another version of C2 and this is made in latest beta version. However cant see why that should make a different.

    But anyone have any idea why it doesn't work? And if im doing it wrong, how would you correctly select an object that was made in a function?

  • Unless im missing something, i dont think its the same feature, as that one saves/load the full state of your program.

    This one would save the state of an layout, so when you load it, it wouldn't change anything else. So you for instant could go back to an old layout. However the current feature could almost do it, if only you could turn on/off the "no save" behavior on demand.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are there any ETA on this feature?

  • There is a build in loader style, that you can set to Procent under the project tab.

    Otherwise you might be able to make a sprite animation looking like a loading bar. And use the loadingprogress functionality under system to control it.

    However i havent tried it myself yet, so exactly how to set it up and make it work i dont know.

  • Anyone knows where save games are stored on your computer, when you use the save game feature?

    Also how do you delete save games from within a game?

  • Think it would be nice with an edge tracker, or outline effect. so if you add it to a sprite it will based on your settings add an outline around the graphic in a sprite. Which would be very useful for when a player select items in game etc. Or for mouse over effects to give players feedback of interactive stuff in a game.

    Maybe the settings could just include a pixel size of how large the outline is. And maybe a color setting.

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