tulamide's Forum Posts

  • I don't have Win7 but I think I've read somewhere that you need to install DX9 seperately, if you installed DX11. But I'm really not sure.

  • This is also known as flood fill, and here are two links. First is just the wiki, the second explains it very detailed.

    http://en.wikipedia.org/wiki/Flood_fill

    http://losingfight.com/blog/2007/08/28/how-to-implement-a-magic-wand-tool/

    Good luck

  • The AVI object never had any priority. That's why it is not very usable for presenting videos as cutscenes, for example. But I remember there are some threads in the forums that present alternatives using Python. You should consider to follow that path to have more influence on the presentation of the video.

  • My two cents:

    Whatever will come in future, be careful with drastic changes to the licensing.

    The biggest influence on the interest in C1 was (and is) that it is free. You want to make sure, there is money to pay the rent - but there is no guarantees. I'm not sure I can explain my thoughts well enough in english, but I will try. You can either think of a number of people, that you hope will pay for something, then decide, how much money you want to make out of this number and hope for the best. But most of the time, you can not rely on any number of possible clients...

    From the customer side, I'm not a big fan of any kind of yearly subscriptions. A model that forces me to buy a time-limited license if I expect to make some money with a game, complicates things. I'm not a professional company, I'm just one person. The project may be done after two years, but it could also need three or four years to complete - I would then need to buy another license without having the results I expected when buying the first one. Wasted money.

  • the weather of tomorrow ... and where I left my keys ...

    (I'm sorry, couldn't resist )

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Please stop pushing your own thread every few minutes!

    And stop creating several threads to the same problem, just because there wasn't an answer to your likings in the first one!

    This is from your other thread:

    "Im messing with it 2 hours without result ."

    So you stopped working on this issue after 2 hours and since then just waited to get your problem solved by others? Lucid already gave you some hints, btw.

    Provide your cap, that could motivate people to help, because I don't think anyone has the time to setup a complete mixed physics/platform engine for you...

  • Can't reproduce that. Works as expected for me. Maybe something else is interfering in your cap (maybe using escape also for another action, something like that)?

  • It's just an initial space allocated for effects. Add a few other effects and you will see, that just with the first one the VRAM usage raises that much, the others only take a few kb.

  • No, it isn't. It's just that the zooming takes place centered, and (at least I) didn't take that into account.

    + MouseKeyboard: Mouse is over Box
    -> Cursor_MapEditor2: Set position to int((116 - ((ScrollXRight - MouseX) * (ZoomX / 100))) / 8) * 8 + Box.Left, int((480 - ((ScrollYBottom - MouseY) * (ZoomY / 100))) / 8) * 8 + Box.Top[/code:37rfkk1v]
    
    This works. The visible width of the box is 116, although the total width is 120. If you change the position or size of the box, you need to adjust this value, too. And of course the same has to be done to the (visible) height value 480.
    
    EDIT: It works on the original cap you posted (Just wanted to make sure about it  )
  • I haven't tested it, but from my head:

    If zooming in to 200%, the area (virtually) represents double the size. Theoretically

    Cursor.x = int(MouseX * (Zoom/100)/8) * 8

    should work.

  • I wasn't sure if you were looking for "Start of layout" or if there are issues with "on load". That's why my answer was cautious

    Yes, you're right, "Start of layout" is what you are looking for. Using it makes sure all expressions and subevents will be executed at the very first tick of the layout.

    ...And welcome to the forums

  • I need it to get the initial state of the game going.

    On load does not trigger at game start, but after having loaded a save file. If that is what you want, you should be able to use it by doing a Load from disk (or Quickload) followed by on load.

  • Thank you for the comments, really appreciate it

    Unfortunately, I uploaded the wrong version, which was calculating the positions wrong in the array example. I updated the link, to the (hopefully) correct version. I'm terribly sorry

  • Use the function object for repetetive events/actions.

    For example, instead of your globals you could setup a function

    + On function "AttackConditions"
    ++ Player.Value('Reserve') greater than 0
       global('Distance') less than 2
    -> Set return value to "True"
    ++ Else
    -> Set return value to "False"
    [/code:1cy20mdp]
    Call that function on key press:
    
    [code:1cy20mdp]+ key A pressed
    ++ Function.AttackConditions equal to "True"
    -> set player animation to "Attack"
    -> substract 1 from Player.Value('Reserve')[/code:1cy20mdp]
    
    The advantage is that you only check the function in your main events. You can group your functions or place them in their own event sheet, and, more important, you can easily change a function or add other code to it etc., without touching the main events.
    
    This makes it easily maintainable. (and btw saves you a lot of globals  )
  • Here we go again. This time I have made a rather simple example cap, showing one scope of application for both, arrays and hash tables, and setting them side by side, to compare them and see, where they are of advantage.

    NEW VERSION (19.02.2011):

    Array_Hash.cap

    You may want to first download the cap and then switch back and forth between Construct and this post.

    I. Array

    I.1 Demands

    The base for the example is a map editor. Imagine you want to create one for your game. It is tile-based, so you know the exact dimensions of the map and you know the tile dimensions. In this example the map has 256x256px, and the tiles have 64x64px. That's a map size of 4x4 in tiles.

    You might want to have a little variation for the tiles as well. In this example, every tile has 4 animation frames, which can be freely selected.

    Now we need to manage and save the informations. The easiest way is to save the frame number of a tile to its position expressed in tiles. That does give the advantage that we could later change the size of the tiles without affecting the map layout. This is a perfect job for an array.

    I.2 Effect

    Run the cap now and click on 'Array'. You will see a red-colored area. Use the mouse wheel to change the animation frame of the tiles. When satisfied, click on 'menu' and then on 'Save array'. Click 'menu' again and select 'Main menu' this time. Click 'Array' again. You will notice that your map is automatically loaded. Change some frames and select 'Load array'. It is reverted to its last saved state.

    I.3 Cause

    Have a look at the event sheet of the layout 'Array'. Open the group 'Array'.

    Event 21 and its subevents are initializing the array. First it is set to 4 in x-dimension and 4 in y-dimension. Then every "cell" of the array (16 in total) is set to the value 1. This is needed, because the first animation frame is 1, but the array is initialized to 0. The next event loads a saved array file, if there is one. This is just a convenience. The last subevent loops through the map and creates the 4x4 tiles.

    Event 26 and its subevents changes the frames of the tiles and updates the array with the new frame numbers.

    Open the group 'Menu'. Events 16 and 19 take care of loading and saving the array. When loading, it is needed to loop through all tiles and set the frame number to the one stored in the array.

    For all accessing of array "cells", some simple math is used to get the tile position. The map starts at (0, 32), a tile has a size of 64x64 and its hotspot is centered. Therefore the tile at array value {1, 1} is located at (32, 64) in pixel values. With (mapobject.X - 32) / 64 + 1 we get (0) / 64 + 1 = 1, and with (mapobject.Y - 64) / 64 + 1 its 1 again, as expected. The tile at array value {3, 4} is located at (160, 256). Just try the math above with that pixel values, you will get the correct tile position. You just need to substract all offsets from the origin, then divide by the tile's size and add 1, to shift the range from [0, 3] to [1, 4].

    II. Hash Table

    II.1 Demands

    Again the base for this example is a map editor. But in difference to the first example it now is object-based. A map object can be placed anywhere on the map, not just on a grid, and it can be deleted or moved. The map size still is 256x256px, and the map objects have a size of 64x64px. And all objects also have the same variations as in the first example.

    To manage and save the informations, we need something to store the coordinates of an object and its animation frame, and those informations may change at any time, or the object may even be deleted. Using an array as we did in the first example is not very effective. First, we would need to make it have 256x256 cells, even if we only place one object in the map. Second, everytime an object is moved we sould need to clear one cell and set another. Third, if two objects are placed at the same coordinates we couldn't store the informations for the second one, the cell is already used for the first one.

    It is much better to have an object-oriented approach. This is a good (but not perfect) job for a hash table.

    II.2 Effect

    Run the cap now and click on 'Hash Table'. You will see the empty map area and some text in the upper left. This text will keep you informed over your objects. Left-click anywhere on the map to create an object. Hold the shift-key and click and hold the left mouse button over an object to change its position. Right-click over an object to delete it. Use the mouse wheel when over an object to change its animation frame. When satisfied, click on 'menu' and then on 'Save hash table'. Click on 'menu' again and select 'Main menu'. Click 'Hash Table' again. Click on 'menu' and select 'Load hash table'. Your last saved map is restored.

    II.3 Cause

    Have a look at the event sheet of the layout 'Hash Table'. Open the group 'Hash Table'.

    Event 23 initializes the hash table by inserting the key 'pid' with the value 0. Event 32 creates a new map object, sets the object's pid to the value of the hash table's 'pid', raises the hash table's 'pid' by 1 and inserts a new key into the hash table. This key represents the new object and it has the following structure:

    key = object's pid, value = a string in the form objectXxobjectY;animationframe (e.g. "128x64;3")

    Event 28 moves an object to a new position. The value of the key that corresponds to the object's pid is set to the new position, by just creating a string from the coordinates and the frame number again.

    Event 29 deletes an object and the key that corresponds to the object's pid.

    Events 30 and 31 change the animation frame of an object and sets the value of the corresponding key to a string created from the coordinates and the frame number again.

    Open the group 'Menu'. Event 16 and its subevents take care of loading and creating the map from a file. If there is no file, the content of the hash table keeps its current state, else it is replaced by the data from the file. Either way, all objects on the map are deleted. We then loop through every key that is not named "pid" and create an object based on the string value of the key. The coordinates and the frame number are retrieved using GetToken, which returns a substring of a string by interpreting a given letter as a delimiter. For the coordinates the delimiter is "x" and for the frame number the delimiter is ";". See the comment in event 20 for more information.

    I'm working on other examples for hash table use, so check this thread from time to time.