User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 28

Thread: [Req]Custom User Code Object

  1. #1
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    [Req]Custom User Code Object

    I would like an object similar to the BASIC object, but instead with these features:

    General:
    -Runs simultaneously with the MMF2 application
    -Uses a simple C syntax with support for various variable types and expandable array support for them
    -Supports the ability for users to define thier own functions before the void main(void){}
    -Good error reporting with reason, explination, and line number + character position

    Specific unique features:
    -Users can call any function at all, and in MMF2 we can add conditions like "On any function called" "On specific function called" and have expressions like FunctionName$ (for any function), FunctionParam$(index [0 based]) and same for numbers, ParamVarType$(index [0 based]) which returns the kind of variable that was passed as a parameter, and NumParams(). All for the function that triggered the condition. It should be an immediate condition.

    -The code should pause automatically until in MMF2 you tell it to continue or you return a value. There should be a separate way to return entire arrays to a variable.

    -Option in properties & runtime check/not check user function calls for user defined functions (in case they made one with the same name as one in our code) to go with this there should also be a condition "User has defined function with name 'blah'"

    -Option to enable the use of #include "SomeFile.c"

    -Allow ability to create, change, get, and rename variables in the code at runtime

    -Allow editing of code at runtime (when code running is paused) & setting current line/stepping out of for loops and while loops


    I know this is a lot of stuff, but I won't actually start to need it for a few months, maybe more. I just want to request it now that that it's done/near done when I need it. I am sure it will benifit everyone to have this ability, as it will make things a lot easier when it comes to complete user modability with games and software. For example, this could be used so that you can easily update your game without users having to redownload the exe, you just make it download the latest code file from your webspace and it interprets that. This is quite a lot of features, and I may pay for it to be made if need be. (I just hope not :crazy I hope this extension isn't just way to hard to make.

    Examples of use:

    User's Code (completely random junk just to demonstrate some things)
    Code:
    void MyFunction(unsigned char RndNum = 34, string RndStr = "Some random string", bool OnRndOff){ //Functions can have a 'default value'
      unsigned int RndTimes = 0;                                                                     //if one is not given in the function
      while(RndTimes <= GetSomeNumber() && RndTimes != GetBadNumber()){                              //call. They don't have to have one,
        MakeSomethingHappen(RndNum, OnRndOff);                                                       //however, it just makes the code
        AddSomeEffects(RndStr);                                                                      //shorter sometimes.
      }
      return;
    }
    
    float RangeLimit(float InVal, float LowLim = -128, float HighLim = 127){
      float TempR = InVal;
      if(InVal < LowLim){
        TempR = LowLim;
      }
      else if(InVal > HighLim){
        TempR = HighLim;
      }
      return(TempR);
    }
    
    
    void Main(void){
      int Boog = -57;
      char array ConetP;
      bool RandomUnusedBoolean = (5 > 7 && 4 <= 4.01 || 96 > 100);
      while(true){
        DoSomethingCool();
        MyFunction(RangeLimit(Boog, -40, -2 + AnyNumber()));
        Boog++;
        ConetP[StrCmbVal("num", Boog)] = ObjPosX("Active 2"); //Arrays can have values named by a number or string
        if(Conet{["num5"] == 102){                            //so that there are easier to identify array values
          DisplayRandomPointlessTextMessage("Yay you win!");
        }
    /*  DeleteRandomObject();
        CreateRandomObject(RandPos(0), RandPos(1)); */
      }
    }
    And then the MMF2 code would look like this:
    -Start of frame: Load user code from text (or file)
    -User code is loaded: Start running code
    -Function "GetSomeNumber" is called: return number Rand(1000) as type "unsigned short" //There is also one for returning a string (only one type of string variable) and some method of returing an entire array. Oh, and also some events for returning a true/false boolean value.
    -Function "GetBadNumber" is called: return number 666 as type "EVIL" //If you give it a variable type the extension doesn't recognize it should assume one based on a property that can also be changed at runtime.
    -Function "MakeSomethingHappen" is called & {compare two general values} NumParams() = 2 & Parameter 1 is true /* 1 is the second parameter, this condition is for booleans */: blah blah delete object FunctionParam(0), Return Void

    ... and ect for all the other functions that weren't defined in the user's code.



    So, to sum it all up, this extension would be a way to implement the ability for users of our applications to add more functionality than is provided, or make more dynamic levels with a level editor, or other things that could be quickly done with this extension (like mentioned above), if made.

    Conditions:
    -Any Function is called [immediate]
    -Function "name" is called [immediate]
    -Parameter # is true [negatable for false]
    -User Code is Loaded [negatable]
    -On Error [immediate] - Syntax in code or internal extension error
    -Code is Paused [negatable]
    -Code is Running [negatable]
    -Inside for loop [negatable]
    -Inside while loop [negatable]
    -End of User Code [immediate]
    -Non-User-Defined variable is called [immediate]
    -Function is waiting for return [negatable]
    -Variable "name" exists [negatable]
    -Variable "name" is undefined [negatable]
    -Variable is True [negatable] - for boolean variables
    -Variable is Global [negatable] - true if declared before void main(void){} or if declared anywhere else with the prefix global, eg "global unsigned short long SomeRandomVar = 7;"
    -Variable is an Array [negatable]

    Expressions:
    -FunctionName$() - for 'Any Function is called' or 'Function is waiting for return'
    -NumParams() - for current function selected by condition
    -FunctionParam$(0-based param ID) - for current function selected by condition
    -FunctionParam(0-based param ID) - for current function selected by condition
    -ParamVarType$(0-based param ID) - for current function selected by condition, returns the type of variable that is being passed as a parameter
    -ErrorString$() - for On Error
    -ErrorLine() - for On Error
    -ErrorChar() - for On Error
    -VariableType$("name") - returns the type of variable that the variable is defined as
    -VariableValue("name") - for numbers & booleans (returns 1 for true and 0 for false)
    -VariableValue$("name") - for strings & booleans (returns "true" for true and "false" for false and "undefined" if the variable is undefined)
    -VariableCount() - total number of currently defined variables
    -VariableName$(0-based index of a currently defined variable)
    - some expressions for array variables (??)
    -GetCode$() - returns all the user code that is loaded into the object currently

    Actions:
    -Load Code from File "path\name.c"
    -Load Code from Text "code"
    -Start Code
    -Stop Code
    -Pause Code
    -Unpause Code
    -Go to Line
    -Set ignore function calls of user functions on/off # [0 is off and 1 is on]
    -Get out of current for loop/while loop and move on to the next code
    -Get out of all for loops/while loops [both current and any parent loops, eg While(true){for(bool Always = true; Always; Always = true){while(true){}}} would exit all of those and move on]
    -Save entire code session to file (not needed, but would be really cool)
    -Load entire code session from file (again not needed but would be cool)
    -Function: Return number # as type "type"
    -Function: Return bool # [0 is false and 1 is true]
    -Function: Return string "return string"
    -Function: Return (void)
    -Non-User-Defined-Variable: return number # as type "type" *
    -Non-User-Defined-Variable: return bool # [0 is false and 1 is true] *
    -Non-User-Defined-Variable: return string "return string" *
    -Non-User-Defined-Variable: return undefined *
    -User Variable: set number variable "name" to # *
    -User Variable: set boolean variable "name" to # [0 is false and 1 is true] *
    -User Variable: set string variable "name" to "string" *
    -User Variable: set variable "name" as undefined *
    -*: also have similar actions for array variables

    Notes about Arrays - Arrays don't have to be implemented, but it'd be super cool of they were.
    -Define by "{variable type} array {variable name};" eg "string array MyStringArray;"
    -Assign values with identifiers as strings or numbers, eg MyStringArray["RandomString"] = "sjgfasuicftnr346tr8q27rwiehio"; or MyStringArray[-97] = "negative nintey-seven";
    -Grab values the same way
    -Via MMF2 handle arrays more in depth with the conditions, expresions, and actions. This way we can make functions available to the user to further interact with arrays.
    -Set one array from another array, eg "string array MyOtherArray = MyStringArray;"
    -Add values from one array into another, replacing values that may already exist, via MMF2.
    -Modifying every value in a number array with ++, --, +=, -=, *=, /=, and =, eg MyOtherArray = "same";
    -ect...



    I think that's all I can think of for now. This will definantly be a bit of a project. If you are confused about anything at all, please ask to I can clarify. I want to make sure everything is understood properly. After all, this extension will benifit us in many ways. Also please alert me if you cannot figure out what I mean if there are inconsistencies, things that aren't clear enough, or mistakes that you can't figure out what was originally meant.

    Super-ultra-mega-deluxe thanks,
    -LB
    Working as fast as I can on Fusion 3

  2. #2
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    I'm not sure I understand where you're going with this. XLua is already a viable bridge between MMF and almost limitless C Module capabilities. What then would this extension do that couldn't reasonably be done in XLua?

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    I'd have to agree with Retriever2. There's also the .NET object.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    that's it strictly for C? But btw its one of best described requests that I saw here on forums!

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    I'm trying to go for a simplistic C syntax, like just the basics of what people will understand. I have tried LUA and the .net extension (which I can't get to work without crashing) and so far I see a bit more complex structures that aren't really needed for something as simple as calling functions through MMF2 or user-made functions.
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    Err, we have an extension SDK if you want to code in C

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    How are my game users suppost to make an extension and have me rebuild my game just for thier level!? I want it so that they can add some simple code to thier level and change the game's gameplay slightly to fit thier level.
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    Then what's wrong with Lua? You're trying to tell me that Lua is overcomplicated compared to C?

    errr

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    Isn't Lua syntax even quite similar to C syntax?

  10. #10
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Req]Custom User Code Object

    There are marked differences between Lua and C. However, Lua is not a complex language by any stretch. This is the kind of stuff Lua was designed for.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Feature suggestion for Android object to allow for super-easy custom user input.
    By BrashMonkey in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 27th May 2013, 04:54 PM
  2. User Friendly Promo Code Links
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 18th April 2013, 06:23 PM
  3. User info and unique registration code.
    By allsmiles777 in forum Install Creator and Patch Maker
    Replies: 1
    Last Post: 11th February 2010, 04:50 PM
  4. User Registration Code Question...
    By Renatos in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 6th January 2010, 03:58 AM
  5. Asking user for info without requiring reg code
    By Graeme in forum Install Creator and Patch Maker
    Replies: 4
    Last Post: 20th March 2009, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •