ComGamer's Forum Posts

  • I submitted a feature request for this, please upvote the request:

    github.com/Scirra/Construct-feature-requests/issues/573

  • Feature request submitted:

    github.com/Scirra/Construct-feature-requests/issues/573

    I'm not used to submitting feature requests, so please add comments if you like!

  • OK, I could do that if that's the only way. It's not the most elegant solution, but probably the simplest.

    Do you think a feature request has any chance? Or should I not spend time on this because it is too exceptional a situation?

  • Hi,

    Thanks for your response!

    What I forgot to mention was that I create a new frame before adding the image to the sprite. A new frame seems to have (0,0) as image point.

    So my question should be: is it possible to create a new frame with a different imagepoint then (0,0)?

    + FileChooser: On changed

    -> spr_load: Add animation frame to "Animation 1" at -1

    -> spr_load: Set animation frame to spr_load.AnimationFrameCount-1

    -> spr_load: Load image from FileChooser.FileURLAt(0) (Resize to image size, cross-origin anonymous)

    When the existing frame has a centered imagepoint, the newly loaded image appears with the left top corner in the center.

    Does it make sense to submit a feature request for this?

    Thanks!

    Wim

  • When I load a new image to a sprite from URL, the imagepoint is always top left. The sprite also contains other frames with images. All these frames have a centered imagepoint because the sprite will act as a mousecursor.

    The easiest solution is changing the imagepoint of the frame after loading the new image.

    Making a workaround is possible but complex because there are other dependencies.

    Thanks

    Wim

  • This issue is solved since release R440.

    Wim

  • Thank you, it worked!

    For others, here is my working code:

    (Don't forget to put the speed of the animation to 0, so the animation doesn't play to the last frame, like I did at first)

    + FileChooser: On changed

    -> Sprite: Add animation frame to "Animation" at -1

    -> Sprite: Set animation frame to Sprite.AnimationFrameCount-1

    -> Sprite: Load image from FileChooser.FileURLAt(0) (Keep current size, cross-origin anonymous)

    ----+ Sprite: Pick instance with UID 2

    -----> Sprite: Set animation frame to 0

    -----> Sprite: Set size to (250, 250)

    ----+ Sprite: Pick instance with UID 3

    -----> Sprite: Set animation frame to 1

    -----> Sprite: Set size to (250, 250)

  • Hi,

    I want to change the image of one instance of a sprite, but when I pick one sprite, the image on every copy of a sprite is changed:

    + FileChooser: On changed

    ----+ Sprite: Pick instance with UID 2

    -----> Sprite: Load image from FileChooser.FileURLAt(0)

    -----> Sprite: Set size to (30, 30)

    (The size of sprite UID 2 changes as expected).

  • Hi,

    In a multiplayer game, I would like to send a picture from the host to the peers. It works perfectly for very small pictures of a few kilobytes, but when I send a picture of 400 kB, both the host and the peer disconnect immediately.

    I store the picture in a BinaryData object and send it as a text message using BinaryData.GetBase64 to convert it into a string.

    Is there a maximum message size?

    Using reliable ordered or reliable unordered transmission does not make a difference.

    Is there another way to send large amounts of data?

    I understand that sending large amounts of data can cause lag, but in my situation, time is not an issue."

    Thanks, Wim

  • Hi,

    Is there a system action that does the same thing as runtime.getAllLayouts();

    I just want an array with all the layout-names.

    At this moment I do it this way, and it works, but I am just wondering if this can be done without using scripting:

    let larray = runtime.getAllLayouts();

    let a = runtime.objects.Array.getFirstInstance();

    a.setSize(larray.length,1,1,);

    for (let i = 0; i < larray.length; i++){

    a.setAt(larray.name,i-1);

    }

    Thanks!

    (I posted this topic in 'How do I...? and not in scripting because I have a question about doing something without scripting. )

    Wim

  • dop2000, off course, such an easy solution, I was making it much to difficult.

    There's still a small chance of getting long repetition of two of the same numbers: 1,2,1,2,1,2,3 but this doesn't seem a real problem.

    lionz: 3 times in a row is only a problem when simply picking a random number every time. Ex. 10 x choose(1,2,3) -> 3,1,2,1,3,3,3,3,1,2

    Thank you both!

  • I want 3 different enemies to appear in a random order, but never two the same after each other.

    - By choosing one at random, it often happens that the same enemy appears even three or more times in a row.

    - With an advanced random permutation table

    (-> AdvancedRandom: Create permutation with 3 values starting at 0)

    that I shuffle every 3 'appearances', I often get the same enemy two times in a row (example of a sequence: 0, 1, 2, 2, 1, 0, 0, 2, 1, 1, 2, 0).

    - So when shuffling the permutation table I check if the last enemy (of the first table) and the first enemy (of the new table) are not the same. Else I reshuffle.

    However, I feel that this is a very complex and far-fetched solution. Can it also be simpler?

    [functions]

    | Local static number index‎ = 0

    ----* On function 'getNext' → Number

    --------+ System: index < 2

    ---------> Functions: Set return value AdvancedRandom.Permutation(index)

    ---------> System: Add 1 to index

    --------+ System: Else

    --------+ System: index = 2

    ---------> Functions: Set return value AdvancedRandom.Permutation(2)

    ---------> Functions: Call randomizeTable

    ---------> System: Set index to 0

    | Local number last‎ = 0

    ----* On function 'randomizeTable'

    -----> System: Set last to AdvancedRandom.Permutation(2)

    -----> AdvancedRandom: Shuffle permutation table

    --------+ System: While

    --------+ System: last = AdvancedRandom.Permutation(0)

    ---------> AdvancedRandom: Shuffle permutation table

    Thanks!

    Wim

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank Lionz, this is wat I thought and what seems logical. But why then is the 'on item get'event triggered when the item doesn't exist?

  • Does LocalStorage 'Get item' action creates the item in LocalStorage?

    I'm asking out of curiosity now, because I solved my problem with 'Check item exists' and then in 'on item exists' the action 'get item'.

    At assumed (wrongly?) that 'On item get' wouldn't be triggered when the item didn't exist already (when the user first played the game on this browser). But even in incognito-modus the 'on item get' was always triggered.

    Thanks!

    Wim

    Tagged:

  • Only possibility left is your web host server settings then.

    The main problem seemed to be a 'hidden' (I couldn't find it) cashing of files in Google Chrome, 'incognitomodus' of Chrome solved my problem.

    Thanks for your help!

    Wim