deathangel1479's Recent Forum Activity

  • Thanks for reply, but for me it was actually about Constructs->AddStringParam with 'string', not about json.

    I know my english is not very well...

    Conversely, this will work for json, but construct dont accept:

    str('{"name"":"'&Reg_NameIN.Text&'","password":"'&SmartFoxServer.EncryptPassword(Reg_PassIN.Text)&'","mail":"'&Reg_MailIN.Text&'"}')

    Other example for same situation:

    str('He said:"Hello".')

    str("He said:\"Hello\".")

    This wont work in Construct. Is working in JavaScript. Would be nice if Construct accept this.

    Or do you mean something like:

    "{%22name%22%22:%22"&Reg_NameIN.Text&"%22,%22password%22:%22"&

    SmartFoxServer.EncryptPassword(Reg_PassIN.Text)&"%22,%22mail%22:%22"&Reg_MailIN.Text&"%22}"

    I think that's even worse.

  • I dont worked with ajax like this, but I would try it like one of these examples. Not tested!

    Problem with this examples, my Tools plugin is also very experimental.

    But I think there are other stable plugins for json... Search...

  • Oh I forgot to confirm.

    Yes, it works.

  • It would be nice to be able to use ' " ' and/or " \" " at "AddStringParam" and other.

    At moment i have to use for example:

    str("{'name':'"&Reg_NameIN.Text&"','password':'"&SmartFoxServer.EncryptPassword(Reg_PassIN.Text)&"','mail':'"&Reg_MailIN.Text&"'}")

    That's a little crazy to write.

    And in plugin I need to String.replace() ' with " to make a valid json.

    I also can String.replace() ' in construct directly, but that makes it not better...

    I think this also help for other things as json.

    Or did I miss other options?

  • I do not know whether there is already a Converter.

    But I created it for my project, so why not upload it.

    May be someone can use is, too.

    Download

    (.net 3.5 and C++ 2012 Redistributable needed)

    Single Layer File:

    (Construct default)

    Tiled2ConstructConverter converts the Tiled map JSON export to a Construct 2 map(run-length encoded).

    If you have added a tilemap object, with same tileimage like in Tiled, to Construct 2, you can go on like this:

    Tiled JSON export. (For example: "Map1.json")

    Load it in T2CC.

    Select/Deselect layers.

    Select "File per Layer" checkbox.

    Save it to your new Construct 2 json map files.

    It will create:

    Filename_layer*.json

    Filename_layer*.json

    Filename_layer*.json

    ...

    Import it in Construct 2.

    Create a sheet to load maps, for example:

    That was all, now your map will be loaded.

    Multi Layer File:

    (My default)

    Tiled2ConstructConverter converts the Tiled map JSON export to a Construct 2 map(run-length encoded).

    The only difference between my and Construct 2 JSON is, that my Map contains more than one layer.

    For this you need a addon that can handle JSON objects.

    If you have added a tilemap object, with same tileimage like in Tiled, to Construct 2, you can go on like this:

    Tiled JSON export. (For example: "Map1.json")

    Load it in T2CC.

    Select/Deselect layers.

    Save it to your new Construct 2 json map file.

    Import it in Construct 2.

    Assure you that you have same layer in Construct 2 like in Tiled.

    Create a sheet to load maps, for example:

    Tools is one addon to handle with Objects. (JSON)

    That was all, now your maps will be loaded.

    14.06.2015-12:06 New: "File per Layer" option

  • Depends on the situation.

    There are several ways.

    Can you do something with this samples ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This Addon is to handle easily with Dictionary and Arrays in every size.

    Its based on JSON, so in Construct this Objects are special strings.

    You also can use variables with handwritten JSON strings as objects. But dont forget the "".

    If you do something wrong, the returned objects can be null(-1) and if debug is on, you recive a message in browser console what happens.

    Plugin

    Behavior

    Access to the runtime persistent Object:

    SetPersistObject(path,value):

    You can insert Value to specific path, if path not exist it will create.

    "myPath,myPath2,...." , "TestValue"

    "myPath,myPath2,...." , "{}"

    You can also insert complete Dictionary(Json)/Array(Json) to a specific path.

    "myPath,myPath2,...." , MyStringObj

    You can create paths also as array.

    "myPath,myPath2" , "[]"

    "myPath,myPath2[],0" , "TestValue"

    DelPersistObject(path):

    You can del a Value/Dictionary/Array by specific path.

    "myPath,delThis"

    Del Array is same like Dictionary. NO [] needed in path.

    ExistInPersistObject(path):

    You can check if path exist.

    "myPath,myPath2"

    Check Array is same like Dictionary. NO [] needed in path.

    returns true/false

    GetPersistObject(path):

    You can get Value/Dictionary(Json)/Array(Json) from a specific path.

    "myPath,myPath2"

    Get Array is same like Dictionary. NO [] needed in path.

    returns Dictionary(Json)/Array(Json)/Value

    ClearPersistObject:

    This cleans all values in PersistObject.

    Access to the stored Object:

    LoadStoredObject:

    Load StoredObject from Storage and triggers OnStoredObjectLoaded if finished.

    OnStoredObjectLoaded:

    The StoredObject is loaded some ticks after "OnStartOfLayout", use this to have a startpoint with loaded StoredObject.

    IsStoredObjectLoaded:

    To check for example OnTick.

    returns true/false

    SetStoredObject(path,value):

    You can insert Value to specific path, if path not exist it will create.

    "myPath,myPath2,...." , "TestValue"

    "myPath,myPath2,...." , "{}"

    You can also insert complete Dictionary(Json)/Array(Json) to a specific path.

    "myPath,myPath2,...." , MyStringObj

    You can create paths also as array.

    "myPath,myPath2" , "[]"

    "myPath,myPath2[],0" , "TestValue"

    DelStoredObject(path):

    You can del a Value/Dictionary/Array by specific path.

    "myPath,delThis"

    Del Array is same like Dictionary. NO [] needed in path.

    ExistInStoredObject(path):

    You can check if path exist.

    "myPath,myPath2"

    Check Array is same like Dictionary. NO [] needed in path.

    returns true/false

    GetStoredObject(path):

    You can get Value/Dictionary(Json)/Array(Json) from a specific path.

    "myPath,myPath2"

    Get Array is same like Dictionary. NO [] needed in path.

    returns Dictionary(Json)/Array(Json)/Value

    ClearStoredObject:

    This cleans all values in StoredObject.

    Working with a temporary Object:

    SetToObject(object,path,value):

    You can insert Dictionary(Json)/Array(Json)/Value to specific path, if path not exist it will create, but here you need to input the target Dictionary(Json)/Array(Json).

    "{}" , "myPath,myPath2,..." , "TestValue"

    myLocalString , "myPath,myPath2,..." , "TestObject" Dictionary must be json, min. {} | []

    anyDictionarytring , "myPath,myPath2,..." , myGlobalString

    returns the changed Dictionary(Json)/Array(Json).

    DelFromObject(object,path):

    You can del a Dictionary/Array/Value by specific path of target Dictionary(Json)/Array(Json).

    returns the changed Dictionary(Json)/Array(Json).

    ExistInObject(object,path):

    You can if a specific path exist.

    returns true/false

    GetFromObject(object,path):

    You can get Dictionary(Json)/Array(Json)/Value from a specific path of target Dictionary(Json)/Array(Json).

    returns the Dictionary(Json)/Array(Json)/Value.

    The Behavior:

    Its mostly like the persist object, but it depends on the object.

    Other stuff:

    ForEach in actions:

    ForEach(handler,Dictionary) Value|Dictionary(Json)|Array(Json) in target Dictionary(Json)/Array(Json).

    It trigger Foreach in conditions.

    ForEach in conditions:

    You can filter by ForEachHandler.

    Get current Key by ForEachKey.

    Get current Value by ForEachValue.

    IsNumber(Value):

    returns true/false

    IsString(Value):

    returns true/false

    IsDictionary(Value):

    returns true/false

    IsArray(Value):

    returns true/false

    IsBoolean(Value):

    returns true/false

    IsUndefined(Value):

    returns true/false

    Debug:

    It show debug message in browser console.

    It view Dictonary/Array as formatet Json.

    It is also in construct, but this is with little extensions.

    String:

    sprintf(string[,var]):

    It formats a string with additional vars(max 26).

    myvar = funny

    sprintf("Hello {0} {1} World.","my",myvar)

    ->Hello my funny World.

    Array:

    sort(array)Returns the sorted array.

    reverse(array) Returns the reversed array.

    push(array) Returns the array with the added element.

    getFirst(array) Returns the first element.

    getLast(array) Returns the last element.

    lastIndexOf(array,value) Search the array for an element and returns its position.

    length(array) Returns the number of elements in an array.

    All hard to explain for me, but easy and flexible to use, if you understand once.

    Examples:

    About feedback I would be very happy.

    04.06.2015 BugFix: ForEach was working not correctly

    10.06.2015 New: sprintf

    19.06.2015 New: ExistInObject, ExistInSaveObject

    21.06.2015 New: Name changed, StoredObject, value check

    22.06.2015 BugFix: Add LoadStoredObject, because autoload dont work correctly anytime. Switched autoload to settings.

    24.06.2015 New: Array expressions

    12.03.2016 Remove: AutoLoadStorage option

    12.03.2016 Add: LogLevel option

    12.03.2016 BugFix: Behavior Logging

    13.03.2016 Add: Inspector Values

  • I build it for my current Project, maybe someone else can use it.

    I build it to create a language file with a program and use it easily in construct.

    JLoc consists of 3 parts:

    Windows Application: To create language file. (.net 3.5 and C++ 2012 Redistributable needed)

    Plugin: Change language and get values from languages.

    Behavior: Can added to text, buttons to have a automaticly language change. (needs plugin)

    Download

    Description:

    The Application:

    Here you can create your language file.

    You can create a new project.

    Save your project to a project file.

    Load your projects from project files.

    You can add languages, they stay in the top container.

    Uncheck languages has only effect to the view of the table, not for the project itself or export.

    You can add groups, they stay in left container.

    Check a group will load it to table.

    You can add diverse keys to each group, for each group seperately.

    Now you can add values(words/sentences) to the cells, sortet by key and language.

    ATTENTION:

    If you write something in a cell, and then save or export to file, may be this last cell is not saved.

    To avoid this select a other cell before.

    You can export your project to a Javascript file:

    This file you need to put in the jloc plugin folder, it need to named "jloc.js".

    A emty file is currently in this folder.

    Tip: Use the hotkeys(F1-10), to work faster.

    The plugin:

    Not complex.

    Set language at start with location short for example: "de-DE"

    You can use the event On Language Changed.

    Now you can get values by group,key.

    You can get current language.

    There are some advanced outputs, but for this you need a plugin to handle with objects. (Plugin)

    You can get languages array.

    You can get groups array.

    You can get keys array of a group.

    The behavior: (needs active plugin object)

    You need to select the type, button or text, what it is on.

    You set the group and key in properties.

    Now if you set the language in plugin, it changes itself the value.

    This is good for Buttons where is everytime the same text on, but in other languages.

    If you add instances by code, you have a Action to set the group + key there.

    I think that's it for now.

    About feedback I would be very happy.

    03.06.2015-6:31 BugFix: Behavior not working correct if use SetProperty/ies

  • Possibly cache?

    CTRL+F5 || Clear browser cache

  • Sorry for the stupid question.

    I know that, where the green line is, means same instance, but what is with the red lines, also or not?

  • As a further possibility:

    I save all consistent values to an Object from my "Tools" plugin.

    I have modyfied it, but based on:

    http://stackoverflow.com/questions/6491 ... string-key

    and json strings.

    So you can save all vars in one string whereever you want and load them as easy.

  • No, it just means you need to access properties with foo["bar"] instead of foo.bar.

    Thanks, i will try it.

    I should have stayed with C.

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

    So much for rewrite.... But...

    Everything is working fine now.

    Thank you so much!

deathangel1479's avatar

deathangel1479

Member since 16 Feb, 2015

None one is following deathangel1479 yet!

Trophy Case

  • 9-Year Club

Progress

9/44
How to earn trophies