Prominent's Recent Forum Activity

  • Yes, I noticed that too in my attempt to find a solution to the problem. Functions don't seem to act like top-level events, so they can't select the newly creates objects.

    In many cases, using a Wait is not an option, as it disrupts the flow of the program, causing things to become unsynchronized. You then have to create more variables/etc and methods to check when to do things.

    If you could pick the newly created objects (perhaps only in the nested sub-events?), it would solve these problems and help make the events simpler/cleaner.

  • That doesn't explain why you can't use Pick All as another sub-event inside the created objects event to include the new objects.

    If the issue was new objects being included in events outside the sub-event (the sibling sub-events), then shouldn't it be alright to include the new objects in the nested sub-events ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's weird. Why change that to prevent infinite loops? Users can still create infinite loops. If it was possible for pick all to include new objects, that makes more sense to keep it that way than to have it not pick them.

    I want to know the reason against it.

  • You could pm me a list of the features you'd want in the capx, and what you'd be willing to pay, and I can look it over and see if it is something I'd be willing to do.

  • When you create an object, that object immediately gets picked. If it can be picked immediately after creation, why can't it be picked at any other time?

  • Also, I used Models instead of q3dsprites, because with models you can set orientation, whereas with q3dsprites they always look straight at the camera. The models are a flat plane with the uv set to cover the whole face of the plane, then you add the animation to the model.

    This is so that I could have them stand straight up from the ground, regardless of camera angle.

  • Example of some stuff that might help give you some ideas.

    enemy sprite stuff

    enemy creation sprite stuff

    camera position stuff..

    Forum post might cutoff the side of it, so you can open them in their own tab to see full image.

  • Problem Description

    Created objects aren't picked.

    Attach a Capx

    https://1drv.ms/u/s!AhHSZHEulqh_gTlThpxipQKQXDNY

    Description of Capx

    Created objects, and tries to pick them all, then rotate them all

    Steps to Reproduce Bug

    • run and see which objects are rotated

    Observed Result

    Only one Sprite is rotated.

    Expected Result

    All Sprites should be rotated.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    vista sp2

    Construct 2 Version ID

    r227

  • Seems like Pick All will exclude any newly created Objects, with or without the hack. A bug?

  • That function is run when a top level event is reached, so the objects get destroyed and new objects added to the instance lists then. Without the hack can you access new objects by iid immediately after? If that works then something else is done behind the scenes to make that possible. Maybe instead of that second loop use "type.stale_iids = true;", so new iids are generated by the runtime instead. Untested but it seems to do that with families.

    Without the hack, Sprite.IID will return the last IID (the object created). Sprite(N).IID will always return 0 (even if you do a Pick All sub-event).

    Without the hack, you can pick Nth instance after creating one (in a sub-event), as long as you do a Pick All to select all instances.

    With the Hack, Sprite.IID will return wrong IID after creating a new object at front. It returns the IID as if it is at the back. However if I add to CreateObject in system.js:

    if( window["createAtFront"])
    				inst.iid = 0;[/code:kj8e0x4j]
    then it returns 0.
  • Thanks R0J0hound ,

    I tried testing that. Seems like it works partly. I also changed it a little to be:

    			if( window["createAtFront"]){
    			   type.instances.unshift(inst);
    			   var i2, len2;
    				for (i2 = 0, len2 = type.instances.length; i2 < len2; i2++)
    					type.instances[i2].iid = i2;
    			}else{
    			   type.instances.push(inst);
    			}[/code:33da51nx]
    So that the IID numbers can be referenced correctly.
    The problem though is that I can't set the window.createAtFront multiple times in one event- It waits until the end of the event cycle to run ClearDeathRow I think, so whatever the createAtFront is set to last will be what it uses. And thus I can't reference the IID for the same reason until next event cycle. I end up having to use Wait 0 seconds, but I want to avoid using Wait.
    So, it seems a bit messed up, as far as how it affects other picking in the same events/sub-events, since things don't get updated instantly.
  • I've explained it pretty clearly already.

    When you create an object, that object can be picked by picking the object.count-1.

    So if I have events that rely on index 0, and I need to create an object with that index, I can't without having to add other things- whether it is events/variables. These extra things add complexity to an already complex procedure. I want to minimize that so that my events are clearer/minimal- allowing less opportunity for errors and improve my ability to create more events that do what I need without trying to jump through hoops, juggle variables, etc.

    It's great that you haven't run into my problems, or don't find certain things overly complicated than they need to be, but for me there are issues I see that could be solved if I have these features.

Prominent's avatar

Prominent

Member since 28 Apr, 2012

Twitter
Prominent has 9 followers

Trophy Case

  • 12-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Email Verified

Progress

15/44
How to earn trophies