Jump to content

Photo

Want to learn to zscript.


  • Please log in to reply
31 replies to this topic

#1 Son

Son

    Experienced Forumer

  • Members
  • Real Name:Ben
  • Location:Australia

Posted 26 May 2008 - 05:22 PM

In my quest i'm going to need alot of scripting enemys,cutsceans and maybes some items but, i can't ask people to script all these things for me. So i wanted to learn how to zscript myself but, tutorials arn't much help. So i was wondering could someone here teach me to zscript? I would greatly appreachiate this, and you would be in the credits of my games.


Thanks, Son.

#2 Joe123

Joe123

    Retired

  • Members

Posted 26 May 2008 - 06:19 PM

Tips for learning ZScript:
  • start with easy stuff
  • when you want to know how to do things, look at other scripts, or ask. I'll write big spiels on how things work if you like =P
  • think of something to script, rather than just thinking 'I want to script'
  • be specific when you ask for help, otherwise you won't get any

Edited by Joe123, 26 May 2008 - 06:19 PM.


#3 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 May 2008 - 01:04 AM

above all else, remember that first rule. START SMALL!!!
then work your way up. cutscenes would be the easiest, i would say to script.

i remember my first attempt at a script... damn eyeballs... *shudder*

i was stubborn and tried to do a big fancy custom boss... AND IT ATE MY SOUL AND LEFT NOTHING BUT THIS SHELL OF A BODY!!!

seriously. start with something within your ability. for your sake.

#4 Son

Son

    Experienced Forumer

  • Members
  • Real Name:Ben
  • Location:Australia

Posted 27 May 2008 - 01:12 AM

I sort of ment someone to help me understand how to set up a script. You mean you eye ball that shoot fire? O.o Since when have they needed scripting?

#5 Joe123

Joe123

    Retired

  • Members

Posted 27 May 2008 - 03:55 AM

Oh =P

'I want to learn ZScript' and 'I want to learn how to add a script into my game' are two very different things =P

http://www.purezc.co...showtopic=33916
That thread should help.


His custom boss was supposed to be a bit like that one in aLttP with lots of eyeballs that slide around and attack you, I think it might've been called Wart. ¬_¬.

#6 Son

Son

    Experienced Forumer

  • Members
  • Real Name:Ben
  • Location:Australia

Posted 27 May 2008 - 06:09 AM

XD No. I must have said that wrong. I did mean i want to learn how to write scripts. I just need someone to explain the structure of the scripts(like what void run(),ect. means).

#7 Joe123

Joe123

    Retired

  • Members

Posted 27 May 2008 - 09:10 AM

Ah well.

Have a look at another script and you'll see.

each script starts with:

CODE
scripttype script scriptname{
  void run(){


Where 'scripttype' is either ffc, item or global, and 'scriptname' can be anything you like.

void run() has to be called in every script, otherwise it won't do anything.

Most script will then have a while loop after that to make them run every frame, although obviously that's not the case with all scripts.
A generic ffc script structure could look a bit like this:

CODE
ffc script genericscript{        //open script

    void run(){            //open void run()

        while(true){        //open while(true) loop, which will loop forever

            //code goes here

        Waitframe();        //Waitframe(); means the loop will occur once per frame

        }            //close while loop

    }                //close void run()

}                    //close script

Edited by Joe123, 27 May 2008 - 09:11 AM.


#8 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 May 2008 - 02:38 PM

QUOTE
then work your way up. cutscenes would be the easiest, i would say to script.

Cutscenes are easy? How would you set a 'very' simple one up? I'm in need of some cutscenes...

#9 Joe123

Joe123

    Retired

  • Members

Posted 27 May 2008 - 02:41 PM

Depends what you want it to do.

#10 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 May 2008 - 02:45 PM

Like, have Link walk up a few combos, then a message string appears, then the screen warps...?

Just a little one I thought up. icon_razz.gif

#11 Joe123

Joe123

    Retired

  • Members

Posted 27 May 2008 - 04:40 PM

That's not very hard.

And you don't really need to script it either.

But you can if you want to.

#12 Master Maniac

Master Maniac

    Earth, Wind, Fire, and Water.

  • Members
  • Real Name:kris

Posted 27 May 2008 - 05:07 PM

yeah i think you could do that with some clever warps and stuff.

and cycling... but yeah


and it was the eyesore, joe. but its ok. its dead now. i abandoned that project because it was too much for me to do as my first script icon_razz.gif

#13 Joe123

Joe123

    Retired

  • Members

Posted 27 May 2008 - 05:08 PM

Not cycling ¬_¬
Freeform combos moving.

Would probably be nicer if you scripted it though.
Less screens used.


And yeah, Eyesore =P
Heh, he was pretty awful.

#14 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 27 May 2008 - 06:30 PM

Yeah. How would you do that with FFC's moving.... then stopping. Then a string. Then a warp.

#15 Joe123

Joe123

    Retired

  • Members

Posted 27 May 2008 - 06:37 PM

Well, you'd have a bit of code to move the ffc, then wait till it was where you wanted it, then a line to stop it, and a line to play a string, then Waitframe, then a warp.

Not too complex really...


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users