mindfaQ's Forum Posts

  • Yes, feel free to use it for whatever, consider the events open source (I'm no expert at licensing, so I don't know if a capx can be licensed as GPLv3).

    image: You are completely right. I will change that in the next version. My bad.

  • That's what I meant with the "special format"

  • Maybe within the snapshotting event set the size of the layout and scroll to the part of the screen you want to screenshot of, snapshot, and then immediately set the screen back to the prior settings. Never tried if that works, but that's the only approach I can think off with the standard objects of Construct 2 for now.

  • sorry, it was a mistake by copy paste from another topic and then meedling within, here you can see the right format:

    {"c2dictionary":true,"data":{"n":"ん","na":"な"}}

    Also note that your on create trigger doesn't fire off, if you don't create another instance of this dictionary within an event of yours (and why would you). Use something like "on start of layout" or compare the keycount and if it is 0 for the dictionary, then do the json loading.

  • Construct 2 doesn't accept just any JSON string, but wants it in a special format

    something like this, if I'm not mistaken

    {"c2dictionary":true,"data":{"n":"ん","na":"な"}}

    and so on

    If you have the full version of Construct 2, you can start your layout in debug mode and check out if the keys are filled with your json string's data - I think they aren't.

    Also note that on created does not activate for the dictionary if you don't create one via some event. If you don't create it, use "on start of layout" instead to add all the relevant keys to the dictionary from the json string.

    LittleStain: I think Dictionary is the right choice, since you have name -> value pairs. In an array, you would need to do a for each x and then first look up the correct row that contains the key, before you can retreive the value for it.

  • Sure, the copy service sucks right now, maybe I'll have to switch over to another service <<

    http://strategy-investor.de/mgz10/scaling.capx

  • creat object

    set position to x = random(scrollx, scrollx + originalwindowwidth / 2); y = random(scrolly - originalwindowheight/2, originalwindowheight))

    Or if you mean the right edge of the screen for x it is not random, but just scrollx + originalwindowwidth / 2

    hope I didn't make a mistake. scrollx and scrolly should be the middle of your window and half of the screen width added, you will be at the edge; for your understanding.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's easy mate:

    dt might change slightly, but it's roughly 1/60.

    Each time you do that lerp expression, you move about 1/60 of the distance between those two "points". Each time you move closer means the distance between the two points will get smaller. So you move 1/60 of the smaller value the next time. This results in the movement continuing to get slower, while you never actually reach the destination (it's a bit similar to "Achilles and the tortoise").

    If you wanna do linear interpolation between two points with lerp, you need three instance variables: starttime, startvalue and duration.

    Then do a:

    start movement: set sprite.starttime = time; set sprite.startx = sprite.x

    set duration = 2

    sprite.starttime + duration >= time-dt: set sprite.x to lerp(sprite.startx, 800, clamp((time - sprite.starttime) / sprite.duration, 0, 1))

  • Ich finde mehrsprachigen Support bei Skript/programmiersprachen eher fragwürdig, sollte lieber alles konsistent sein - dann ist der Austausch untereinander auch einfacher. Genau wie bei Grafikprogrammen, wo man sich auch die englische Version installiert, damit man bei den Tutorials weiß, was gemeint ist bzw. sich mit fremdsprachigen Menschen austauschen kann.

  • lerp(1,800,dt) does not create an easing effect but will vibrate near at value 1.

  • There might be shorter solutions, but this one is stays pretty readable imo (events 2-5).

    Made a little game out of this:

    http://strategy-investor.de/mgz10/evade/

    have fun

  • If you don't want to use up a lot of sprites, you will probably paste sprites to the canvas/paster plugin or draw paths with those (not sure about the paster plugin, has been too long since I've used it).

    As to the tree itself, think about:

    • branching of one line into 2 or more at a splitting angle.
    • a max. amount of branching allowed.
    • number of branches per split
    • Line lengths (stem is longest, little branches the shortes)
    • will it get thinner each branch or continually? continually will be more coding work
    • add randomness (lengths, angles, thickness, the possibility for a branch to end before the branch amount maximum)
    • leaf "branches" after x-th branch level?

    Well, I guess it depends on how complex you want to go into this matter and what effect you want to achieve exactly with this.

  • hey guys, I managed to do a small update:

    version 0.7; current number of events: 98

    https://copy.com/vi8T3jeZALnD8PFR

    http://strategy-investor.de/mgz10/vnengine/

    I'm encountering really bad fps, although most events are triggered. Guess the problems are the transparent, "big" sprites. Not sure how to improve the performance - if someone knows how to improve it or sees the fault for the bad performance in something else - please inform me <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">.

    newly added:

    • auto mode
    • skip mode
    • voice functions to play sounds for corresponding text lines

    reminder for me personally what needs to be added, that will hopefully fit in the two remaining 2 events:

    • disabling the save and load button while there is no save state selected
    • sfx volume and hopefully loop control via the script
    • switch from webstorage to localstorage, which was newly added
    • give each button its own animation, so code gets more readable and exchanging buttons more straightforward

    Also forgot which bugs occured with saving/loading, need to check that out, still. If you stumble upon one, let me know.

  • Yes, there is an easier solution:

    [your triggering event]

    --pick enemy with enemy.iid = 0: destroy

  • Well, I've tried trigger once with this array loop:

    the counter just continuously went up, so I think there is a bug with that combination (or I understand the trigger once or loop incorrectly).

    You could try to work around it by either:

    a) use another global variable, instance variable or value in another object to basically save, whether this event already occured; set as condition occured = 0 and the loop afterwards and inside the event set occured = 1 somewhere

    b) pack it inside a function and call it when needed (my preference)

    Other than that comparing values in conditions should work flawlessly, at least I never experienced any problems there with expressions in brackets. Other problems could stem from comparing different types of objects (comparing strings with a number, or trying to add a number to a string).