codah's Forum Posts

  • Hi

    If you read here: https://www.scirra.com/manual/149/function

    You can see there are under: "Advanced function features"

    "Note that functions calling other functions or recursing create a new "stack" of local variables. In other words, like in programming languages, local variables are unique at each level of function call. This does not apply to static local variables or global variables."

    Anyway, got a question, how do i add functions to my game ? O.o Can't find it anywhere.

    Add the Function plugin

    Add an event and choose Function -> On Function

    Type function name in quotes

  • >

    > > It does matter, in the sense that it won't be actual text, but images of text. It's just not the same

    > >

    >

    > alvarop what is your definition of 'actual text'?

    >

    I guess it's because you can't mark the text and eventually copy it, because it will be converted to images. I don't know if it's correct, but seems correct ^^

    oh ok understood

  • Gotcha, so having FishSprite which contains those objects in a container, and have it in a 'state' Family won't work for you? Perhaps you need to give us a diagram of how you 'picture' the object structure (whether or not it would be possible in C2).

  • To answer the question, you can disable a block of events by creating a Group and putting the events in the group, then disabling the group.

    But I think what you want is just to have the condition

    X"Game Over isOnScreen" (i.e. inverted) ===== Add 1 to Score

    If I understand properly. Note there is no point adding 0 to anything. Maybe you want to set the score to 0 when Game Over isOnScreen, in which case just have another event

    Game Over isOnScreen

    System:Trigger once ===== System:Set Score to 0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So your different characters (fish, turtle, bird) are different object types, or different instances of CharacterSprite?

  • If you want your code to behave as desired, just put a sub-event that picks all red and blue objects, under the 'or' block. It's also why the 'function' solution worked, because in a new event, all objects are again picked.

  • It does matter, in the sense that it won't be actual text, but images of text. It's just not the same

    alvarop what is your definition of 'actual text'?

  • TwinTails just covering all bases

  • Is it in alpha, beta or production? What happens when you click the link in the dashboard?

  • I would rather defer to higher authorities But what I think is:

    In the first case, no Red objects are involved in picking, so that ALL red objects are picked, and so when blue goes outside layout, ALL red objects are destroyed (all 1 of them).

    In the second case, it's as I said above. 0 Red objects are picked because 0 Red objects are outside the layout, so 0 Red objects are destroyed.

    Just my understanding and I'm happy to stand corrected.

    Edit: I'd be interested if you could say, in words, what you expect to happen in each case, and why. Also out of interest, add a few more Red objects on the layout.

  • I'm not saying I'm right, just an idea, but I would think the condition Red:Is Outside Layout has to pick the objects that fit the condition, and in this case 0 Red objects, so that in the action you don't have all Red objects picked, you have none.

  • If the blue circle is outside layout, 1 blue circle is picked and 0 red circles are picked, so there are no red circles to destroy. Isn't that correct?

  • The wait is causing issues. Remove it and it seems to work (although I'm not sure what your actual requirements are). Also events 4-5 are redundant as I don't think they'll ever get triggered. A collision between a TopSoldier and BottomSoldier will always get triggered by events 2-3 AFAIK as they are executed first (top to bottom). I suggest too that you use the Browser plugin and watch the debug output in the Chrome Console. You are getting some Function related errors that are shown there. If you remove the wait, they also stop. After all that, it doesn't seem adding the for each I suggested does anything. I just know I've had problems when passing UIDs to functions if I don't do this. tl;dr find another wait to delay between attacks.

    PS: not sure how I've missed the Store Reference plugin all this time.. looks handy

  • Sorry man I don't have the Store reference plugin (and I'm not familiar with it) and I'm about to go out. If nobody has solved it for you when I get back I'll take a look but I'm sure someone will jump in

  • Codah strikes again!

    so.. tempted.. to make.. a slot machine... must resist.