PDA

View Full Version : Continuous screen quaking



zcAmazing
12-23-2007, 02:18 PM
I want to have screens that have continuous quakes (Vibration of screen) to be done by a FFC. Is it possible to make a script for that and is for an FFC?

Gleeok
12-23-2007, 07:13 PM
Yeah, assuming Screen->Quake works like the name implies, it'll be easy to make. I'll have time tonight to whip it up for you.

Joe123
12-23-2007, 07:18 PM
:eek:

We have Screen->Quake?

I thought that was only in ZASM?

Gleeok
12-23-2007, 07:26 PM
Well I believe so, just never used it.


ffc script quake{
void run(){
while(true){
//Screen->Quake; //(anything go here?)... -
Screen->Quake();
Waitframe;
}}}

Hey _L_, can you update zscript.txt please?

zcAmazing
12-29-2007, 06:13 PM
Okay. I'll try this out in a test quest. Will try everything to get it working. Notified by edit of post with date.

EDIT 12/29/07: I was able to move the text to the proper place and all steps of passing worked.
ffc script quake{
void run(){
while(true){
//Screen->Quake; //(anything go here?)... -
Screen->Quake();
}
Waitframe();
}
}


One problem:
ERROR T28: THAT POINTER TYPE DOES NOT HAVE A FUNCTION QUAKE.

Implemented since 654:
* Added ZScript variables Screen->Wavy and Screen->Quake, to match the ZASM commands added in build 461. Hint: use Screen->Quake to tell if someone's used the Quake Hammer.
Any ways to correct your script, Gleeok?

zcAmazing
12-30-2007, 01:45 PM
Read post above. I am putting more information in this double-post.

An information about a fix in 679:
* Did you notice that Screen->Wavy and Screen->Quake actually didn't work at all? No? Well, now they're recognised by the ZScript compiler.I think it got broken again, but I am not sure.

Try to correct your script, Gleeok. If you do believe the recognition of Screen->Quake by the ZScript compiler is broken, go ahead and report a bug in Open Beta Bugs (http://www.armageddongames.net/forums/forumdisplay.php?f=153).

C-Dawg
12-30-2007, 05:19 PM
Is Quake a method? Or is it a boolean that determines whether the screen is quaking or not?

Gleeok
12-30-2007, 10:50 PM
I have no idea.

...maybe one of these?


ffc script quake{
void run(){
while(true){
Screen->Quake;
Screen->Quake();
Screen->Quake = true;
Screen->Quake() = true;
Waitframe();
}
}
}


Is it like Screen->Wavy?? Is there currently any scripts that use wavy?





EDIT* Try this:


ffc script quake{
void run(){
while(true){
Screen->Quake = 30;
Waitframe();
}
}
}

Aparently it's not a boolean. This should work zcamazing.

zcAmazing
01-02-2008, 01:08 AM
Almost there!!! The script I used in the post above, when entered on the screen with an FFC that uses a script, nothing happens until you walk out of the screen. Then quake happens only for 30 frames. I also changed the number to make it go 100 frames...
Screen->Quake = 100...and when entering the screen, the screen moves away until leaving it, quaking 100 frames.

But the title of this thread is "continuous screen quaking". I wanted the quake to occur upon entering the screen with an FFC that has a script attached and works in infinite frames. Any possible things you might want to add?

Gleeok
01-02-2008, 01:22 AM
Wait, so does the screen quake while you're on the screen, or only when you leave it? Can Link move around normally while the screen is shaking? I can try to cycle the number endlessly, but would it work right?





edit* well, try this:


ffc script quake{
void run(){
int foo=1; int bar=1;
while(true){
if(foo>0){
Screen->Quake = foo;
bar=1;
}
else {
Screen->Quake = bar;
foo=1;
}
Waitframe();
}
}
}

zcAmazing
01-02-2008, 02:49 AM
Wait, so does the screen quake while you're on the screen, or only when you leave it?It occurs when you leave the screen that has the FFC with attached script.
Can Link move around normally while the screen is shaking?Yes, he can.

1I will be trying the script you posted. Notified via edit with date.

EDIT: It didn't work, does it need some setup for this to work?

Gleeok
01-02-2008, 03:15 AM
Well fooey. It's undocumented so no one really has any idea how it works. You'd be the first to use it. If the first script shook the screen for 30 ticks then what you could do is set a stupid long quake time and no one would be the wiser because who's gonna stay on a single screen for a hour anyway...



ffc script quake{
void run(){
while(true){
Screen->Quake = 99999; //or try 9999 if there is truncation
Waitframe();
}
}
}


also you could use more ffcs to quake the screen when the first one stops like so:




ffc script quake{
void run(int other_ffc){
int foo = 12345678; // set ffc combo here----
while(true){
if(this->Data >= 50){ // put that number here too!-----
for(int i =1;i < 9999;i++)
{
Screen->Quake = 9999;
Waitframe();
}
ffc other = Screen->LoadFFC(other_ffc);
other->Data = foo;
}
Waitframe();
}
}
}

Then you can trigger the next ffc to quake when the first one stops.

D0- the ffc to trigger

Just make the second,third,etc. ffcs use combos that are lower than foo.

*I pity the foo that is less than or equal to this ffc data.*

zcAmazing
01-02-2008, 04:09 AM
It is a very great script anyway but staying in a screen with an FFC causes to move the playing field up (OFF THE MONITOR :lol:, is it a beta bug?). Can be prevented. I put a 1 time warp tic and set up the side warp to warp link to the screen away from the one with the FFC. Now the quake happens no matter what DMap you are in (even using Entrance/Exit warp types) and it will only stop when the set amount of frames from the script reaches 0. There is no way to force it to stop, thoughts?

pkmnfrk
01-02-2008, 06:19 AM
I have a really obvious question here. If 'Screen->Quake = x' makes the screen shake for x ticks, then why can't you do something like this:


while(true) {
Screen->Quake = 9999;
Waitframes(9999);
}

For example. No need for multiple FFCs or anything. Or, if you wanted a version that you could trigger (say... with a Screen->D[] flag), you could do this:


Screen->D[0] = 1;
while(true) {
if(Screen->D[0] != 0) Screen->Quake = 1;
Waitframe();
}

That would Quake immediately, for either forever or until Screen->D[0] started to equal 0, whichever came first.

Honestly, it's not rocket science. (I am assuming that's how Screen->Quake works, since there's still no official documentation)

Joe123
01-02-2008, 06:36 AM
Wouldn't it be easier to use if it was just a boolean, where 'Screen->Quake() = true;' makes the screen shake and 'Screen->Quake() = false;' stops it?

pkmnfrk
01-02-2008, 08:27 AM
Not necessarily. It's a trade-off between "shaking occasionally" and "shaking continuously".

If it worked the way you propose, then custom code for all the "occasional" shaking items (the quake hammer, etc) would be required.

This way, the quake hammer, et al. can just say "Screen->Quake = 5" or whatever, and not have to care any more. The trade off is that somewhere in the game code, there's a section that likely looks like this:


if(curscreen.quake != 0) {
curscreen.quake--;
//do screen shaking stuff
}

But, it's not much of a trade off, since otherwise, you'd need this:


if(curscreen.quake) {
//do screen shaking stuff
}

Not much difference here, lots of difference elsewhere.

zcAmazing
01-02-2008, 03:47 PM
Gleeok, I am 100&#37; satisfied with the script you made. :) And there is a way to stop the quake and, made it, tested it. The quake stops. Thanks!
ffc script quake{
void run(){
while(true){
Screen->Quake = 99999;
Waitframe();
}
}
}

ffc script stopquake{
void run(){
while(true){
Screen->Quake = 1;
Waitframe();
}
}
}
The second FFC script "stopquake" uses this method highlighted in blue. EDIT: Just to keep the playing field from minor offsets, I changed 0 to 1.

Gleeok
01-03-2008, 07:38 AM
:scared: what!? You have both scripts on the same screen like that in order for it to work properly? And the screen was quaked off the monitor? haha! Maybe someone should double check Quake for bugs or something. Well, glad it works anyway.

zcAmazing
01-03-2008, 10:57 PM
Let's review, read carefully: In my test, I have one screen with an FFC that has the script "quake" and nothing else. Staying in the screen moves the screen off the monitor and it could be a beta bug. I prevented this from happening by putting a 1 frame timed warp and set up the side warp to use an insta-warp that takes Link to a screen with no FFCs. Proper quake function! There is another screen with an FFC that has the script "stopquake" (nothing else) somewhere, when he enters it, screen stops quaking and prevents a minor offset (because if the function in the "stopquake" were to be screen->quake = 0, that would only stop the quakes but the screen will have a minor offset because of the possible beta bug.
Quoted within this post:
screen with an FFC that has the script "quake" and nothing else. Staying in the screen moves the screen off the monitor and it could be a beta bug.Should I or Should you report this in Open Beta Bugs? I believe it could be true, do you, Gleeok?

Gleeok
01-04-2008, 01:39 AM
Should I or Should you report this in Open Beta Bugs? I believe it could be true, do you, Gleeok?


Hell if I know how quake is supposed to work. As soon as some documentation for it is added in z.script will I know if I even used it right.

On the other hand, If the game screen is moved completely out of view I would think it to be unintentional.

_L_
01-04-2008, 04:48 AM
Since everyone's interested, here is how Screen->Quake currently functions in Zelda Classic:


if (quakeclk)
{
playing_field_offset+=cos(--quakeclk*2)*4;
if (!quakeclk)
{
playing_field_offset=56;
}
}

When the Quake Hammer pounds, Quake is set to the Quake scroll's Misc. 1 ("Stun Duration").

The bug that has been found is, it seems, a consequence of the third line. Rest assured that it shall be eliminated!

P.S: I, um, made use of Screen->Quake in one of the cutscenes in NeoFirst (http://www.armageddongames.net/forums/showthread.php?t=100604).