Jump to content

Photo

The NJF Script Learning Topic


  • Please log in to reply
92 replies to this topic

#1 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 08:15 PM

Please don't delete this topic as it will be very important for me:

I find I have a different learning style than most, one that needs aid like a brace or training wheels on subjects that require a sufficient amount of study and dedication.

I am more of a visual learner, and as such, it makes learning script very difficult for me, I intend to use this topic as my own personal blog to record and share what I am learning. I'll be providing notes to reinforce learning on a very engaging level.

This may fail, but it's all I got.

Not only will this serve as a blog, I also encourage people who are more experienced to make comments if they feel that I am misunderstanding something, and/or provide comments in general in which they feel which could help.

I'm very insecure when it comes to scripting and I hope this topic can serve as a healthy aid.

----------------------------------

Some thoughts and Questions

(These will be common as I keep engaged on this subject, many of these are personal questions I'm asking myself to research, but if you want to answer, I'm all ears).

Does Waitframe(); ever have a body as far as zscript goes? I always notice that there is never anything between (). Or is that just me? If so, what exactly is this serving and why do I see it all the time?

And what exactly does while(true) even mean?

X & Y seem to be common in every script, but I have no idea how they work or even the slightest understanding what they are used for.

Edited by NewJourneysFire, 30 March 2014 - 08:28 PM.

  • Jared likes this

#2 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 30 March 2014 - 08:17 PM

What made me really get to know ZScript was just getting in there and making some complicated stuff, like my empty bottle scripts. Of course, I've known how to program for a while now, but at least for me just writing real scripts for a real quest made me learn pretty quick.

 

If you've never coded before, I think learning a little bit about programming separate from ZC could be a good thing. You don't have to worry about all the ZC related stuff. I don't know though.


  • TheLegend_njf likes this

#3 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 08:24 PM

What made me really get to know ZScript was just getting in there and making some complicated stuff, like my empty bottle scripts. Of course, I've known how to program for a while now, but at least for me just writing real scripts for a real quest made me learn pretty quick.

If you've never coded before, I think learning a little bit about programming separate from ZC could be a good thing. You don't have to worry about all the ZC related stuff. I don't know though.

Where would you suggest I begin?

This also confirms my fears that most people who do scripts have already had years and years of programming experience before doing a Zelda classic script. Something that I cannot learn without actually going to college for.



ffc script NJFsUselessScript
{
// Yay!! I created a script that does nothing!!!!
}



ffc script NJFsUselessScript2
{
void run()
{
// I "feel" smarter than I was 2 min ago.
}
}

(This isn't displaying right, I need the right format to post this in forum view).

Edited by NewJourneysFire, 30 March 2014 - 08:56 PM.


#4 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 30 March 2014 - 08:59 PM

I learnt to program myself without any formal instruction. I started with a free online book called 'A Byte of Python'. Programming is not an expert's trade. Anybody can do it. Now being a software engineer is quite different, but anyone can be a programmer.

#5 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 09:01 PM

I learnt to program myself without any formal instruction. I started with a free online book called 'A Byte of Python'. Programming is not an expert's trade. Anybody can do it. Now being a software engineer is quite different, but anyone can be a programmer.


Glad to hear!

Due to the fact that I mostly use mobile. I'll strictly learn it from websites, and also the basic tutorial here. I'll learn from here and other sources as to not get confused of the importance of either.

#6 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 30 March 2014 - 09:03 PM

So while coding experience certainly does help, it's not required. I learned the basics of coding (variables, loops, all that stuff) but picking up C++ For Dummies, then just stared at scripts for ZC and tried to replicate them. But it's totally possible to learn zscript without any prior coding knowledge. Now, onto the questions

 

Does Waitframe(); ever have a body as far as zscript goes? I always notice that there is never anything between (). Or is that just me? If so, what exactly is this serving and why do I see it all the time?

No, Waitframe() will never have anything inside the parentheses. It seems weird, but there's a reason. Waitframe is what's called a function. A function is basically just a set of instructions that tells the program to do something. Every function has the parentheses there so values can be given to the function. For example, let's say I write a function that adds 2 to a number. The function would look something like this:

 

void AddTwo(int value){
    return value + 2;
}

 

Now, if I need to add two to a variable (let's say Link's health), I can just go

AddTwo(Link->HP);

 

Not all functions actually take an input like that, Waitframe being one of them. But they still have the parentheses, because they're still functions.

 

And what exactly does while(true) even mean?

A while loop basically says "As long as whatever is in the parentheses is true, do this". For instance, maybe I have a timer that's counting down from 60, and I want it to make a certain beeping noise as long as it's above 30. I could do

 

while(timer > 30){
    Game->PlaySound(SFX_BEEP);
    Waitframe();
}

 

A while(true) loop basically says to keep doing this thing forever (or, if it's attached to a FFC, keep doing the thing for as long as the FFC exists).

 

X & Y seem to be common in every script, but I have no idea how they work or even the slightest understanding what they are used for.

 

This one's just basic algebra. A screen in ZC is a grid. Every point on the screen has an X and Y value associated with it. See, drop a blue continue square down on the screen. See the two numbers? Those are the X and Y locations of the continue square. Manipulating the X and Y values of things allows you to move them.



#7 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 09:12 PM

This one's just basic algebra. A screen in ZC is a grid. Every point on the screen has an X and Y value associated with it. See, drop a blue continue square down on the screen. See the two numbers? Those are the X and Y locations of the continue square. Manipulating the X and Y values of things allows you to move them.

Essential, it works exactly like the X and Y when placing an FFC on the screen from the FFC editor?

------------

Link->HP = I am your God, Link and you are at my mercy!!!...
I mean 16;

Edited by NewJourneysFire, 30 March 2014 - 09:33 PM.


#8 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 09:31 PM

Link->InputNJF = Hellya;


#9 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 30 March 2014 - 09:34 PM

Essential, it works exactly like the X and Y when placing an FFC on the screen from the FFC editor?

Yes, that's exactly it. You can mess with an object's X and Y value to change it's position on the screen, just like you would enter an X and Y into the FFC editor to place the FFC on the screen.



#10 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 09:38 PM

Gotcha! I'll be sure to float by with some integers after I'm done figuring this shit out.

But before I do so, I'd need to figure out where on earth is Z! O_o; I can find X, and I can find why, but Z?

Edited by NewJourneysFire, 30 March 2014 - 09:40 PM.


#11 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 March 2014 - 09:42 PM

Z (height) applies to certain object types, like Link and NPCs, but not others, like FFCs.



#12 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 09:49 PM


// Walking into this room will save your butt.

ffc script NJFsThankGodThisRoomExists
{
    void run()
    {
        Link->HP = Link->MaxHP;
        Link->MP = Link->MaxMP;
    }
}
Did I create a script?! O_o;

#13 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 30 March 2014 - 09:59 PM

Glad to hear!

Due to the fact that I mostly use mobile. I'll strictly learn it from websites, and also the basic tutorial here. I'll learn from here and other sources as to not get confused of the importance of either.


It does come in website form. I believe when I read it was just a plain txt file. XD

What's nice about Python is it comes with an interpreter, so you can try things out without compiling.

#14 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 30 March 2014 - 10:06 PM


ffc script OMFG_ThisScriptWillNeverWork
{
    void run()
    {
        NJF->GodlyPowers = 1000000;
        Earth->Surrenders = true;
    }
}

Edited by NewJourneysFire, 30 March 2014 - 10:33 PM.


#15 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 30 March 2014 - 10:14 PM


// Walking into this room will save your butt.

ffc script NJFsThankGodThisRoomExists
{
    void run()
    {
        Link->HP = Link->MaxHP;
        Link->MP = Link->MaxMP;
    }
}
Did I create a script?! O_o;

 

I believe so.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users