Aphrodite's Recent Forum Activity

  • Aphrodite Where would that code even go?

    The "proper way" to do it would be to use a project file (which is actually just a text file containing that code, which is actually a C2 array in a JSON format), to call it using the AJAX object, and to load the Ajax request result inside the array using the array's action "Load".

    https://www.scirra.com/manual/108/array

    https://www.scirra.com/manual/107/ajax

    https://www.scirra.com/manual/141/files

    However it might be a little too much to worry about if you don't know yet how to do all this.

    I suggest you go by setting each value with a "set at X/XY/XYZ" for now, just remember that if your array is not large enough you could have issues(a value outside an array is always 0).

  • When you are using "Compare parameter" (the event), you just have to entre the index of the parameter (0, or 1 or 2, or whatever parameter you want to compare to something).

    So if you set Index to 0, comparison to Equal, and Value to 1 for exemple, the condition will be true if the First parameter (it's zero based..) is equal to 1

    Function.Param(Index) however is the value of the parameter itself, which can be use in various ways inside the function (like inside a math formula, or to pick a particular instance of an object, or to return a particular result)

    In theory you could compare the value of a parameter by using System>Compare Two Values : Function.Param(0) is equal 1

  • You could also do:

    if you don't see exactly:

    First Value:(Sprite.Boolean1 = 1) & (Sprite.Boolean2 = 1) & (Sprite.Boolean3 = 1)

    Is equal to

    Second Value: 1

    (C2's instance variable booleans actually returns 1 if true or 0 if false)

    BlackHornet's method is valid, but if you need to combine OR and AND, it could be pretty annoying to do in blocks at the end if you are good with boolean logic

  • I like the idea of using an instance variable, since they usually keep everything nice and tidy, but every time I try to make an action to change its value, it says that "down" is an unknown expression and "right" "does not take 0 parameters". I think I might be wrong, but I'm supposed to use "Instance Variables -> Set Value", right? Is that the action I'm supposed to use? I still don't know how to set the direction to anything, as I just don't know which action I should use.

    To use an instance variable inside an expression, you have to write it in the format : Object.Instance_Variable (e.g. Sprite.Down, Enemy.HP, etc..)

    To set it, you just have to select it from the dropdown list, and to enter the value you want

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • {"c2array":true, 
    "size" :[2,5,1], 
    "data":[
    [["(0,0)"],["(0,1)"],["(0,2)"],["(0,3)"],["(0,4)"]],
    [["(1,0)"],["(1,1)"],["(1,2)"],["(1,3)"],["(1,4)"]]
    ]
    }[/code:9rupk4q1]
    
    should return an array like this:
    
    
    

    "(0,0)" | "(1,0)?

    "(0,1)" | "(1,1)"

    "(0,2)" | "(1,2)"

    "(0,3)" | "(1,3)"

    "(0,4)" | "(1,4)"

    Hope that helps (I do not know about a 3D array though)

  • > It is a samsung Galaxy tab 3, MODEL:GT-P5210, I mostly use the chrome browser, and I didn't saw this problem hapenning on it.

    >

    Have you tried using mouse click events on your tablets native browser to see if mouse input counts as a touch? I'm not sure if its because I'm testing with an older device but it seems that even mouse events work on mobile web browsers.

    It seems to be a native browser problem.

    The native browser does it indeed with only a "on any click", that's annoying :/

  • Hey there,

    Do I use "On Start of Layout" and then fill it in with events? Or is there some other way? Like a text file?

    Thank You

    You can do the on start of layout + events, however, it is not the best technique, the best is I think to load a JSON file (which can be a project file) into it when it is created.

    I do not remember the exact syntax though

  • It is a samsung Galaxy tab 3, MODEL:GT-P5210, I mostly use the chrome browser, and I didn't saw this problem hapenning on it.

  • I also saw that mobile often triggers both a touch and a mouse input (no, the use mouse button of the touch object wans't set on)

    I think I saw that in websites too sometimes, and it was not predictible (sometimes the mouse input first, sometimes the touch input first, and even then, a delay between them so that sucks..)

    It makes it also hard to design for both touchscreen and mouse, since trying to detect the input will likely be a false positive mouse sometimes :/

    I do not think it is scirra's fault, my tablet does not return this input conflict, but I could be wrong.

  • Aphrodite I was going to suggest that but tried it first. In the case of the 9Patch object you can neither spawn nor use the create object method but I agree, C2 is not very limited. In fact it is only as limited as your imagination and experience.

    I just tried, and I used create object to create a 9patch, and it worked, and by using a container between a 9patch and the other elements of the window, and by placing them with an event starting by "9Patch: on created", it should work just fine

  • I am not exactly sure I get it yet, if the image was not power-of-two sized, it wouldn't make a difference for low-end GPU then (since they will consider it like a power of two size still), but will be in theory a smaller filesize at the end, and also:

    Square power-of-two guarantees that the GPU texture will also be exactly the size of the spritesheet.

    but in that case, the the added texture ins't used either, unless it means the GPU would deteriorate the texture in case of non-power of two, but since 1 frame only objects aren't spritesheeted nor resized, it seeems unlikely to me

    Ashley

    EDIT: I misread, low end GPU doesn't support at all then, but it is still weird for the non-power of two sized exported for one frame, that they works

  • Ashley : It occurs to me that the spritesheet C2 exports when there is mostly than 1 frame are always a size of A x A (A being a power of two, the same number for both sides), I do not clearly understand why a rectangular sheet wouldn't be possible?

    (And also the power of 2 sides only, for that matter, is not that clear to me, I though some weak gpu would fill themselves the missing spaces, not that C2 should fill them, could have misunderstood that)

Aphrodite's avatar

Aphrodite

Member since 20 Dec, 2011

Twitter
Aphrodite has 2 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies