Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Looking For Advice: Limited In-Application Scripting

Looking For Advice: Limited In-Application Scripting

Scheduled Pinned Locked Moved Design and Architecture
csharpgame-devtoolsdiscussion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kennebel
    wrote on last edited by
    #1

    I have seen the projects that have brought run time scripting in to C# and the like. They seem to be very powerful projects, and that is great. For the application I have in mind, I'd like to have a more domain specific, limited scripting support available. Basically restrict the ability to call any method or object that is in the application scope. I'd like to create a game that has objects with behavior that is "scriptable". The two obvious ways in my head are: A.) Create a graphical interface that allows users to drag and drop elements (if blocks, while blocks, etc.); B.) Allow the user to type in a syntax. (or really both, where A simply creates B) In order to accomplish B, it seems like I'll need to learn something like ANTLR in order to create a syntax that is completely under control. I am looking for some thoughts or advice on having an in-game script ability that does not access the entire namespace, while not having to write a syntax parser from scratch if possible. :)

    Jeremy A. Cunningham Kennebel

    L L 2 Replies Last reply
    0
    • K Kennebel

      I have seen the projects that have brought run time scripting in to C# and the like. They seem to be very powerful projects, and that is great. For the application I have in mind, I'd like to have a more domain specific, limited scripting support available. Basically restrict the ability to call any method or object that is in the application scope. I'd like to create a game that has objects with behavior that is "scriptable". The two obvious ways in my head are: A.) Create a graphical interface that allows users to drag and drop elements (if blocks, while blocks, etc.); B.) Allow the user to type in a syntax. (or really both, where A simply creates B) In order to accomplish B, it seems like I'll need to learn something like ANTLR in order to create a syntax that is completely under control. I am looking for some thoughts or advice on having an in-game script ability that does not access the entire namespace, while not having to write a syntax parser from scratch if possible. :)

      Jeremy A. Cunningham Kennebel

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      It all depends on the kind of commands/script statements you want to support. Do you need variables? do you need different types, like numbers and strings? do you need program flow, like for loops? etc. Depending on the answers, a parser or parser generator might be right; or a simple lexer plus a switch statement might be all that is needed. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      I only read formatted code with indentation, so please use PRE tags for code snippets.


      I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).


      K 1 Reply Last reply
      0
      • L Luc Pattyn

        It all depends on the kind of commands/script statements you want to support. Do you need variables? do you need different types, like numbers and strings? do you need program flow, like for loops? etc. Depending on the answers, a parser or parser generator might be right; or a simple lexer plus a switch statement might be all that is needed. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        I only read formatted code with indentation, so please use PRE tags for code snippets.


        I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).


        K Offline
        K Offline
        Kennebel
        wrote on last edited by
        #3

        Thank you for responding. . Variables, yes . Types, yes (simple ones like int, float, string) . Program flow would probably facilitate more advanced behavior . An OOP option, no (to keep things simple, i don't plan on bringing objects in to the scripting portion of things, method just calls and basic program flow) So it sounds like i'll need something pseudo-advanced, and will probably have to find, test, and learn a parser generator then. Now I see why this isn't part of more applications. :)

        L 1 Reply Last reply
        0
        • K Kennebel

          Thank you for responding. . Variables, yes . Types, yes (simple ones like int, float, string) . Program flow would probably facilitate more advanced behavior . An OOP option, no (to keep things simple, i don't plan on bringing objects in to the scripting portion of things, method just calls and basic program flow) So it sounds like i'll need something pseudo-advanced, and will probably have to find, test, and learn a parser generator then. Now I see why this isn't part of more applications. :)

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          it seems you need a parser; you may write your own, get one some where, or use a parser generator to generate one. The coice is yours, writing one yourself keeps you from studying the features, bugs, and shortcomings of existing ones; and using an existing one, or a generator, may keep you away from the nitty-gritty details involved. As I said, the choice is yours. FWIW: I create my own parser when I need one. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


          I only read formatted code with indentation, so please use PRE tags for code snippets.


          I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).


          1 Reply Last reply
          0
          • K Kennebel

            I have seen the projects that have brought run time scripting in to C# and the like. They seem to be very powerful projects, and that is great. For the application I have in mind, I'd like to have a more domain specific, limited scripting support available. Basically restrict the ability to call any method or object that is in the application scope. I'd like to create a game that has objects with behavior that is "scriptable". The two obvious ways in my head are: A.) Create a graphical interface that allows users to drag and drop elements (if blocks, while blocks, etc.); B.) Allow the user to type in a syntax. (or really both, where A simply creates B) In order to accomplish B, it seems like I'll need to learn something like ANTLR in order to create a syntax that is completely under control. I am looking for some thoughts or advice on having an in-game script ability that does not access the entire namespace, while not having to write a syntax parser from scratch if possible. :)

            Jeremy A. Cunningham Kennebel

            L Offline
            L Offline
            larryp7639
            wrote on last edited by
            #5

            Hi ! I've just visited this forum. Happy to get acquainted with you. Thanks. __________________ Watch Splice Online Free

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups