Waltan's Forum Posts

  • Hi i have problem, player has got 8 direction behavior and i need to make box. Player can push this box left, right, up, down , pls tell me how to

    Thx for reply.

    I have made here 2 ways.

    In first one you need to remove solid from sprite2

    In second you need to add it back :D

    You can toggle event by right-click on it and click "Toggle event".

    Good luck)

  • An index is a number used to enumerate things. By nature this has to be a progressive integer.

    An array also uses integers.

    Something like '3,1' is not a number to Construct, so it interprets it as a string.

    For you to not lose overview, use the array 'database' as a simple 1-dimensional array to store the names of the objects:

    stick stone apple colorblock1 colorblock2 stoneblock

    Now you may reference the object by its index (stick = 1, stone =2, ..., stoneblock = 6)

    When filling the inventory, put in this index, e.g. if the second slot of the inventory should contain an apple, then inventory(2) = 3

    To look up the name, you use database(inventory(2)), which resolves into database(3), which is "apple", because the third item of database is "apple"

    Sorry, but i'm don't understand this:

    hen filling the inventory, put in this index, e.g. if the second slot of the inventory should contain an apple, then inventory(2) = 3

    To look up the name, you use database(inventory(2)), which resolves into database(3), which is "apple", because the third item of database is "apple"

    Can you show me? :3

  • The next time I start everything is loaded correctly as it was when exiting. ...

    ___________________

    Diablo 3 Items

    try to do it with colorblock1 colorblock2 and stoneblock ._.

  • Hi guys, my name is Vlad and i'm from Russia :3

    I like pixel art style games and indie games because it's full of soul, lol :D

    Im spending too much time working in Construct Classic on my game to win dev. competition.

    One thing which i hate in CC it's bugs, there is a lot of them :c

    That's all, thanks.

  • Here you are:

    http://www.mediafire.com/file/3rb8r4xz1gzdkd5/database_array_simplified.cap

    It was just a matter of indirect referencing, if you look at the events you will instantly see what I mean. But feel free to ask, if it is not obvious.

    I found some kind of bug. When system using id from array it uses id thats compare of array index (id = 3 array = 3,1)

    I added 3 objects that is not compare array's indexes and 1 which is compare. First 3 doesn't work and last one works fine.

    screen of array

    cap file

  • Here you are:

    http://www.mediafire.com/file/3rb8r4xz1gzdkd5/database_array_simplified.cap

    It was just a matter of indirect referencing, if you look at the events you will instantly see what I mean. But feel free to ask, if it is not obvious.

    Thank you very much!

  • Please excuse me, but I still don't understand.

    Do you want the inventory to be saved everytime when it is changed, instead of just on exiting?

    Sorry for my bad english.

    So ok, there are 2 ways to create necessary object.

    First one:

    <img src="http://s1.ipicture.ru/uploads/20111102/zA72Xk5J.png" border="0">

    It's inconvenient way, because you need to add every id by yourself every time when you wanna add new object in game.

    Second one:

    <img src="http://s1.ipicture.ru/uploads/20111102/yzsWVOiT.png" border="0">

    This way using database array to detect necessary object and it's even more easier then first

    On startup event, i have first way to create objects (where i need to type every id) but i want make it like in second one but I can't do it.

    I hope now you understand :<

  • > This is pretty fine system but i can't make it works to load objects on start up. (?21 and ?25 events in example).

    I'm not sure what you mean. It works for me, loads the items from the array and shows them at the correct places. I can place items in the inventory, I can move them around and they get saved when exiting the application. The next time I start everything is loaded correctly as it was when exiting.

    I want these events to replace on these but i when i'm trying to do it, it doesnt works.

  • this

  • So, i found a way to make system use some king of database and it's hopefully works except one thing.

    (You need to download this file :3)

    You have 3 arrays.

    1. Inventory

    2. In-game objects

    3. Database

    The database represents the tablet with object "id" and name.

    What i'm using in my example:

         x1    x2    x3

    y1   ?1     2     3

    y2 stick stone apple

    and when you drop item, system compare item's id and id in array and using name under this id to create object.

    This is pretty fine system but i can't make it works to load objects on start up. (?21 and ?25 events in example).

    And i again hoping on your help guys :P

  • So yeah i did it. I made an array where are stored all the id and object names. And when you drop item or pick block system using this array to create the desired object.

    image 1

    image 2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you had made all your inventory objects the same object, but with different animation frames, you could have done:

    On click on blocks,

        create INV_OBJECT

        set anim frame to block('id')

    and the same with your drop function. Since you made them all different objects though, Now you can rename them to inv1 inv2 inv3 etc. and use create object by name;

    On click on blocks,

        create by name "inv"&block('id')

        

    I also have array wich using id var to create blocks on load, so i think there will be problem with your way.

  • In my project i have 2 types of objects.

    1 is blocks

    2 is inventory items

    each of them have "id" var.

    block "wood" (id 2) item "inv_wood (id 2)" and etc.

    And to tie them I had to make "big" event with all of their "id's"

    image 1

    image 2

    Is there a way to make sure that the system itself staring id of both objects and select the desired

    For example:

    On "Items" Drop ->

    ?"Items" [id] = "Blocks" [id] -> Create object "Blocks" at x y

    I hope you understand me :3

  • You could use:

    + MouseKeyboard: On Left Clicked on Sprite

    -> Sprite: Set 'drag' to 2

    + Sprite: Value 'drag' Equal to 2

    + MouseKeyboard: Left mouse button is down

    -> Sprite: Set position to MouseX, MouseY

    + MouseKeyboard: On Left mouse button released

    -> Sprite: Set 'drag' to 1

    sample cap

    <img src="smileys/smiley1.gif" border="0" align="middle">

    You are my hero :3

  • What exactly doesn't work for you?

    For example inventory.

    dl.dropbox.com/u/34384736/drag%26drop.cap

    Put red sprites on the black. Then press 1 (to turn off drag'n'drop). After this try to drag some red sprites again and then press 2 (to turn drag'n'drop on) and you will see what i'm talkin' about.

    What exactly doesn't work for you? And if so why don't YOU make it and share with the community?

    I'm too tired today, lol :c