Dasat's Forum Posts

  • Noncentz705", please more light on this, i got this error log in my console. Thanks

    Error executing Javascript:

    ReferenceError {stack: (...), message: "require is not defined"}

    message: "require is not defined"

    stack: (...)

    get stack: function () { [native code] }

    set stack: function () { [native code] }

    __proto__: Error

    Browser_plugin.js:609

    0

    Create two bat files :

    File1.bat

    start C:\Users\%username%\Desktop\project_folder\File2.bat

    rem Notice I didn't use %cd%\File2.bat because preview runs from a temp folder;

    File2.bat

    echo CMD STARTED

    Now in your project back in construct

    - add the browser plugin to your project

    - create a variable named cd and set it's value to the path of your first bat file with \\ 's

    To launch cmd Browser Execute Javascript :

    "require('child_process').execFile('"&cd&"');"

    With that said there's probably a way easier way to do this

  • bump

  • Ashley, is it possible to have a textbox area such that, i can scroll left and right to view more of the texts, we could be able to set a limit to how large the horizontal or right scroll could be?

    Dasat

    I am not sure. You might post this request to Ashley.

  • share a capx

  • rexrainbow, i just tried installing this plug in and i get the error, ---------------------------

    HTML5 exporter

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

    Unable to load plugin in 'F:\Installations\Construct 2\exporters\html5\plugins\rex_boundary\': Found 'GetPluginSettings' global, but it is not a function

    This plugin will not be available in the editor.

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

    OK

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

    Any help

    Behavior: scrolling

    Update: 2013/06/29

    Note: this behavior is for text plugin or official sprite font plugin, NOT for sprite.

    This behavior try to make official text object become a "scrollable" text object by maintain a content buffer in plugin.

    Demo

    Capx - scroll next line

    Capx - scroll bar

    There are two sample capx files. One is scrolled by keyboard, the other is scrolled by scrollbar.

    Usage:

    Set content

    - action: Set content

    - action: Append content

    Scrolling

    - action: Scroll by percentage (combine with scrollbar)

    - action: Scroll to next line/Scroll to previous line

    - action: Scroll to next page/Scroll to previous page

    Get content

    - expression: Textrexrainbow2013-06-29 16:38:39

  • rexrainbow, is it possible to have a textbox area such that, i can scroll left and right to view more of the texts, we could be able to set a limit to how large the horizontal or right scroll could be?

    Kyatric

    Please remove the link of this behavior, since it had been supported in text box plugin officially.

  • i'm trying to create tables on start of a layout, with text boxes for use to input some values, its such that my table is going to be dynamic, it depends on somethings the user must i've input before, such that now i might have to create a 5x8 table(row x column) and later, 20 x10. Also, because of how the size would vary, i might need to be able to scroll the layout vertically and horizontally, incase number of boxes created spills over the layout size. Any help on this?

  • daehawk, what would be your advice, i'm trying to do something like this, only that my table is going to be dynamic, it depends on somethings the user must i've input before, such that now i might have t ocreat a 5x8 table and later, 20 x10. Also, because of how the size would vary, i might need to be able to scroll the layout vertically and horizontally, incase number of boxes created spills over the layout size. Any help on this?

    I don't see why C2 couldn't do it. Now doing it with only drag and drop all the stuff you need that'd be no. But also C2 you don't write the code yourself. You use Events that mimic coding essentially. So all you have to do is work out your Events and the Layouts. They have a TextBox Object that you can use to allow people to type into the box. Arrange them into 8x8 on the Layout field if you want. And then have Text elements that display words for them to type into. Can save the words into an 8x8 Array for the quizzes to read from for answers and for on the setting up when they fill them out.

    Validation you just make an event that checks the Array with the Entry. Then have it display Correct or play the sound.

    You can have all the controls you want in the thing. Like I just posted a Battle system starting basics for an RPG I'm making and it allows inputs from Keyboard, Mouse, Gamepad, and Touch.

    Do tutorials exist I'm not sure on that one because I didn't look. I'm not much into making education games. But visit the https://www.scirra.com/tutorials/top and look around there's a lot of them that can teach you things to do and methods to do them.

  • I'm trying to get an even triggered when a particular item in a list is right-clicked, such as delete or another list of possible options to be displayed on rightclick on an item in my list box. but right click on the listbox as a whole always bring up this list of back, forward, reload, print etc. Anyway around this?

  • spacedoubt, thanks, i guess it should be .itemcount not .count. Thanks once again

    Make a For Loop:

    For "" from 0 to list.count + 1 (i'm not sure why, but I had to add +1 to get the last index)

    then, I'm not sure what you're doing with it, but I was just putting them into some text like this:

    append List.SelectedTextAt(loopindex)

  • I'm using list box and multiselect is on, how do i get all the indices of the selected items as this is more than 1, .selected count only returns the number of items selected and not the index

  • then create then in separate variables i believe

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i don't get you, do you want to save the individual scores for each level separately and make it available in the next level or what? Also, do your levels run in different layouts.

    Your choices are to store in array, webstorage or a simple global variable.

    Better still explain your question very well.

  • tomsstudio, thanks a lot

    > I'm trying to set a list and another text box from a dictionary by using the st from json action with the expression dictionary.asjson but none of them seems to respond

    >

    The way your using .asjson wont work.

    When you try and load a text box with .asjson, the text box is looking for the text box format json. As you are trying to load a 'dictionary json format", the text box will not recognize it.

    If you want to insert raw dictionary data, then go textbox.settext > "" & dictionary.asjson.

    If you want to get sequential values from the dictionary, then i highly suggest using an array.

    But it can be done with dictionary.

    One way is to use numbered keys, i.e. key: "0"="bob" key: "1" = "sam" etc etc.

    Now we create a for loop.

    For i = 0 to 9

    Textbox.appendtext "" & dictionary.get(system.loopindex("i") & "") & newline // Here we convert the numbered loopindex into a string so we can address the dictionary key to get the data.

    I hope this helps.

  • Yann, thanks a lot, I'm already making progress with the project, i really appreciate you.

    Dasat

    Ah yeah sorry I forgot to launch dropbox, now it's updated

    And for your foreach, first, remember to not do it every tick, that's the reason why it wasn't stopping. You can nest it under the start of layout event for it to just run once.

    Now as far as foreach goes, you're using it correctly. The only thing that you should be aware of, it that using a foreach on an array could lead to weird results, 'cause the foreach won't insure that you'll loop through the indices in the proper order. When you use foreach on an array, the array is considered as an object and the number as fields. As if you had:

    > {
       "0": "first",
       "1": "second",
       "2": "third",
       "3": "fourth"
    }
    [/code:3czwctra]
    
    usually with arrays I just loop through the indices
    So your capx would look like this:
    [code:3czwctra]+ System: repeat JSON.Size(0)
        -> JSON: set Current Path to roottmu@loopindex
        + JSON: foreach property at current@
          -> Text: Append JSON.CurrentKey&newline  // newline makes it easier to read[/code:3czwctra]
    
    Now  your other problem is that you're printing the keys using JSON.CurrentKey, if you want the content, you need to use JSON.CurrentValue
    In your case, the value for "friends" is an array, so you need to detect that, you can either use the Is Array condition or check if CurrentKey = "friends".
    I would personally check for Array 'cause this way you can change the name of the field if you need it.
    
    Anyway, it should look something like that [url]https://dl.dropboxusercontent.com/u/23551572/C2/JSONDasat-foreach.capx[/url]