locohost's Forum Posts

  • Currently the C3 section expand/collapse arrow icons indicate the "state" of the section. Why? I'm looking at my screen so I can already see the state of my sections. UI buttons should always display icons and/or text that clearly indicates what the button does.

    Tagged:

  • I really think that C3 dev team should consider putting some serious thought and effort into improving functions. What we have now in C3 functions is a reasonable "MVP", but definitely not great.

    An example improvement...

    A function refactor that would allow us to complete the prior "tick" on each function call. If you don't want to risk breaking existing functions with a refactor, give us another function call (or a function call param?) that completes the prior tick when called.

  • locohost - I literally ran into the same thing with my recent post too

    here> construct.net/en/forum/construct-3/how-do-i-8/how-long-does-a-pick-sprite-la-142303

    I too have been programming for many, many, many years and tend to function'ise as much as possible to reuse code and prevent repetition. That was also my downfall :)

    So, want to let you know you weren't alone on this one.

    Thank you graham-s

    That does make me feel better :-) Do you use the "wait 0 seconds" just before calling sub-function trick? That seems to be working for me. Thank you AllanR for that one. I'd love to compare notes on using functions in C3. I really can't build an app without lots of functions. With all the suggestions and helpful replies here, I did get a lot working yesterday.

  • Might want to take a look at Dictionaries.

    newt Ok thank you. I'll do that now :-)

  • Ok I finally got it. If you're not using array.push to add data (you're using array.setXY exclusively), you have to call array.setSize to keep adding a new row.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oops, no this is wrong. Array.Depth is always the fixed size, not the number elements in array.

    Also, array.Count does not work.

    There is no array.Length

    How do I get how many records are added to an array?

  • So was right, the action that sets dataRow needs to be this...

    dataRow = dataMonsActionSet.Depth - 1

    Thanks again Zg13shren!!!

  • Hmmm, you may be right. I should be setting dataRow = dataMonsActionSet.Count - 1

    I'll try this now. Thank you !!

  • I'm trying to use just a single instance of a global array as an in-memory "data table"'ish thing. Is this dumb? Is there an easier way to do this?

    Below you can see my function that is trying to set rows in the data array. You can see in the debug console that no data is writing to array. I read somewhere, or someone told me (don't recall which), that you don't have to pick global arrays, you just reference them in an action and you'll always be using the one instance. This doesn't appear to be true.

    Can you see what I'm doing wrong below?

    Tagged:

  • Another reason to not use functions so often.

    Ok this was going to be next question: Should I even use functions at all? I've been coding for my main hobby and professionally for literally 37 years. This makes me think of everything in C3 as "code" and that's really probably wrong.

  • Ok "Signals" are broken. This won't work.

    You can't nest Signals. If in a toplevel pick event, you try Function.Call, on line right after set "Wait for Signal" (WFS). Then in the called function, do another Function.call, next line set WFS, the second WFS never triggers. I have a logging line (writes to textbox) right after and you never see it. And yes there are Signal "..." at the tops of the functions so that's not the issue. And the Signal strings are in global Constants so no, its not an incorrect Signal/WFS string issue.

  • Ok I think I see how this works. I have to use "System > Wait for Signal" and "System > Signal" to simulate JavaScript "Callbacks". Just did a quick test and I think this is what I want.

  • So question, maybe this is answer: Does Action: Function.Call block and wait until function called finishes all events and actions and returns before continuing to next Action after call?

  • See below. The function below is called from another function after 3 Monster sprites are created and some instance variables (their inst-vars come from Family) are set. There is 100% definitely a Monster with key=10. I can see it clearly in debug, but it never gets picked. What am I doing wrong?

    Tagged:

  • It means the next pick at the same level will remove the last from the sol, and then default to the zero index if referenced again.

    Also, functions always break picking. You have to re-pick in the function call using an id in a param.

    Then again Ashley is doing some refactoring on the plug, so that may change soon.

    What is "sol"?