Results 1 to 10 of 188

Thread: I bring thee not simple rearrangements, but a whole new world of possibilities,,,

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12

    Re: I bring thee not simple rearrangements, but a whole new world of possibilities,,,

    And back on topic...

    After quite a bit of debugging I've gotten the scripting engine running with basic functions.

    Test Script:
    Code:
    (var boolean test_boolean false)
    (var boolean test_boolean2 true)
    (var int test_int 1)
    (var int test_int2 125)
    (var int test_int3 -10020)
    
    (script all dormant "test"
        (if test_boolean 
            (begin 
                (log "test boolean is true")
            )
            (begin 
                (log "test boolean is false")
            )
        )
        (if (== test_int2 125)
            (begin 
                (log "equals")
            )
            (begin 
                (log "not equals")
            )
        )
        (log (<= 1 4))
    )
    Interpreter output:
    Code:
    - (script all dormant "test" <4>  <10>  <12> )
    -- Call:If ID#4 Src: (if <-1> <1> <3>)
    --- Call:Variable ID#-1 Src: test_boolean
    --- Call:Begin ID#1 Src: (begin <0>)
    ---- Call:Log ID#0 Src: (log <-1>)
    ----- Call:Constant ID#-1 Src: test boolean is true
    --- Call:Begin ID#3 Src: (begin <2>)
    ---- Call:Log ID#2 Src: (log <-1>)
    ----- Call:Constant ID#-1 Src: test boolean is false
    -- Call:If ID#10 Src: (if <5> <7> <9>)
    --- Call:Equals ID#5 Src: (== <-1> <-2>)
    ---- Call:Variable ID#-1 Src: test_int2
    ---- Call:Constant ID#-2 Src: 125
    --- Call:Begin ID#7 Src: (begin <6>)
    ---- Call:Log ID#6 Src: (log <-1>)
    ----- Call:Constant ID#-1 Src: equals
    --- Call:Begin ID#9 Src: (begin <8>)
    ---- Call:Log ID#8 Src: (log <-1>)
    ----- Call:Constant ID#-1 Src: not equals
    -- Call:Log ID#12 Src: (log <11>)
    --- Call:Lequal ID#11 Src: (<= <-1> <-2>)
    ---- Call:Constant ID#-1 Src: 1
    ---- Call:Constant ID#-2 Src: 4
    And when I enter wake test into the console I get this in the log:
    Code:
    test boolean is false
    equals
    true
    If you'll notice the interpreter output is quite informative now

    And if you look closely you might find some built in casting. Mmmmmm girllllll. Look at that casting.

    Writing custom functions is pretty easy to do. Though writing functions that stop the scripting language is a bit complex. (stuff like sleep and begin). I learned a lot about interpreting code like this though so next time it'll be better

    In the end it's all functional so yay.

    What kind of functions would you guys like to see. Stuff you wish halo had basically.

    edit-
    @Skyline:
    Scala isn't any faster than java from what I've read. It's also not as widely used as java. I don't see any reason to switch unless I run into some major problem that I can't do with java (spoilers: I won't).
    Last edited by Not Inferno; July 2nd, 2013 at 02:13 AM.
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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