Code support

0 favourites
From the Asset Store
5 levels with simple coding Source-code (.c3p) + HTML5 Exported
  • There are still some benefits for pure text code. For example , string (text) could be transfered from network or loaded from external file.

    Official browser object already has "Execute Javascript" action , to run code from string, and official function object could be ran by text like

    c2_callFunction("name", ["param1", "param2"]);[/code:20st8io4]
    
    I also had made some plugins which could 
    [ul]
    	[li]run official function from CSV string, or[/li]
    	[li]create a JSON string to save the function call, or[/li]
    	[li]run lua script.[/li]
    [/ul]
    These are not to replace the event sheet, just embed text code which only has pure logic inside, to be a part of event system.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • -1 for me. There will be biases depending on the language(s) you've come from and nobody will agree on any of it. For instance I already don't like the format you have described. Where's my curly braces?

    ...

    Lastly, you have some typo's (which is a lot harder to do in the current system).

    Python-like syntax was taken as example because it's quite clear. I personally don't care that much, as I'm writing on JavaScript, C#, PowerShell and Python a lot.

    I'm also like curly braces

    As for typos — you can make typo in expression text box now. System, which checks your expressions already implemented in C2.

    anpur

    You had missed something in this too simple example-

    1. how to get the object reference (i.e. object name + SOL)? It might be more then 10 or 100 object types in the project.

    2. how to get the function name (i.e. action name) or member name (i.e. expression)? Each kind of object type might has a lot of members (functions). And the input parameters of these functions...

    First of all, this is C2 whom hides difference between classes and instances from user entirely. Which makes it a bit vague in some cases and fully context dependent.

    In code, from other side, it can be made really emphasized and clean.

    About function names — you have exactly same situation, when you're constructing expression anywhere in C2. This is why you have a nice, semi transparent window near every expression text box, here is its example from one of tutorials: [attachment=0:2tapcdhu][/attachment:2tapcdhu]

    -----

    Again, I'm not proposing to remove or even affect event system or graphical event editor.

    I'm just saying, that:

    1. Almost all features required, like syntax highlight, object members explorer window, syntax and members verification already implemented and working in C2.

    2. Code block can be used side by side near other events

    3. Text has more expression power and also easier to manage.

    So, we only need to think through some decent UI and some additional keywords, like loops, conditional expressions and block organization.

    P.S. — this all is just thinking out loud, as Ashley said that there are no plans to add something like this to C3.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)