tunepunk's Recent Forum Activity

  • 99Instances2Go Yes, and also if the next top event is 'on created' picking doesn't work either. It's very weird. Seems like 'On Created' doesn't count as a top event either.

    Since 'pick instance by UID' works, I wonder if it can handle a string of multiple UID's? I never tried that.

  • Well there's always the first thing I suggested.

    Set the z on creation.

    Anyway, I'll keep giving workarounds for feature requests, you don't have to use them.

    I did try that as well, doesn't always work as expected. The only action to set zOrder is by Move to object behind/infront so in some cases when the arrow doesn't hit anything and is partially behind another object or in between objects i have some sorting problems. If I move infront of the one behind sometimes it would end up infront of the one in front also, or vise versa. Anyway....

    ....But I got it working using the global varaible aporoach. Thanks, but It's not really my first instinct to do it that way. It doesn't really make any sense why 'pick all' doesn't pick all when you expect it to do so. They should change the name to "pick all except new objects" :p

  • tunepunk

    Don't use a function for new objects.

    It used to work that way, but it was changed at some point.

    It doesn't matter if I use functions or not. The design is retarded. On creation - I need to pick everything including the newly created sprite, and sort the Z order otherwize the newly created one will not end up in the correct order, or I will see a glitch (if i use wait 0), or I have to use some strange workaround with variables to pick.

    Pick All, in a sub event does not work, newly created sprite is excluded.

    Pick all, in a new top level event like "on created" still excludes the newly created one.

    Pick all, in a function called in any of those still doesn't include the newly created object.

    There's no logical way to pick after creation which is very annoying. I've spent hours trying to figure out why it doesn't work, and trying to find workarounds. Picking should always pick. I don't care if they are sol, new, instance or whatever, if they have an UID they should be pickable.

    And the reason for using functions is so I don't have to clutter up the code with copies of events doing exactly the same thing.

  • So that means 'on created' is not a top level event either? In my previous example function is called in a new top level event (on created).

    So can anyone explain this image then? 1st example rotates correct sprite as expected. 4th example picks exactly the same sprite but does nothing.

    2nd and 3rd example rotates everything but the created sprite.

    From example 1 it's clearly pickable.

  • If i have other sprites on the screen, this example only rotates the ones already on screen on click.

  • > yea, tunepunk is right- on create doesn't include the new objects in any picking.

    > in these events for example, nothing gets rotated:

    >

    >

    Might want to recheck that.

    As is, any instance in the layout already will be rotated.

    Pick all negates the on create pick, and picks everything else.

    Remove the pick all, and all instances get rotated when created.

    So it's a useless trigger if you want to, upon creation pick anything of the same kind, allready on screen and rotate them together with the new one? any workaround?

    Anyway, that does not explain why my function isn't picking the newly created one. The function is clean of any picking at start? and should pick everything right?

  • yea, tunepunk is right- on create doesn't include the new objects in any picking.

    in these events for example, nothing gets rotated:

    Can confirm. Did exactly the same test. Pick All doesn't pick any picked objects. Removing Pick all and they will rotate.

  • I have no idea what that means. It works this way ....

    Some conditon ...

    The create action .....

    New condition 'on created' ....

    Conditions + actions

    The 'on created' picks the newly created object, when it is ready to pick. And then you do with it what you like.

    The 'on created' is a trigger, it does not matter where in the events you put it, as long as it is a root event.

    If this gives you a picking problem (kinda impossible) then you have to be very specific on what you mean with "it still doesn't work". Show the events.

    It most certainly does not work. Everything is picked except the newly created one despite called by a top level event.

    Even if i set the opacity directly in the "on created" everything except the created sprite has the opacity set to 50.

    It seems like the newly created arrowInGround is not in the family upon creation.

  • I would like to suggest "Hoodies" or maybe "Hoodie" which is a combination of hood from Robin Hood and your character designs plus die which is something they will do Keep it up!

    Played around with your idea there, Maybe just hood would work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Made a lot of performance improvements this weekend. Cut the Z ordering CPU usage by approx 70%. And instead of Arrows checking for collisions every tick while in flight I turned off collisions for arrows & changed to use some kind of quick raycast approach, that detects collisions before the shot is fired, and then the arrow just travels to there. Turned off collision detection for players as well. If an arrow is in flight it picks the nearest other player, and if the arrow get within 30px of the player count as a hit. I think I've done all I can performance wise, so now back to polishing up the level UI, and artwork.

  • The function is called b4 the merging.

    Just use the trigger 'On created'.

    If i put on created as a new top level event below it still doesn't work. Maybe if i put on created above? Does the merging happen at the end of the event sheet?

    On created >

    On collision with Sprite2 > Create Sprite

    Run through event sheet - back to top.

  • Nope.

    The only shortcut here is a good memory if it's used already or not.

    Honestly though, I wouldn't really worry about a few vars hanging around - unless you've literally got hundreds/thousands of unused vars, it won't make a grain of sands difference to performance or project size. If it's more of just a case of being tidy for the sake of sanity - then yeah, have fun cross checking everything :/

    ~Sol

    Yeah, it's basically just my OCD kicking in. Haha, I'm not worried about filesize or performance. But it just get a bit hard working after a while because i named them very similar in many cases. posX, Xpos, Xsort, Xvar, objectX, Xtest, testX and all other combinations you can think of. The biggest problem is remembering which was the actual one I was using. Lol.

    So a nice little C2 cleanup functionality would be great. Things like "Delete unused instance variables, delete unused sprires" and things like that.

tunepunk's avatar

tunepunk

Member since 2 Mar, 2014

None one is following tunepunk yet!

Connect with tunepunk

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies