Jump to content

Photo

Want to learn Zscript


  • Please log in to reply
16 replies to this topic

#1 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 29 November 2007 - 03:42 PM

Could somone teach me Zscript please

only thing i know is this

CODE

// this is a coment
import "std.zh"

how to start a script

COuld somone please teach me Zscript (or Zasm but perfereby Zscript)


#2 Rocksfan13

Rocksfan13

    Looks best in Blue

  • Members
  • Real Name:Doug
  • Location:Earth

Posted 29 November 2007 - 03:50 PM

Take a look HERE.

It's quite extensive, but it'll get ya started.


#3 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 29 November 2007 - 04:04 PM

Read it here on pure but past the The Semicolon part i didn't relly understand it

I'm taking a gusse that it ends a part of a script


#4 Rocksfan13

Rocksfan13

    Looks best in Blue

  • Members
  • Real Name:Doug
  • Location:Earth

Posted 29 November 2007 - 04:31 PM

The semicolon ends a line. It tells the script that's all there is to this line. It would be for a one line code.
The braces end the script code.

At least that's what I get out of it.
Matthew also has a more in depth description HERE.
His made more sense to me.


#5 Joe123

Joe123

    Retired

  • Members

Posted 29 November 2007 - 04:58 PM

http://www.geocities...ipttutorial.txt

http://www.armageddo...ead.php?t=94699

http://www.purezc.co...showtopic=25946

http://zctut.com/script1.php

That's my handy ZScript tutorial dump icon_smile.gif (it's saved in my user CP notepad =P)

I think one of them might be the same as what you posted Rocksfan, so sorry if it is.

Anyway, you'll have to be very, very careful with your spelling. I know you're dyslexic, but it'll be lethal unless you do check and recheck everything.

Not that I'm trying to put you off or anything icon_smile.gif

#6 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 02 December 2007 - 05:11 PM

Thanks joe i truyed the bottom one and retyped the script but it woun't load into Zquest

CODE
import "std.zh";

ffc script heartmaker
void run(){
/need this variable to loop
int i;

//play the sound effect Screet
Game->playsound(SFX_SECRET);

//60 ticks = 1 second
for(i=0;i < 60; i++) {
WaitFrame ();
}

//create haeart
item heart = screen->CreateItem(IT-HEART);

//place it just north of Link
heart->X = Link->X;
heart->Y = Link->Y - 16;

//end script
Quit();
}
}


Help
(and i know what these fuctions are like heart->X = Link->X: meens place a heart on the smae X axis)


#7 Joe123

Joe123

    Retired

  • Members

Posted 02 December 2007 - 05:19 PM

CODE
import "std.zh" // no need for a ';' on the end of this line

ffc script heartmaker{ // got to open the script with a '{'
void run(int SFX_SECRET){
//need this variable to loop (you only had one slash here)
int i;

//play the sound effect Screet
Game->PlaySound(SFX_SECRET); //you hadn't declared this variable, I've declared it within void run. This means it takes up the value of the ffc's D0. Also, you have to watch your capital letters. While 'PlaySound' is fine, 'playsound' will not compile.

//60 ticks = 1 second
for(i=0;i < 60; i++) {
Waitframe ();
}

//create haeart
item heart = Screen->CreateItem(IT_HEART); // 'Screen', not 'screen', '_' not '-'

//place it just north of Link
heart->X = Link->X;
heart->Y = Link->Y - 16;

//end script
//Quit(); there's no need for this really, the script doesn't loop so it'll finish here anyway.
}
}

Edited by Joe123, 02 December 2007 - 05:19 PM.


#8 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 02 December 2007 - 05:24 PM

Someone should say to the person who made that toutale becasue it was an excaet copy of it

And thanks Joe aging

Wait anthore problam

PASS 1: PARSING
PASS 2: Preprocessing
PASS 3: Buildng Symbol Tables
TEMP, LINE 17: ERROR S09: Variable IT_HEART IS UNDECLARED

Edited by billy ronald, 02 December 2007 - 05:29 PM.


#9 Joe123

Joe123

    Retired

  • Members

Posted 02 December 2007 - 07:04 PM

OK, put 'I_HEART' instead of 'IT_HEART'. Should work fine then. If not, just put '2' in that space.

#10 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 03 December 2007 - 11:00 AM

Thanks i'll try that and i'll edit this post to say if it worked

it compiled but Game->PlaySound(SFX_SECRET) didn't play

mabey my sound isn't high enthth so could someone complile this script to see if the sound works

CODE
import "std.zh" // no need for a ';' on the end of this line

ffc script heartmaker{ // got to open the script with a '{'
void run(int SFX_SECRET){
//need this variable to loop (you only had one slash here)
int i;

//play the sound effect Screet
Game->PlaySound(SFX_SECRET); //you hadn't declared this variable, I've declared it within void run. This means it takes up the value of the ffc's D0. Also, you have to watch your capital letters. While 'PlaySound' is fine, 'playsound' will not compile.

//60 ticks = 1 second
for(i=0;i < 60; i++) {
Waitframe ();
}

//create haeart
item heart = Screen->CreateItem(I_HEART); // 'Screen', not 'screen', '_' not '-'

//place it just north of Link
heart->X = Link->X;
heart->Y = Link->Y - 16;

//end script
//Quit(); there's no need for this really, the script doesn't loop so it'll finish here anyway.
}
}


Edited by billy ronald, 03 December 2007 - 11:33 AM.


#11 Joe123

Joe123

    Retired

  • Members

Posted 03 December 2007 - 02:53 PM

CODE
import "std.zh"

ffc script heartmaker{
void run(){
int i;

//play the sound effect Screet
Game->PlaySound(27); //fixed that now;)

for(i=0;i < 60; i++) {
Waitframe ();
}

//create haeart
item heart = Screen->CreateItem(I_HEART);
//place it just north of Link
heart->X = Link->X;
heart->Y = Link->Y - 16;

//end script
}
}


I'd been a bit naughty and declared it as a D0 integer.

It'll play now.

#12 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 03 December 2007 - 05:23 PM

I'll try it tormove to see if it workes becasue it is 22:23 over here and also thanks joe123 for helping me so much

#13 Joe123

Joe123

    Retired

  • Members

Posted 03 December 2007 - 05:27 PM

Happens to be 22:26 here icon_wink.gif

I'm only in Birmingham.

And that's fine icon_biggrin.gif

#14 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 04 December 2007 - 11:07 AM

it works now by if you stand at the top of the screen it gose onto the subscreen

Would the quest rule Subscreen over sprites or wahtever it's called fix this


#15 Joe123

Joe123

    Retired

  • Members

Posted 04 December 2007 - 11:10 AM

Yes, yes it would.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users