Jump to content

Photo

"step -> message string A-D" ffc trigger

message string ffc script step-message go to message if arguments zscript

  • Please log in to reply
34 replies to this topic

#1 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 27 October 2019 - 12:01 PM

First thing I have to say, Excuse my terrible english (it's not my first language)

Is it possible to use frei Form combos, to trigger (more than one) message string, by touching (and probably pressing button)
...instead of building the message string at screen init.?

Like a "step->message string A-D" combo Effekt would be fantastic.
Is there anyone who could write a script, that couples different messages to selectable FFCs in one same screen?
Like "if touched (+ probably press button) go to -> message number"

I be soooo grateful if you could help me.

#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 27 October 2019 - 04:30 PM

ffc script stepMsg
{
	void run(int m, int sens)
	{
		if ( !sens ) sens = 8;
		while(1)
		{
			if ( DistX(this) <= sens )
			{
				if ( DistY(this) <= sens )
				{
					break;
				}
			}
			Waitframe();
		}
		Screen->Message(m);
	}
}
Place an ffc where you want Link to step. Set the FFC data to a combo ID > 0, and assign the script to it.

Args:
D0: The message string to display.
D1: The sensitivity of the step effect, defaults to 8 unless set otherwise.

Requires: std.zh, ZC 2.53.0 and above.
  • Bagu likes this

#3 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 27 October 2019 - 08:55 PM

Thank you very much!!!
...I'll try it and send you a feedback.

#4 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 28 October 2019 - 01:39 AM

I have still some problems.

I opend the ZScript menu and chose "Compile ZScript", then "Edit" a assigned the script,
...after "save to buffer", I Always get the following report:

 

Pass 1: Parsing

Pass 2: Preprocessing

Pass 3: Registration

Pass 4: Analyzing Code

 

Line 8 @ Colums 12-23 - Error T021: Funktion DistX(const FFC(class 31) has not been declared.

 

Line 15 @ Colums 7-18 - Error T021 Function Waitframe() has not been declared.

 

I can Export it as .zs file, but if I want to Import it as ffc script, only .txt, .asm & .zasm files are available/visible

I already tried to write it via Notepad and Import the .txt file, but then zquest says:

 

Unable to parse instruction 1 from ffcS1 (that's how I named the file)

The error was: Invalid Instruction!

The command was (script) (stepMsg)

 

What I am doing wrong?

Where's my mistake?

 

Would be great if you can help me again.



#5 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 28 October 2019 - 03:48 AM

I have still some problems.

I opend the ZScript menu and chose "Compile ZScript", then "Edit" a assigned the script,
...after "save to buffer", I Always get the following report:

 

Pass 1: Parsing

Pass 2: Preprocessing

Pass 3: Registration

Pass 4: Analyzing Code

 

Line 8 @ Colums 12-23 - Error T021: Funktion DistX(const FFC(class 31) has not been declared.

 

Line 15 @ Colums 7-18 - Error T021 Function Waitframe() has not been declared.

 

I can Export it as .zs file, but if I want to Import it as ffc script, only .txt, .asm & .zasm files are available/visible

I already tried to write it via Notepad and Import the .txt file, but then zquest says:

 

Unable to parse instruction 1 from ffcS1 (that's how I named the file)

The error was: Invalid Instruction!

The command was (script) (stepMsg)

 

What I am doing wrong?

Where's my mistake?

 

Would be great if you can help me again.

So, what Zoria forgot is that you don't know how to use scripts, so he left out a step that most people know is required already.

In order to use any scripts, you must add 'import "std.zh"' to the top of the script. But, you only want to do this ONCE, even if you have many scripts; so most people do not include it when they post scritps.


  • Jared and Bagu like this

#6 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 28 October 2019 - 05:45 AM

So, what Zoria forgot is that you don't know how to use scripts, so he left out a step that most people know is required already.

In order to use any scripts, you must add 'import "std.zh"' to the top of the script. But, you only want to do this ONCE, even if you have many scripts; so most people do not include it when they post scritps.

 

So should I add it to line one…?

Or is i an extra line (20 lines instead 0f 19)?

Can you write en example, and tell me step by step, how to use???

Sorry, if I am a bit annoying, but I'm a totally newbie dummy in Scripting.

Last night, I spent hours and hours, trying.
without succes.

So, please help me one more time


Edited by Bagu, 28 October 2019 - 06:00 AM.


#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 28 October 2019 - 05:47 AM

 

So should I add it to line one…?

Or is i an extra line (20 ines instead 0f 19)?

Can you write en example, and tell me step by step, how to use???

Sorry, if I am a bit annoying, but I'm a totally newbie dummy in Scripting.

Last night, I spent hours and hours, trying.
without succes.

So, please help me one more time

 

Literally just add it to the script

import "std.zh"
//The rest of the script

  • Bagu likes this

#8 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 28 October 2019 - 06:14 AM

Thanks, goona' try




So, what to do first.
Open "Compile ZScript", then "Edit", "Save To Buffer" and "Compile"
or write a .txt file wizh notepad, and import it via "Import FFC Script"?

 



#9 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 28 October 2019 - 06:25 AM

Thanks, goona' try

So, what to do first.
Open "Compile ZScript", then "Edit", "Save To Buffer" and "Compile"
or write a .txt file wizh notepad, and import it via "Import FFC Script"?
No, import ffc script is for ZASM, not ZScript. To load from a text file (which should be '.zs', not '.txt'; but you still open it with whatever program you use for .txt files), go to 'Compile ZScript', then 'Load'; and once you load it, hit 'Compile'.

ZScript is the main scripting language, but when you compile it, ZQuest assembles the script into ZASM internally. In the future, you will be able to then export this ZASM, which can then be loaded via the 'Import [type] script' options. Those options should only be used with '.zasm' files, which are entirely different from ZScript (.zs) files.

Another note, you will also see '.z' and '.zh' files. '.z' files used to be the main file, before we changed it to '.zs'; but either still works. '.zh' is technically also identical, but it is specifically used for 'headers'; which are effectively files of script that are specifically written for other scripts to reference (ex. "std.zh")

#10 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 28 October 2019 - 06:29 AM

Sorry, just seen your latest reply


Edited by Bagu, 28 October 2019 - 06:32 AM.


#11 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 28 October 2019 - 06:32 AM

I added it to the script.
I added it to the script, but now, whin I'm trying to import the txt file as FFC Script, 
I get the message:

Unable to parse instruction 1
The ertror was: invalid instruction
The command was ("std.sh") (,)

As I said, you do NOT use "Import FFC Script". That is NOT for ZScript files, that is for ZASM files, which are an entirely different coding language.

As I said above, you import a ZScript file (Which should be a ".zs", not ".txt") by going to "Compile ZScript->Load" to load the file (which copies it to the buffer), and the clicking "Compile".


  • Bagu likes this

#12 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 28 October 2019 - 06:45 AM

Don't know what I'm doing wrong!
I did exactly what you told me.

also, checked the script, but there are no errors
….it's frustrating

when I hit compile, after loading the .zs file, I get this:

Pass 1: Parsing
Sytax error, unexpected LBrace, ecpecting end (Line 3 Column 2 '{')
Error P000: Can't open or parse Input file!


Edited by Bagu, 28 October 2019 - 06:48 AM.


#13 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 28 October 2019 - 06:48 AM

Don't know what I'm doing wrong!
….it's frustrating

Pass 1: Parsing
Sytax error, unexpected LBrace, ecpecting end (Line 3 Column 2 '{')
Error P000: Can't open or parse Input file!

You clearly didn't copy the script properly, as that error would not occur if you had.

Script



#14 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 28 October 2019 - 07:02 AM

It seems not possible, to copy-paste

I wrote line by line, can't find any error.

Please, once write the script for me to take a look on the complete script.
I can't figure out, what mistake I made
 



#15 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 28 October 2019 - 07:05 AM

Why can't you copy-paste?





Also tagged with one or more of these keywords: message string, ffc script, step-message, go to message if, arguments, zscript

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users