User Tag List

Results 1 to 7 of 7

Thread: I'm new to scripting...

  1. #1
    Octorok
    Join Date
    Sep 2006
    Age
    34
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,056
    Level
    11
    vBActivity - Bars
    Lv. Percent
    21.05%

    Question I'm new to scripting...

    I want to learn the basics of Zscript, but I have NO experience whatsoever and I have NO IDEA how this works or where to start. Any help would be appreciated.

  2. #2
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,579
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.36%
    Achievements It's over 9000!

    Re: I'm new to scripting...

    I'm somewhat less new than you are, but I'm pretty much in the same boat. I've already been through the difficult part. This post should give you a leg up on the game though. Read all four threads I link to in there. Good luck man. :) Check back here regularly for some n00b to n00b counseling.

  3. #3
    Octorok
    Join Date
    Sep 2006
    Age
    34
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,056
    Level
    11
    vBActivity - Bars
    Lv. Percent
    21.05%

    Re: I'm new to scripting...

    Sorry, but that doesn't help much. I have no experience in this at all, so what you and other people are saying in those threads is totally meaningless to me. I don't understand a word you're saying in there.

  4. #4
    Wizrobe Petoe's Avatar
    Join Date
    Dec 2001
    Location
    Middle of nowhere (Finland)
    Age
    38
    Posts
    2,005
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,894
    Level
    19
    vBActivity - Bars
    Lv. Percent
    87.93%

    Re: I'm new to scripting...

    Yeah, not very helpful Josh. There should be a step by step guides, examples etc so that a monkey like me could understand something. But isn't there a script guide in the making? By koopa? That would probably help a lot because I have no experience and no idea of programming. And I am not the only one. It is really frustrating to know that there's this new revolutionary feature but you don't know how to use it. Oh well... maybe some time during this century a guide is released (sorry, I am so impatient! :p )
    --------------------
    "GET a stable version, THEN add more with the builds, DON'T just keep adding bloat to something that doesn't work already.
    Has common sense just left the building, or what?" -Freedom

  5. #5
    Octorok Imprisoned's Avatar
    Join Date
    Oct 2006
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,620
    Level
    13
    vBActivity - Bars
    Lv. Percent
    53.47%

    Re: I'm new to scripting...

    HOLY COW! I can't understand a word from the threads Read, All, These, or Threads.

    I would like to know how to script too, but goddammit, those aren't working.

  6. #6
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,579
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.36%
    Achievements It's over 9000!

    Re: I'm new to scripting...

    lol yeah, yeah, I can understand how this might be confusing. It was just as confusing for me, believe me. It still is.

    IMHO, the first step is to be able to -read- code though. Once you can read it successfully and know what's happening, you can pretty much leach off of any script that you see to get the necessary phrases for it and such.

    Here's a piece of code that Saffith was kind enough to correct for me in one of those threads I linked to. I'll post the variables in red.

    Code:
    ffc script invulnerability_script_001
    {
       void run()
       {
          int storedHP = Link->HP;
    
          while(true)
          {
             Link->HP = storedHP;
             Waitframe();
          }
       }
    }
    Now, you all already know that anything after a // or between /* and */is a comment, right? Whatever content is within those /* and */ or after the // on the same line as the // will be completely ignored by the program. Hence, I'll exhibit this in the explanations of the code.

    ffc script invulnerability_script_001 // This line defines this code as being an FF Script. (Hence the ffc script) part. You don't really need to know why you have to type ffc script, but only that you DO HAVE TO TYPE IT. The part in red, "invulne..." etc, is the part -I- defined as the name of the script.

    void run() // Still not 100% clear on this line myself, but it's a line which makes the script run. Just like the above ffc script, put it in after a curly bracket anyway. Don't forget to put in a closing curly bracket (}) at the end of your code as soon as you create the opening brackey or you might forget to do it.

    int storedHP = Link->HP; //First of all, remember to put a semicolon ( ; ) at the end of each line that doesn't open up into another series of content involving curly brackets. (I.e. an "if statement" or "While loop" probably won't need curly braces, (Brackets, whatever.) but a line like the above would, as it's solitary.) So this line is essentially setting the variable (We define its name and type.) "storedHP" to be an integer. (int, to its left. "int storedHP".) to be equal to Link's HP. Link-> is the reference to Link himself, or any attribute of his which will follow, and HP is the hit points for the particular NPC that comes before it. Thus, Link->HP is Link's HP. You can define a variable (Create it for use in the script.) this way, by defining it on the same line that it's being used to store something if you phrase it like it's been done here, by saying int yourvariable ... so now you've got a variable named yourvariable that's a type int. (An "integer" (int) is a data type that's basically whole numbers, negative or positive. 5, 2835, -523, 0, etc. A "float" is a decimal. -.0523, 2.593, 523.1, etc.

    while(true) // This is a while loop. It checks for a certain condition, and if that condition is true, it executes everything within the curly braces that follow it. (See the line directly below this for the accompanying opening brace.)
    {
    Link->HP = storedHP; // This line is setting Link's HP to our variable, storedHP. Note the semicolon at the end of the line, and notice how there was no semicolon at the end of while(true). So this line is basically setting Link's HP to whatever the value of storedHP is over and over again, because the while loop is continually found to be true, as the thing it's checking for isn't really a variable; it's just an operation. It was conducted successfully, so it may as well go through with the while loop, as there was nothing to really check for. It's like saying "If today is a day, do this." ... ... so it does. [/b][/font]
    Waitframe(); // ... Yeah. This is a VERY Important command. :p It allows all of the other activities ZC's player does to cycle through while this code executes. If you didn't have it, ZC would probably freeze as it entered an infinite loop without giving ZC any chance to do anything else. Alright, it then ends with a closing curly brace, completing the while loop. Naturally, since it's a while loop, it'll keep executing the contents of the while loop while the condition is true. It's still true, so it'll keep executing.

    Everything else is just a bunch of closing curly braces.

  7. #7
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,433
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.08%

    Re: I'm new to scripting...

    Quote Originally Posted by ShadowTiger
    Now, you all already know that anything after a // or between /* and */is a comment, right? Whatever content is within those /* and */ or after the // on the same line as the // will be completely ignored by the program.
    Just //, actually. /* */ -style comments aren't implemented, currently.

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social