vee41's Recent Forum Activity

  • vee41 - Thank you, sir! :) And, "automagically"? *grins* You've been hanging around Yann, haven't you? heh heh

    I've been automagicking things for 15 years, so no, I wouldn't say Yann has been influence for me in that regard ;)

  • On a similar note:

    When I create an instance...

    For Each Node | Create Object Ping

    ...do any sub-events pick that instance of Ping for the duration of that interation of the For event?

    Yup. Objects are automagically picked on creation, any subsequent actions will refer to them.

  • Thanks, but how to access the "if" in c2? I can compare global variables for a condition, but I can see the loopindex only at an action.

    Could you show me an example?

    Add condition 'system'->'Compare two values', you can enter two whatever values you desire :)

  • for( 0.. endIndexHere)

    .. loopystuff

    .. if(loopIndex = endIndexHere)

    ... stuff for the final value

    When creating a for loop you enter the end index, so you know the final loopIndex. Just check when it appears and do your thing. :)

  • You'll need to at 'for each enemySprite' loop and put your actions inside that. Then it will evaluate the results for each individual enemy, right now it's handling them as 'groups' and it probably does not work quite as you'd want it to :)

  • You could do something like this:

    lastChoice = -1

    choice = -1

    .. spawn stuff

    .. while(lastChoice = choice)

    .... choice = choose(0,90,180,270)

    .. lastChoice = choice

    The choice variable now holds the angle, which is not same as the last angle that was randomed. Should work in theory, never tested it. :)

  • Post a capx or screenshot of relevant events, it is really hard to figure otherwise what you have done. Array itself is not 'physical' object in game world that you can touch.

  • You'd need to index the array somehow as well. Right now you are picking the item in front of the array and constantly destroying it. In this example, you could add 'pop array.front' action and it should work. Also, your pick event is wrong. Use condition 'pick by uid' that can be found under sprite conditions, not system conditions.

  • Yes, but i prefer the second method, if performance its not a problem.

    It's not, no worries. Recycling the objects multiple times is actually the 'good practice' of building levels. :)

  • Go to the image editor (right click on sprite) and there is an icon looking a bit like a *. Check the manual for details: scirra.com/manual/48/image-and-animations-editor

    scirra.com/manual/63/image-points

  • >

    >

    > ...

    >

    >

    You are correct, if you do not use functions it will work that way. I recommend you check out some FAQ entries about SOL (selected objects list) and picking in general, it should clear it up in case there is still something that needs clarification. :)

    The major difference here is that parameters of function call take only single UID (the first one) from SOL, even if there are more instances in SOL. Function is called only once, unless you specify it to be targeted by all instances currently on SOL. Construct 2 engine really has no way of knowing your intentions, so if you wish to call functions for all objects on the SOL, you'll need to specify it.

    Oh, I wouldn't worry about performance if that is what you are afraid. The bottlenecks are generally else where with C2 engine. :)

  • 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 having some difficulty understanding what you're trying to achieve here, but it looks like the function will only run once because you have it set to on mouse click. If you wanted it to keep running you would need to set up a variable and if it was true then run the function every tick, if it was false stop the function.

    The hasMoved variable is an instance variable, so the event should pick all objects with their hasMoved set to true. If you uncomment the disabled action, you'll see that it does in fact successfully do that.

    This generic project is designed to isolate the function call as the problem. If I hadn't used that onrightclick trigger, but a different means of picking all the objects, it would do the same it is doing now.

    So it appears that it is picking all the objects, but only calling the function once, passing the first object's uid.

    It does pick all, but like you said it passes only single value to function as it is just single variable. Put for each sprite loop at the condition where you call the function. This will call the function for each picked sprite.

vee41's avatar

vee41

Member since 12 Apr, 2012

None one is following vee41 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies