tulamide's Forum Posts

    I still love CC, but I'm somewhat afraid to go on with it with the chance that the project may become dead sooner than later (or as I see it anyways). The main hindrance to CC going forward is, seeing that it was made by still-learning college students, that it is clunky and not very flexible (outside of plugins, I mean).

    -The following is not directly addressed to you, but is more a general summary of experiences and thoughts-

    I wouldn't look to much forward. Take the actual copy of CC and stick with it for the whole project. Use workarounds for missing features or bugs and do your project. Besides many complaints, CC is stable enough to do extensive projects. Add 's' and Python, and there is the flexibility.

    From my experience over the last two years I learned that many, if not most, of the rumors about instability or some bugs are in fact just misuse of CC and its tools. For example, there are lots o people having problems with XAudio2, although it is rock-solid and a workhorse if you just learn about the principles. Or saving projects: why is CC to blame if I save half a million times to the same file and suddenly have a corrupt file? Or the neverending story of grid based tile editing: CC has a completely different approach, still so many complain that it isn't comfortable to work with grid based tiling. The answer is so simple: Just don't do it. Every tile grid construction can be realized much easier and more comfortable by layering object based tiles. It is as if people would drive a car and complain that you can't use a saddle.

    Some features never were finished and that's sad, but it doesn't prevent projects per se. For example, the file object is a mess, but 's' offers more than enough to compensate and create your own file format. With Python you can even go as deep as writing bytewise to your files, if you wish so.

    Shader effects, one of the most powerful features that CC offers, are very rarely used. They can give your project this wonderful final professional touch.

    The event system is not just one of the most flexible solutions when trying to give a simple usage for beginners and still let the advanced ones go in-depth (just look at Quazis unbelievable completely event-based solutions to some of the most difficult programming algorithms), it is also very fast. But again, people complain: Heya, it is not as fast as C++. Well yeah, it isn't that fast, because it is much more comfortable to work with! Comfort always costs speed. But I have yet to see just one game that really hits the speed limit (no, I don't accept 3D-baubles, CC is a 2D game maker)

    In short: Don't hesitate, just do it. Make optimal use of hardware acceleration and fine tune your project to have an optimal balance between cpu and gpu load. Save often, but use a thoughtful save system (save to new files every x times, make backups and store them on different physical devices plus internet). If you don't demand something CC wasn't meant for, it will work. It will.

  • What makes me curious is that I just tested the demos of flashjs. While C2-demos still run bad/poor in Firefox 8 under WinXP, that demo runs with amazing speedy 80 fps. Now what do they make better than C2, that they can reach such high rates, compared to the 9-25 fps I get from C2 demos?

  • I guess I'll go with the array then, however when storing values in the array can you use strings? Or do you have to use integers. Also how do you access the array using construct's expressions.

    This cap will answer the questions: access_string_array.cap

  • :D Thanks a bunch zyblade and Tulamide!

    Also Tulamide, so your example cap for the array is basically writing data to the array that stores the animation frame its on? And how would I go about creating an inventory using an arrya, would I write a variable to an X,Y position on the array? Or would using 'S' be more useful for this?

    It depends on how your inventory is organized and what information has to be saved. Use an array whenever you can map a situation in your game directly to a bunch of cells. For example, if your inventory is a bar with a fixed number of slots, it is very easy to map slot a to cell 1, slot b to cell 2, etc.

    If your inventory is more like in an rpg, a bag that can store a non-fixed number of objects, then a hash table would be more suitable. You could create a key with the name of the object and a value representing the id or position in the bag's list.

    You can always store more than one information at once. Just use strings instead of numbers. In an array, you could fill a cell with the string "Green Pill, 25, 12.52, C" and later extract the informations using the expression 'get token'.

    But if it is a really huge number of informations that needs to be stored per inventory slot, you might indeed consider using 's'. With its ways to create data structures and reference them in other superstructures, it is way ahead of any other method in Construct, as soon as something is object oriented.

  • I also made a more complete tutorial about arrays and hash tables a year ago. It includes demo caps besides the written explanations.

    http://www.scirra.com/forum/tutorial-variables-arrays-hash-tables-an-overview_topic41773.html

  • I just removed the physics behaviour from the second arrow, cause it was multiplying the effect and was too speedy. :)

    My bad. It wasn't intended, I just forgot to remove it after duplicating the original sprite :)

    I'm glad that it was of help.

    With physics and angles: Don't forget that there's friction and the like, so objects need to be rotated physically correct on contact by the engine - that's why rotating an object manually would break it.

  • A few things to mention:

    You can't directly change the angle of the object (just as you can't directly change the position of the object) without breaking the physics behavior.

    The sprite was drawn with facing up as initial state. But initially all sprites are at 0�, which is facing right.

    To get the rotation just add a second sprite, set it to always be at the first sprite's position and cache the last position. Then just set the angle of the second sprite to the angle between the last and actual position.

    Here is an example: phys_Angle.cap

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Double post because of "500 - Internal server error"

  • I'm having a problem with loops:

    ->Make Super Array {""}: "ASDF"

    ->Make String Array {"ASDF"}: "stringasdf" with default 0

    +"asdfloop" For Each String at {"ASDF"}

    This causes a crash.

    's' is very stable. That means, for me it is only crashing, if I did something wrong or illogical.

    Be careful of what you define and how:

    • You need a super to store some string arrays.
    • You need one string array to store some strings.
    • You need to tell the loop the complete path to the string array of interest to loop through.

    In the example above you added a string array with the name "stringasdf" to the super "ASDF", but you expect 's' to loop through "ASDF", which is no string array. The correct path would be

    "asdfloop" For Each String at {"ASDF", "stringasdf"}

    Of course, you should add some strings to "stringasdf" or else there is nothing to loop through ;)

    Here is an example cap: using_s_string_loop.cap

  • I would rather suspect the file being corrupted, than thinking of a bug in Construct.

    I work with Construct for two years now. Usually I save a limited time to one file. With every major feature added, I create a new save file.

    I never ran into issues with saving.

  • No offense, but with those 14 words you won't get much help, if any.

    I know how difficult it can be to write in english, when you're from a country with another language (I come from germany, for example)

    Most of the people with english as their native language don't mind a few mistakes. But this is just not understandable. You should use a translator better than google, or find a friend who can help with describing the problem.

    Also, provide a cap showing the issue. It helps a lot more than a description.

  • My apologies, I meant angle of the sprite and not the angle of motion.

    Ah, yes, that makes sense. And lucid's graphic should make it more clear.

    But here is a practical example:

    Again, the sprite is moving with 50 pixel per second at an angle of 10?

    x-component 49.24

    y-component 8.68

    Now the sprite rotates to 330?. The player hits the thrust button (max speed again 50 pps)[or a planet gets into the influence of another mass, something like that]. Now you need to aim for a final

    x-component cos(330) * 50 -> ca 43,3

    y-component sin(330) * 50 -> -25

    So you need to interpolate (qarp should do) between

    x 49.24 and 43,3

    y 8.68 and -25

    for whatever time feels right for your game.

  • If you are afraid that you could forget to create it, just make a function and call it instead of creating object and data structure in the actual event.

    +on function "create"

    -> create object

    -> add array

    + some trigger

    -> "create"

    <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Maybe I am misunderstanding this. but "horizontal" and "vertical" relative to the angle of motion doesn't make much sense.

    When your object moves with 50 pixel per second at an angle of 10�, then the speed's x-component is cos(10) * 50 (ca 49.24), and the y-component is sin(10) * 50 (ca 8.68)

    But a relative "vertical" component to an object moving at any angle would just be the speed (cos(0)) and the "horizontal" one would always be 0 (sin(90))

  • So I guess instead of asking "How" to do it with S (I'll figure that out) let me just ask, is it possible to take a family of objects, and every time I create an instance of one of the objects in that family either in the layout editor or at runtime, the appropriate data storage structure is created with S? (Note that just replacing families with S for everything is not ideal since I already have a ton of events that use family functionality that I'd rather not replace. However, putting all the objects in said family also in an S structure and doing it would be just fine).

    Well, without going too deep: You can.

    If you created your template of the data structure and a super that stores arrays of them, it is very easy:

    + some trigger

    -> create object 'someobject'

    -> super, add array from template 'somestructure'

    -> super, lastarray, id = someobject.oid

    (or just store the object itself, which is more comfortable, as you can then pick it later from within s, without any trigger or condition needed)

    + some trigger

    -> destroy object 'someobject'

    -> super, loop through arrays, until id = someobject.oid

    -> super, delete array

    You may also want to have a look at Python. It is also very easy to realize it. You'd create your data structure as a class or a dictionary on startup and just store copies of it in a list or other container, together with the object reference, whenever it is created.