99Instances2Go's Forum Posts

  • No trouble, just happy someone shared a .capx.

  • CTRL + F

    (one of those shortcuts that are hardwired in my fingers)

  • Well you have references to two objects in there. It reads as "set the instance variable for object 'enemigo' to the expression enemigo.something. _________________________________________________^ first object_________________ ^ second object The replace is (always) asking for a replacement for both.

  • https://www.dropbox.com/s/ill28s11g3b1f ... .capx?dl=0

    Fixed 4 things for you.

    1/ This one is just for the logic. In your case not an important one. But, when using Ajax, you should wait until all Ajax stuff is done before continuing the events. Fixed this with setting group "QUIZ".

    2/ Changed starting Qnum to - 1. Now it starts to display Qnum from zero, the array is zero based. That, or you got to rethink the moment that there is 1 added to Qnum.

    3/ Now the first question is displayed immediately (no click required) . And all texts stay invisible until Ajax is done loading for BOTH lists. It was not necessary so that first by Ajax loaded list also was the first list to be ready and usable. But loads happened at kinda the same time, and it is not really known which one is ready to use as last, and could call the display function.

    4/ The logic flaw you had. Actual your question.

    When you clicked the text field. It called the function, that function changed the rAssign value. So the next (supposed to be the opposite checking) condition got a different rAssign feeded (then the first condition).

    Solved it with a plain 'else'.

    I left the browser object in there. To show you how you can use it so eassssy to debug. You can delete it.

    Hope this helps you and learns you something.

  • Plz keep those, it is already hard enough to remember if a value is in pixels/second or pixels/tick. Units are essential.

  • The loop will finish 'in place'. In the same tick, prolonging the tick if needed.

    Hence, it is (just) ready in the next event.

    Loop event

    _____bunch of actions

    Next event .... loop is ready

  • I fully understand that you did not ask me 1 thing, i just feel that a positive reaction is on its place here.

    Unlike you, i am happy with the way that things are running right now. I see Scirra people till late online. I see Ashley in person plow trough the many reports. I see a lot of closed reports. I have no idea about tomorrow, but up to now, i see a lot of good work been done.

    I am perfectly fine with this alfa-beta-theta version. I am fine with the restrictions, i dont know (but i dont think) that this is the final form of the free version. I do know, and i do understand, that this form is about the only possible base form that can take our daily abuse and return manageable bug hunting and reports. Anyone who ever helped someone on this forum finding a script bug in a 100+ event system should understand this.

    As probably everyone, i wrestle with convincing myself to step in a (for me expensive) subscription system when it comes to c3. But that is a decision for later. Right now, i can only watch this grow and bloom with pleasure and confidence in the future.

  • Well, lets use a tilemap to make c3 dizzy:

    https://www.dropbox.com/s/bg1d08no9103t ... .capx?dl=0

  • Actually, newt, i would love to see/feel/touch your work. But i have no, and never will have, one Android device.

    A lot of apps presented in the forum, seem to be only on Google Play.

    My next phone will be Sailfish, i think, at this moment.

  • You can generate your own Sprite Font.

    sprite-font-generator-v2_t86546

    Besides that, i dont really know anymore what to recommencement.

    This 'period' in 'the history of construct' is very confusing.

    C3 has Web Fonts Integrated, which is (my opinion) the best thing ever considering text.

    https://www.scirra.com/blog/190/integra ... onstruct-3

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can bring new 'graphics' in a tilemap (i suppose also in a tiled background).

    So, you could make an 'rotating animation' and refresh the tiles.

    But, they not gonna be seamless. Rotated, their 'bounding box' is bigger. I dont see a way for how to solve that.

    Besides that, loading a new frame and setting that new frame will not be a performance boost compared to having them all in the form of an instance. What you win by having a tiled background, you lose by animating it in a loop. At least, that is what i think at this moment.

    So mayby back to the main thing. "I'm really not wanting to have 200+ instances of an object."

    Are they all 200 in the viewport ?

  • https://www.dropbox.com/s/9tmx9e0cqbgzp ... .capx?dl=0

    First things first. Although they have nothing to do with your question.

    To make a flawless example i had to decide if they can rotate towards the player or not.

    Since they are dumb plants, i decided not to. But then they have 2 states, mirror or not.

    And as a consequence, they need a LOS cone. And as a consequence of that, the default state must be aligned with the default zero angle in C2. Since i dont know how to (temp) mirror in the layout editor, i added a 3th animation to be able to design in the layout editor as i want to. That is why the animations now align with the default zero angle in C2. So you know where halve of the code comes from.

    Back 2 your question.

    As you can see i will try to avoid a 'for each' at all costs. A 'for each' (depending on how many sprites in the loop) will always weight on performance. In this case that is perfectly possible because ALL sprites that meet the LOS condition will 'attack' and ALL sprites that dont meet the condition will be 'idle'. So there is no 'personal' thing going on. It is a 'all or nothing' case.

    I have never seen a 'Once while true' work as intended in a loop. So i will avoid that to.

    Usually you can not bring a 'shoot situation', a 'move situation' and a 'change animation situation' under the same condition. Because they often have different 'sample rates'. Gosh, how to explain that. Say, it runs at certain ticks / second. Each tick we can measure something, in other words : take a sample. The LOS needs a sample every tick. The animation change needs a sample only when something happens.

    Starting from those 'base rules', (my personal rules) the way to go is already paved.

    Has LOS, change to attack, else change to idle. I always bring conditions that are paired with an 'else' under an empty (every tick) condition. That way they stay together when i drag them around with my dumb brain.

    For the animation. Done in a different event for reasons explained above.

    Now, if i use a 'for each' then i am stuck with a 'Once while true' in a loop. So i look for something to avoid this. At the same time i prefer a picklist that contains only one plant, just as in the 'for each'.

    Usually there is a trigger for that, and luckily there is a trigger in this case.

    Just have to add a little logic to the trigger.

    Notice also how nice the 'attack' loops, yet not a loop in the properties.

    Hope this helped you some, despite my bad english, despite (maybe weird) personal rules.

  • I know this quirk. Unable to set speed under a 'on animation finished'.

    I solved it like this.

    https://www.dropbox.com/s/qsb3c3jf4l5jk ... .capx?dl=0

    0hbtw, you can 'cheat' on it, by continuously pressing all 3 keys at the same time.

  • Is not the LOS. To illustrate this i added a 'is overlapping' and a 'once while true' to your capx. In the same way as the LOS is done. As you can see, it seems to show the same problem.

    Yet does what exactly what it is designed for. I agree that it looks weird. But lets think it trough.

    The ''once while true' allows that event to run its actions the first time that it is true. To have it running again, it got to be 'untrue' first.

    So you approach those 2 monster plants, and at the moment 1 is in sight, the event is true. When the other one comes in sight, that event is still true. As long it is true, it will just not run due the ''once while true'.

    You can test this, i made playerbase drag&drop to test it faster. Approach those 2, it will not work. Make the LOS condition untrue by getting to a distance, try again, it will work.

    Side tips. I know why you want that 'once while true'. I used to do that myself. But it is not needed for animations. Because, see ....

    The animation will ONLY change to the 'new animation' (and therefor start from beginning) when ...

    1/ the current animation is different then the new animation

    2/ the current animation is in the state of 'stopped playing'.

    You got them looping, so not point 1, not point 2 will happen.

    So dont worry to much about re-starting an animation that is already playing. It has no effect.

    Better even, you can use this to loop animations like 'walk'. Those usually need a continuous press of a key. Meaning, when the 'walk' is at the end of the animation (point 2) it will auto restart again, due holding the key.