Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Odd functions in Halo Script.

  1. #1
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Odd functions in Halo Script.

    It has come to my attention that Halo Script has some odd attributes to it that no one to my knowledge explores/takes advantage of.

    Let's take a look at the Halo Scripting Bible

    The main thing I would like to point out is the top part of HSB:

    ' quote
    The quote character is used to block LISP evaluation. When LISP evaluates a quoted thing the quote is "stripped off" and the expression following the quote is returnd.

    ? (+ 3 4) ; LISP evalutates the list
    7

    ? '(+ 3 4) ; quote blocks evaluation
    (+ 3 4) ; the quote is stripped off

    ? PI ; LISP evalutates the symbol
    3.141592653589793
    ? ''PI ; the first quote is stripped off
    'PI ; leaving the second quote intact

    : colon
    The colon introduces a special type of symbol called a keyword. A keyword is self-evaluating, that is, it is constant data.

    ? :woof-woof!
    :WOOF-WOOF!

    # cross
    The cross character is used to introduce a special interpretation of the subsequent expression. Here are several examples:

    #xFF00
    Introduces digits in hexidecimal radix.
    #(1 2 3)
    Creates a vector (array) from a list of elements.
    #'list
    Returns the function associated with the symbol list. If no function is associated with the symbol LISP signals an error.
    #|
    Introduces a comment that lasts more than one line. A #| must be balanced by a terminating |#.
    One of the first things I don't get, are the practical uses of the ' character in Halo Script.

    Then, I think there's something that's even more useful but I just don't understand its uses are, is the colon.

    and Third, something that I don't understand is how to use an array in LISP as HSB defines:

    #(1 2 3) - wait, what?

    like, could I use an array of script functions so I could say

    array = #(scriptFunct1 scriptFunct2 scriptFunct3)

    then in my script:

    (begin_random array) ?

    Or should I not even be looking at the Halo Script Bible?
    Reply With Quote

  2. #2

    Re: Odd functions in Halo Script.

    HSC = LISP?
    Mind = blown
    (I've heard of LISP all over the place, but I never actually knew what it looked like. Now I know)

    er, on topic, I am intrigued by this post. I may have to play around with CE a bit, to see if there really is a straight LISP interpreter in the engine, or if they built their own interpreter with a syntax based on, but not necessarily inclusive of the features present in, LISP.
    Reply With Quote

  3. #3
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: Odd functions in Halo Script.

    The problem I'm having is how do I utilize those functions as HSB says?

    E: To make this a more useful post, it is more than likely that the devs probably stripped their LISP interpreter just so they could use the Syntax in Halo Script. Programmers are lazy ya know.
    Last edited by Dwood; October 23rd, 2009 at 07:45 PM.
    Reply With Quote

  4. #4
    Sarcastic Bitch
    Join Date
    Sep 2006
    Posts
    811

    Re: Odd functions in Halo Script.

    Quote Originally Posted by Dwood View Post
    (script continuous testifplayer1
    (if (= playerishere 0)
    (begin
    (hud_set_help_text test)
    (show_hud_help_text 0)
    )
    )
    )

    -That's what a basic thing in Halo Script looks like.
    Rob knows how to script....remember his Bridge CE project?
    Reply With Quote

  5. #5
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: Odd functions in Halo Script.

    Quote Originally Posted by ShadowSpartan View Post
    Rob knows how to script....remember his Bridge CE project?
    No? lol.

    I'll just remove that part of my post.
    Reply With Quote

  6. #6
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: Odd functions in Halo Script.

    double post.

    I also noticed that statics can only be called AFTER they are created therefore startup scripts go AFTER static scripts if you call them in the startups even though startup scripts should always be first.

    Reply With Quote

  7. #7
    The Prophet Brohammed
    Join Date
    Feb 2008
    Location
    Picayune, MS
    Posts
    121

    Re: Odd functions in Halo Script.

    Quote Originally Posted by Dwood View Post
    double post.

    I also noticed that statics can only be called AFTER they are created therefore startup scripts go AFTER static scripts if you call them in the startups even though startup scripts should always be first.

    Same for dormant scripts, this is the case in almost(?) every programming language, because they're usually sequential, you couldn't call on something that hasn't been defined yet.
    Reply With Quote

  8. #8
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,189

    Re: Odd functions in Halo Script.

    Quote Originally Posted by S3anyBoy View Post
    Same for dormant scripts, this is the case in almost(?) every programming language, because they're usually sequential, you couldn't call on something that hasn't been defined yet.
    Yep. Does anyone know the types of static scripts that can be used? The only one I'm aware of is "void" so it'd look like (script static "void" laz0rz
    Reply With Quote

  9. #9
    Codesaurus Skarma's Avatar
    Join Date
    Apr 2009
    Location
    Columbus, OH
    Posts
    227

    Re: Odd functions in Halo Script.

    Well, logically any variable type can be static. Static should be avoided though, imo I don't think it is even very useful. It's basically a global variable that is limited to the scope of the function or source file it is declared in. I think this makes things more confusing and with the small scripts that I see written for Halo, there really is no solid point to using it. I say stick with dynamic allocation
    Reply With Quote

  10. #10
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,130

    Re: Odd functions in Halo Script.

    I should note that I just c&p that text from a LISP reference (it was a leaked document so I never got around to culling the info that didn't apply here). Halo Script, while it uses a LISP-like grammar, it itself is not LISP nor does it use a LISP parser. Bungie programmed their own parser/compiler for HS.
    Reply With Quote

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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
  •