Bartosh's Forum Posts

  • kinda a tall order.

    the long answer:

    ---------------------{array alighnment}--------------------------------

    you need to align everything to a grid, something like 64x64

    then set a value 'Tx' (so tile x position) and 'Ty' for your object

    always set those value to

    Tx: round(.x/64)

    Ty: round(.y/64)

    this will give you your x and y position in your array.

    have a similar process for all your objects (maybe just put them all in a family so you only have to do this once?)

    -------------------------- {Moving}------------------------------------

    always,

    for each object:

    • >set position array ('Tx','Ty'+1<-(or whatever),2)too object .uid

    then when an object want to move in a given direction

    check that spaces Z2 position, if that position is equal to 0, go ahead and move.

    but if its not

    • >add parameter: value at array position (the tile being checked,z2)
    • >add parameter: oject value'Tx'
    • >add parameter: object value'Ty'
    • >call a function "swap" forgetting objects(this is just to make sure the program forgets the current object)
    • > move to space ( it will be clear, because the funtcion will have taken care of that.)

    on function "swap"

    object uid = 'paramiter 1'

            -> move to( parameter 2, parameter 3)

    ------------------------------{checking}--------------------------------

    as far as checking the fastest method(in terms of cpu speed) is manually so:

    is position at array(Tx+1, ty,2)

    however this can be time consuming to write, and a little messy to read.

    so the other method is to check using Modulo [ the symbol %](for and extended explanation go to Tulamide's little corner)

    but for or purposes it will be calling a loop 4 time's and checking the value of:

    .Tx + ((loop-2)%2)

    so -1,0,1,0

    .Ty + ((loop-1)%2)

    so 0,-1,0,1

    -----------------------------

    so in you script it would look like

    on loop "check"

    array position((.Tx + ((loop-2)%2),(.Ty + ((loop-1)%2),2)=0

          than do the stuff we talked about.

    --------------------(Replacing only if it has too)--------------------

    so i take it you want the object to only replace something if thats the only thing it can do?

    this would be a mater of how you organize you events.

    when the objects ready to move, set another value in it like 'moveme'

    to 1

    for each object     

    value 'moveme' = 1:

       - call loop "blank search"

    on loop "black search"

    - preform the search mention above and if something matches what its checking.

       -> move the object

       -> set object 'moveme' to 0

    than another event after the first (beacuse its after the first, it will only happen if the value move is still equal to 0)

    for each object     

    value 'moveme' = 1:

       - call loop "swap search"

    on loop "swap search"

    - preform the search mention above and if something matches what its checking.

       -> do the paramiter switching function thing

       -> move the object

       -> set object 'moveme' to 0

         

    _______________________________________________________________________       

    for some more advance moving and checking in arrays

    Array A*

    you can ignore the actual A* part, and just look at how it checks,

    ______________________________________________________________________

    I just did this of the top of my head, it should work, but i would need to see your specific case to know for sure.

    --------------------------------------------------------

    so the short answer too your question :

    "Is there a simple way to check to see if any spaces around an object are empty and move to that space; and if they aren't have the two objects swap positions. "

    ...no..

    (unless somebody made a plugin)

  • odd, dose every thing go excessively fast if you turn off frame limit?

    maybe , in the physics behavior, change the simulation steps too 1?

  • Hellcube@

    the page was loading slow, so i only saw the top of the image, and i was like" what the....? how is that even possible?"

    then the rest loaded, and i couldn't stop laughing.

    no offence

    it sounds like it will be cool, like area 51 or something.

    and i think NS2 is awesome. so i see were you coming from

    i'd like to see a video.

    i think it would do more justice to you project.

    but still. that was funny.

  • custom physics yes,

    but i thought the physics object was automatically adjusted for deltatime.

  • ok failure to communicate, my bad.

    the events with the new global values shouldn't be sub events, just regular events.

    and your clear events was happening after you load from array, so it was immediately being filled with 0.

    but to make this point again, the array function ,clear to, does nothing, if your just going to load onto that array. for you project, it would only be useful for a "new document" purpose.

    were you actually want the screen cleared.

    dropbox.com/s/g768rt3nd03pf1h/fixedarraysave.cap

    here's the fixed .cap, every thing should work fine as far as saving and loading arrays.

    but if it doesn't, let me know.

  • Helladen

    Nah, I Know, I was just being a smart-ass.

    (for the moderators, i mean a donkey, not a butt)

    ---------------------------------

    facecjf

    An inspired uplifting post/perspective.

    ---------------------------

    DrJones

    that's a very good plan, anybody telling you otherwise is wrong/ just wants your allegiance ( or money )

    just don't become too reliant on CC.

    as far a pixel perfect collisions in C2, you could map every pixel to a spot in an container array, and check the overlap of each spot. it'd be a nightmare to initially make, but i bet it would work.

    (At least it would in CC, I've made a custom build 32 bit ship sprites using a similar process before.)

    (Arrays are awesome.)

  • that's why there coding the next gears of war in HTML5

  • whoops ...I forgot to tell you last time

    the two points in the name is happening because in the first event,select file extention thing, you have ".cwm" as the extention, change that to just "cwm", it automatically adds the dot.

    but you don't even need an extension for array files, it just helps with sorting.

    I'm at work right now, I'll have another go at your .cap this evening.

  • Is this a tile map?

    if so

    are your tiles mapped to an array?

    if not, i recommend you do that. The most advance tasks you can preform in construct use arrays ( or super structures, if you get the plugin).

    and its almost critical to working with tile-maps.

    ------------------------------------------------------------------

    if not,

    assign the tiles in a group a variable, like ('number')

    give all the tiles in a group the same value 'number'.

    then on a event

    using the function object

    "Chgmt" is overlapping "Tile" at offset 10(or whatever):

        ----> add parameter tile.value('number')

            call function("pick") forgetting objects

    on function "pick":

        - for each tile

        - tile 'number'= parameter 1 :

                          ---> change color.

  • "I uploaded the wrong cap file D:"

    ha nice :)

    -----------------------------------------------------------------------

    if your going the rout of manual picking, the key is for each loops,if you hit a road block,just keep playing around with those.

    and when your trying to find a object with the uid as a value, make sure you use:

    ( the object with the value of the UID)= picker

    ( the object that the UID belongs to)= object

    for each picker:

          -object UID = picker value ,UID'

    if you do it the other way:

    For each object

         -picker value 'UID' = object UID

    It won't work unless you also For each the pickers

    and that's 2X as slow to process.

    ---------------------------------------------------------------------

    Some other methods that are useful. In particular for picking the same kind of object as the one doing the picking:

    _______________

    Using functions:

    add the .x and .y of an object as a parameter

    call a function forgetting objects

    on function:

    set other objects value 'target x' and 'target y' to parameter .x and .y

    ______________

    Using arrays:

    set each object value 'AX' and 'AY' to a unique position in an array.

    and do all your comparisons based of the array positions, not the objects themselves.

    ---------------------------------------------------------------------       

    like i said, these are only really necessary for picking the same object. i know that's not what your doing right now, but it think everybody at some point gets headaches over this problem.

  • HTML5 may very well be the future. I bet in the future it will run crazy fast. And in the future some of the simple things that can be so complicated now, wont be so complicated.

    So in the future, I'll use HTMl5.

    when your things work in spite of the system, instead of because of the system, maybe its better to have a better system.

    ....apparently I'm feeling poetic today.

  • when objects are in a container they don't need to be spawned, just spawning the 1 object that the other is linked too will create the seconded object.

    further more, since the objects are in a container, construct already assumes you want that object whenever the first object is in the event.

    so to fix:

    you only need 1 event,

    #3: always set sprite 5 x.y. to player x.y.

    that's it...

    delete the rest. (except 1 & 2 )

    and don't worry about creating a sprite 5 for each player in the editor, it automatically dose that for you.

  • VonBednar

    I think CC is a wonderful tool for most things,and can teach you a lot, trust me,before construct, i didn't even know what an array was.

    My point of the "sinking ship, without it's captain" warning, is that nobody is doing any work on the project. and it desperately needs some.

    so if your using it, be aware that there may be some holes you cant fix, and nobody's coming along to help.

    If your fine with that, that's great. but go into it with both eyes open.

    ------------------------------------------------------------------

    I actually kinda got a team with my brother, he always said he would help me make games if i ever stopped using game-makers.

    And I imagine most indie developers build an engine using scattered pieces of other engines. its just a process with more control on the foundation, witch is what i need to achieve what i want.

    (for my specific case, its how it handles checking all sprites, even if they do nothing, this is a huge problem for rendering tile maps, and is such a key part to how construct works, i doubt its a simple plugin to fix.)

    Hell, maybe i'll learn python, come back, and patch up the holes in construct that are crippling my games.or jump on the resurrection project.

    like i said, i love the thing. so who knows.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "or whatever to fits what I need." I guess is the catch.

    I'm doing so much now in 3d its stupid, im creating normal maps using distorted sprites to make lighting maps and 3d physics. at some point, i should probably just use unity3d. witch uses javascript among other languages.

    but I've been told several times, code language is simple, its every thing else that's hard.

    and right now I'm doing almost everything using arrays, loops, and convoluted functions.

    my collisions,objects,variables, path-finding, height maps, are all in arrays.

    and that's awesome that i can do that with CC. and something i just dont think C2 will be able to handle for quite some time.

    But It's terribly inefficient, and a lot harder than it needs to be.

    I'm basically building an engine inside an engine... and that's kinda dumb...

    ..or not.. I really don't know, kinda what i'm hoping to find out on my programming pilgrimage.

    --------------------------------------------------------------------

    actually, ill just send you a PM with one of my current projects to give you an idea.

    --------------------------------------------------------------------

    QuaziGNRLnose

    Ashley : "The way things are going, eventually these forums will fall silent and we'll probably see fit to discontinue Classic completely. We're not doing that now, because it's virtually zero work to leave these forums running and people still use them. But I think it's inevitable."

    maybe the boats not sinking, but the captain jumped ship a long time ago.

  • Master game idea is:

    Escape Velocity/ NAEV stile Meta world game

    but set on "floating islands" with plains, and airships

    witch you fly with a z. axes along with an x. and y.

    inside each ship is crewed by an 16 bit pixle art crew, moving around custom made rooms, living and working, like the Sims crossed with FTL.

    on the island you can land,and walk around, or build a base of operations. witch this crew could move between,pathfind in both the ships array, and the worlds array. then you can dive down into the under city to scavange for artifacts.

    and its all done with just the mouse.

    i made a post over on the general forum Pic thread with some of my concept art about it.

    I know that sounds lofty, it is. but I have a lot of experience making and failing to make games. so i have a good understanding of what is/ is not possible.

    and i seriously think i can make this.

    it just requires an absurd amount of planing and effort.

    I've had it in the back of my mind for a long time, and almost all my games have worked one way or another towards this idea.

    ------------------------------------------------------------------

    Experience wise 10 years (5 with MMF, 5 with CC) I'm 25.

    I've always considered myself an artist, not a programmer. but if i wanted to see my game ideas become reality, i needed to make them myself.

    But because of that fear of not being able to program. i always used game making programs. however, over the course of using construct I've gained a lot of confidence in my ability's. and I'm not afraid anymore, I know whatever difficulty I encounter, I'll overcome it.

    my plan is to go with javascript. the idea being if its just not what I want, I can come back to C2 or something, but with an ability to code the back-end with plugins or whatever to fits what I need.

    I have an older brother that i work with on web design who has a masters in computer science who just gives me hell for wasting my time with Gamemakers.

    I always have argued against him, saying I can get to were I want too go with these programs. I still kinda believe that.

    I know the traditional rout can be hard. and in the end maybe too time consuming to effectively make games from scratch.

    but I need to see for myself.