ultrafop's Forum Posts

  • > Try this out:

    > https://www.dropbox.com/s/yns53519stt49 ... .capx?dl=0

    >

    > If you have any questions about how this works, feel free to let me know!

    >

    > I'd also recommend checking out some tuts on arrays. Here's a good one:

    > https://www.scirra.com/tutorials/307/ar ... ers/page-2

    >

    It works perfectly! Thanks too much!

    Happy to help!

  • Perhaps someone could teach me an easier way to go about this but I’d write a simple js file that gives you the specific part of the date you are looking for and run it with Valera Popov’s JS plugin. I’m very new to this kind of stuff, so there may be a way to do this with the browser object but I haven’t found it. I’m not sure whether you’re new to js like I am or not but if it is at all helpful, here is a link explaining how to get the current year in js (as an example). https://stackoverflow.com/questions/600 ... javascript

  • Can you please post a screenshot of how this code works? Are you setting a variable for the teleport or just the “on overlap” trigger? If a variable is changed then the player would be unable to move from object Y until it was changed back. But I’m completely guessing lol.

  • ladydye Hey there! Set a timer that begins when the player is not on the ground. If the timer is greater than a set value when the player hits the floor kill your player. If the value is not great enough to kill the player when they hit the floor, set the value to 0 when they land.

  • Try this out:

    https://www.dropbox.com/s/yns53519stt49 ... .capx?dl=0

    If you have any questions about how this works, feel free to let me know!

    I'd also recommend checking out some tuts on arrays. Here's a good one:

    https://www.scirra.com/tutorials/307/ar ... ers/page-2

  • Hey, go ahead and neglect my first post. The "on start of layout" method works but the other one does not because of the for each loop.

    I've made a capx (you can open those on C3 as well right?) with a working method for you that works dynamically.

    https://www.dropbox.com/s/pk3o9bl4palc7 ... .capx?dl=0

    Hope this is helpful!

  • Not sure... inconsistent results in various situations would be hard to pin down.

    The main thing that comes to mind is that the array compare current value condition only works within an array for each element event, but yours doesn't seem to be the case.

    Anyways I'm glad you got something working! I can pretty confidently say uninstalling and reinstalling would not change anything. If you want to post your test capx maybe I can poke at it a bit, I'm pretty curious now <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    Hey! Just tested the file again and now it's working both ways? I'm not sure why I was running into trouble now..especially so consistently.. But on the bright side, hopefully this means my other project will act reliably as well. Might as well share the file anyways lol.

    https://www.dropbox.com/s/kbz9yoemz8o3i ... .capx?dl=0

  • I think this should work:

    Have Array width set to 0 before beginning.

    On start of layout:

    For each (ordered) X.UID ascending

    X is Overlapping Y - Push X.UID front of Array

    If you're not doing something at the start of the layout you can try:

    - For each X

    -

    - ----- X is Overlapping Y - Push X.UID front of Array

    - ----- Once While True

    ------------------------------------

    - ----- X is not Overlapping Y - Call function ("Check for X.UID"(X.UID)

    - ----- Once While True

    On function "Check for X.UID" (X.UID) -

    Repeat Array.width times

    System compare Array.at(loopindex) = function.param(0) --> Array Delete (loopindex)

    I'm away from home but I hope that works!

  • oosyrag

    Hmmm not for me. I notice your arrays are only one dimensional. I'm doing a 2 dimensional array so perhaps that's where the difference is coming in? I've tried this in a test capx and it never works unless I use the system to compare the values. After trying in multiple projects since this post I've even found that the outcome is inconsistent on desktop (If it's a sprite that is shifted it works, if a button, maybe not) but completely consistent on an iPad. So I'm kind of baffled. If you continue to find that both logics work in a 2 dimensional array, I'll have to uninstall and reinstall everything I suppose? Not sure what else I could do.

  • Thank you for helping me to understand that functionality dop2000 and for finding that tutorial for me. I'll have to get moving on this custom textbox .

  • Hello all,

    I am currently trying to loop through a specific array location (10, loopindex) to look for a value ("Com") at that location and generate a list of users who have that value (Each user has their own data stored in their own Y value of the array). This logic does not seem to be working...and this is actually kind off an important piece of my current project.

    My current approach is:

    -Repeat: Array.height times

    Array: compare value at (10,loopindex) = "Com" --> System: Create Button Object at X/Y

    How else might I approach this to get the result I'm looking for?

    Thanks for any help!

    EDIT:

    I discovered that using the Array object to check for the value does not work as expected, but using the System to compare values in the array does. I'll leave this up for anyone who may benefit. If anyone knows why that might happen from a logic perspective I'd also love to know!

  • Problem Description

    Keyboard input does not change variables if you are typing in a textbox. When inputting numbers, a value detecting integers should increase. It does so when you are not typing in a textbox, but does not do so when the user is typing in a textbox. I would expect that the system should still detect keyboard input to update the variable regardless of what Objects are also dependent on keyboard input.

    Attach a Capx

    https://www.dropbox.com/s/t4bvyxuxhjdth ... .capx?dl=0

    Description of Capx

    A text object is set to display the value of a variable that detects the number of times a user presses a number key on the keyboard. A tetbox is available to demonstrate that this value does not update as expects when typing numbers into its field.

    Steps to Reproduce Bug

      Step one: Press any number. Step two: Click in the text box Step three: Type more numbers Step four: Repeat steps pressing "backspace" which should reduce the variable value. This also does not work with the textbox object but works otherwise.

    Observed Result

    The variable does not update when using numbers or backspace in the textbox, but does when you aren't typing in the textbox field.

    Expected Result

    No matter what objects are looking for input, all actions and objects should be able to detect keyboard inputs and update the variables accordingly.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (UNK)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 10 Pro

    Construct 2 Version ID

    255 x64

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I. love. this. This is amazing! Thanks for working on it!

  • >

    > The function still isn't working (normal also does not appear to be defined) but now at least I can investigate what's going on there in the js file . Thanks again!

    >

    Well it worked, i checked. Can you share the project file again? I'll look into it.

    Oh wow, thank you for taking a look!!! I'm just getting to work but when I get home I'll PM you the file.

  • If you look in the browser console (always look in the console, you're working with javascript for Christ's sake), you'll see error message:

    > JS code: jstat.normal.cdf
    jstat is not defined
    [/code:w57miijg]
    
    And this is true. Thre's no "jstat" variable or object in your js script. No wonder, the result is "undefined" which is interpreted by Constrauct as zero. 
    
    But there's "jStat". So what you wanted to do is call "jStat.normal.cdf" function, right? You should use "Call JS function" action then. Like this:
    
    [img="http://valerypopoff.ru/temp/scirra-forum/jstat.png"]
    
    Don't use "Execute JS code" action unless it's absolutely necessary, because it uses "eval", which is slow.
    
    
    > Hey @valerypopoff, I'm excited to use your plugin but I'm having trouble integrating a few files into a project that I've got working in the command line otherwise. What I'm essentially trying to do is call a function from the jstat library to convert a z score to a percentage value. In my most recent attempt I'm only using  jstat and trying as many combinations of things as I can think of bit my return value is always 0. 
    > 
    > This is a small project I'm tinkering in to try and get a percentage value: 
    > [url=https://www.dropbox.com/s/qwy5nyslwp157ra/integrating%20js.capx?dl=0]https://www.dropbox.com/s/qwy5nyslwp157 ... .capx?dl=0[/url]
    > 
    > I don't share the file to have anything done *for* me, just to get info on how to get things moving. I'm not sure what I could be doing wrong here. Any help learning to effectively use this plugin is appreciated!
    > 
    

    Hey valerypopoff , thanks for getting back to me so quickly! argh lol, thwarted by case. Thank you for letting me know about the console; I was trying to see what was going on with the debugger - which I learned was not helpful lol. I'm only just learning about js and how to do these things so I appreciate the direction (total noob here).

    The function still isn't working (normal also does not appear to be defined) but now at least I can investigate what's going on there in the js file <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">. Thanks again!