Guif0DA's Forum Posts

  • > Any1 have any idea how to add 1 value to a variable for each object ordered by X(or anything else but each one must have 1 more value then the last one object)?

    > But after they had their value added them it would stop..

    > Then they would be organized with X.point by variable*100

    > but if one of the objects would be deleted then instead of a 'hole' on the middle, they would be self-organized again.. Not sure if what I'm trying to do is clear in this post..

    >

    > I'm having trouble right now trying to re-organize the objects after one is deleted.. any ideas?

    >

    For each object ordered by x - set variable to loopindex

    Not sure if i'm doing the right way.. this is the condition:

    For each sprite ordered by Sprite.X ascending: Set Sprite.value to loopindex(loop name)

    what is the name that I have to add?

    edit: Just used loopindex without a loop name and worked, thanks newt

  • Any1 have any idea how to add 1 value to a variable for each object ordered by X(or anything else but each one must have 1 more value then the last one object)?

    But after they had their value added them it would stop..

    Then they would be organized with X.point by variable*100

    but if one of the objects would be deleted then instead of a 'hole' on the middle, they would be self-organized again.. Not sure if what I'm trying to do is clear in this post..

    I'm having trouble right now trying to re-organize the objects after one is deleted.. any ideas?

  • taking advantage of the topic.. Do u know a way that I could add a object 100 X points after another object of the same instance?

    The layout have 20 objects of the same instance and they all are at the same X and Y, and the game would organize them every 100 x.points? after all of the objects were organized them it would stop?

    I'm trying so many ways to try that but having some dificulties... I already made that by creating the object and get the last one and add more 100 x.points to it but I have to organize them AFTER they were created to work what I'm planning after..

  • > Hey... Do you know a way to get the number of objects with opacity = 100??

    > I'm trying

    > condition:

    > pick 'object' with opacity=100

    > action:

    > text: set text to object.Count

    >

    > but it's getting objects with different opacities too..

    >

    object.Count always gives the total number of instances.

    Use CountMatching(object.OID) to get the number of picked objects.

    Thanks! Never took a look at that condition in the system..

  • Hey... Do you know a way to get the number of objects with opacity = 100??

    I'm trying

    condition:

    pick 'object' with opacity=100

    action:

    text: set text to object.Count

    but it's getting objects with different opacities too..

  • You can give multiple behaviours, and then deactivate or activate them depending on which animation frame they display.

    Ya I though that after.. well.. I think ill give it a try

  • Yea the animation thing i was trying yesterday and I think I found a yet better way.. just add X frame animations, where X is the number of images you want.. so just make sure the animation doesn't run and select what frame u want to show.. from what I tested, this would be the best way.

    but then comes some other problems... each image could have their own behavior and making by this way.. would be something complicate cuz it's all the same sprite... instead of doing sprite per sprite you could define their own behavior for each one but then again... this would take very long time by adding that much sprite..

  • It's possible create a new sprite that wasn't in the game before executing? It's not a new instance of some sprite that already exist but a newly sprite with empty image and everything..

    Another question is how do I use the 'files' resource of Construct? I add files to it but how do I access it?

    Could be possible create a sprite and load the frame from a file resource? Or I would need to use the plugin resource access?

    and finally.. I have a lot of images that I have to add to the game and they could be accessed from the game.. but not sure the best way(less loadings, more fps, etc) to do it..

    first idea was just make a new sprite for every image to a specific layout and then they could be accessed later from another place during the game...but I think so many sprites with complex images already inside the game wouldn't be a good idea.. so the next idea was making just many blank sprites and access each image from a directory of the game when asked.. the problem is... I'm not sure how many blank sprites I would need, the game would always evolve so the ideal was to find some way that with only sprite show diferent images or hability to create new sprites like mentioned at the beginning of the post..

  • I'd suggest a for each object ordered by private variable ascending... send to front.

    If you give each new instance an increasingly higher number(via global pv switch) it will sort to the newest card on top. Descending to do the opposite.

    Then for the specific card do compare variable like pv = what you want, send to front

    Ya I think that would work, ill try it, thanks

  • Hey

    So I'm (trying) doing a system where u have many objects from the same sprite every 15 X it spawn another one.. so at the end it's looks like this:

    <img src="http://2.bp.blogspot.com/_ciy4Wim5AoE/S-NZZj2SB4I/AAAAAAAAABs/xxiZ4Bqf_1o/s1600/Clipart_Casino_card_hand_hearts_266.jpg">

    now there is the problem.. I'm trying to make when you have the mouse over a object, it comes to front from the other ones and when not over the object, back to his previous order but I have no idea how to make it back to the exact previous order.. Tryed also make the object go to another layer when the mouse is over him and when not, go back to the previous layer, but when it comes back, they changes his order in relation to others.

    Any advice or tips?

  • That's really great and now that u said about executemany I remember I already readed about it.. but at least now I know how to use ;D

    so.. as always, thanks Scidave!

  • Hi

    It's possible to add a global effect that affects every layer/layout in the game??

    If not..that would be a nice option in a future update..

  • Hey ;D

    this time it's more about a curiosity than a question..

    how do I make many Insertions on the database at the same time?

    Right now the method I'm using is this:

    sql1="INSERT"
    cursor.execute(sql1)
    sql2="INSERT"
    cursor.execute(sql2)
    sql...="INSERT"
    cursor.execute(sql...)[/code:1d3cl0fd]
    
    Can I insert everything I want at the sime time, without the need to use execute many times in one code?
  • Yea I have thinked about that but I can't use it cuz some objects from the same family won't be moving around if they are in a specific place..

    also... for what I'm planning, can't move by X axis.. need to move with scroll..

    I'm trying with the scroll X and making some layouts with scroll ratio 0% so they don't move..but that's not a good method anyway... a layer object would be very helpful I think..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi

    I'm trying to make just 1 layer to move X positions.. In MMF this would be very simple with the layer object... but in construct I think this need to be made with the system object, right?

    What action do that?

    the layout have 3 layers and only 1 need to move... but others also could move too..