EpicRaid's Forum Posts

  • OK thanks!

    I'm having trouble with the details though.

    I currently have this:

    Maybe I didn't understand what you meant. The car parts change, but every 5 seconds (when the function is called) it changes the part's animation frame either too late (when already on screen) or it picks a set which part was already changed.

    Thanks again.

  • OK, so here's what I'm trying to achieve.

    The set of car parts are created every 5 seconds.

    Then, I want to pick a random car part of the last set that was just created.

    That part will have an action, like set animation frame to 0.

    Right now nothing is changing on screen like a different car part animation frame.

    I'm quite new to this picking, I could sure use some advice:

    Thanks.

  • Thanks for your reply.

    Looking at your example; I will have to let my brain do over time to incorporate it into my own project. Also, after an extra reality check, I will have to put this project on hold as its scope is beyond what I want my next game to be.

    In any case, thanks for your example, I copied it and saved it for future reference.

  • Hello!

    I'd like to spawn in a random set that has prepositioned blocks. So if this infinite 'runner' game's first set's Y is at a certain height, it will spawn in a new random set at the top. The screen/sets will move downwards.

    Do I make functions or can tilemaps even do something here? I suppose I will have to do some forehand positioning in C2?

    I'm not sure where to start and was wondering what good approaches are.

    Thanks!

  • I might have found a clue.

    My project has these settings: 540, 960. My layout sizes are exactly the same settings.

    Now, I also have Scale outer applied. The 'visible' area in my game is 800 x 1388. That's the total size of the background, I covered the 'outsides' of that area with solid colored sprites matching the background.

    I do this because the objects spawn in under these sprites and move towards the centre of the screen, and I don't want them to be visible 'outside' the background.

    My reason for extending the background width and height is to adapt to different screen sizes (mobile, tablet) and that works fine in combination with Scale outer.

    Of course my browser on desktop doesn't 'see' any viewport since I covered it with sprites. So basically the horizontal viewport 'borders' don't exist. They extend way until the end of the browser window.

    Probably why it does work on mobile devices is because, I made the project so it fits on almost every phone/tablet, and constructed it so that the objects spawn in nicely at the extremes of most possible device screen sizes.

    I think it's working fine, it's just that I will have to adjust the coordinates somehow of left and right viewport based on how much the screen stretches or shrunk the game screen depending on the size of the monitor, and its resolution on desktop.

    So measure a 'fake' viewport only for desktop, probably using the width of the background image, since that will also shrink/increase and its borders are basically what I would want the viewport to be.

    Now this is a theory of course. What do you think?

    Sorry for the long post!

  • Hi, OK, sorry I didn't include the whole code in my previous post:

    Although I don't think it's in this piece of code either.

    I will continue to look. Thanks.

  • Hello,

    I tried resetting the dialogs but that didn't work.

    Why is this happening? And how to get it back?

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey!

    Thanks for your support.

    I learned a lot of new (function) stuff today! :)

    So yeah, on my iPhone it works perfectly. The TimeText and Clock appear fine on iPhone. But that's probably because you can't drag 'outside' the screen. It will just end at the screen and store that TouchX and TouchY.

    I copied and pasted the code you wrote in your sample. The only thing I changed were a few minor things in the actions, but not conditions.

    Do you have any ideas where to look for to solve this last issue, or how to debug it.

    My project is portrait shaped, and has these settings:

    Hey man, you've been of great help, I really appreciate it!

  • Hi,

    Thanks so much for your help!

    I'm close to getting it to work in my project.

    The only time it doesn't work, is when the end swipe is outside the left or outside the right of the screen.

    The top and bottom seem to work fine.

    Any ideas?

    Thanks.

    P.S.

    I tried the picking with the function, but it doesn't even display the Compliment image:

    ::Edit:: The TimeText/Clock display seems to work fine on mobile. Probably because you can't drag outside the screen.

  • Hi,

    Yes I have only once instance of TimeText and Clock.

    The width/height of TimeText is 122,41 and of Clock 35,35.

    This is what I have now:

    I thought I was already adjusting the coordinates of TimeText and Clock with the Viewport actions.

    Or is there a better way to do this.

    Thanks.

    P.S. How can I pick the object created in the called function? If I want to make any changes to that object? I did some searching but found the examples too difficult to understand. The manual, as most of the time, is not very helpful.

  • Hi AllanR, thanks for your elaborate response! Did you mean as such:

    Unfortunately, the TimeText and Clock are still displayed outside the screen, or half outside, depending on where the touch ends. I'm basically trying to achieve a 'Bound to viewport' behavior.

    So, it will always display the Clock and TimeText inside the viewport.

    I added the 'Wait 0 seconds' action just before "SetTimeText" function call.

    By using the latter action do you mean I can 'take along' the pickeing to any new function?

    I still don't understand why it didn't work at first, I mean, I thought C2 runs the entire event sheet top down every tick(?), and that the function "TimeScore" first does the 'top' actions, and then moves on to the 'sub' events, also from top down, then when the whole function event 'TimeScore' is finished it will move on to the next 'top' event line.

    Thanks again, you're of great help.

  • OK thanks. I did mean that I don't know how to log a function.

    If I write:

    & SetTimeText

    C2 will tell me that it's not an expression.

  • Hey,

    Yeah I already compared them. I used Goldwave to export from .wav to .m4a. The .m4a sound effects sound exactly the same as when converted by C2. So it's no difference.

    I find this issue really puzzling. It's almost as if.. I don't know.. these specific effects are 'out of range' when converted to .m4a and played on iPhone.

  • Hiya,

    Thank you for the explanation.

    How do I watch functions though to see if they are called? I see the Function object in the left list in Debug mode but no functions themselves.

    OK, so is this correct nesting of the "SetTimeText" function to run regardless?

    As for the log, this is what is displayed for the ViewPorts: Left -798.8417618271 Right 1338.8417618271 Bottom 960 Top 0

    Funny thing is the Top and Bottom viewport are 960 and 0. While the Left and Right differ, when I resize the browser window for example.

    Thanks.

  • Thanks for your reply.

    I put the function Call "SetTimeText" below the four viewport conditions so it wil run regardless, but it's still ignored. I want to try your debug suggestion but I don't understand what you mean by all that.

    How do I do that debug output to an event?