PDA

View Full Version : *Doomsday* Script



Gleeok
10-01-2007, 11:00 AM
Are you tired of spending too much time playing ZC? Those 20+ hour quests can be very time consuming. Wouldn't you like your own personal apocalypse to tell you when you've had enough, and it's time to go out and get some sunlight?...well here it is.



int doom = 10800; // 1 = one second

int sec_combo = 9000; // combos used for seconds. 9000 + 59, change to any combo you like
int min_combo = 9060; // combos used for minutes. ditto
int hour_combo = 9120; //combos used for hours. ditto
int sec_count = 0;
int min_count = 0;
int hour_count = 0;

global script Doomsday{

void run(){

ffc hour = Screen->LoadFFC(30); // loads ffc's 30-32 *DO NOT USE FFC'S 30-32 FOR ANYTHING ELSE!*
ffc minutes = Screen->LoadFFC(31);
ffc seconds = Screen->LoadFFC(32);


while(true){

seconds->Data = sec_combo;
minutes->Data = min_combo;
hour->Data = hour_combo;
hour->X = 208;
hour->Y = 0;
minutes->X = 224;
minutes->Y = 0;
seconds->X = 240;
seconds->Y = 0;
if (doom >=1){
Waitframes(60);
doom--;
sec_count++;
sec_combo++;
if (sec_count == 60){
sec_count = 0;
sec_combo = 9000;
min_combo++;
min_count++;
}
if (min_count == 60){
min_count = 0;
min_combo = 9060;
hour_count++;
hour_combo++;
}

} else {
Link->PitWarp(255,00); // do as you will with these:
Game->PlaySound(27); // ..when time is up!
Waitframes(1800);
Quit();
}
}
}
}


How it works:

It creates an ffc timer in the upper-right corner of th screen. No, don't worry. No ffc setup is required...in fact, no setup of any kind is needed once you load it into the 2cd global script slot. :)

The "timer" is currently set to use combos 9000 to 9122, and any extra hours you may want to add. For example: Setting combo 9000 to a tile with the graphic "59", and combo 9060 also to "59", and 9120 to "2", will result in the display in the corner of the screen to read: 2:59:59.

Every second of gameplay "int doom" becomes minus one, resulting in(you guessed it) a countdown. 2:59:58.........2:59:57....etc. It is currently set at 10800,(that's 10800 seconds) feel free to change it to whatever you want. -Note that the combos currently use cset 0, because ...well, I have no idea what your palette looks like. :p

When the time is up, ...oops! no more saved game, you'll have to start over. Of coarse you don't have to be as sinister about it as me, you can do whatever you like at this point. It's set to warp Link to Dmap255 as is, so you may want to change that as well.

Oh, ...and one more thing. It carries over continues and quits. ..but hey, what's the rush? It's not the end of the world.

Limzo
10-01-2007, 01:55 PM
You are a friggin' god. :freak:

ShadowTiger
10-01-2007, 05:28 PM
No, you're a bastard. :blah: I can just see you with one of those evil scientist mustaches and a villain-like tophat, going "Muwahahaha."

.. er .. no, not the tophat. The villain.

Russ
10-01-2007, 06:33 PM
Finally, a coutdown timer script. Is it possible to have this script only apply to certain dmaps?




I can just see you with one of those evil scientist mustaches and a villain-like tophat, going "Muwahahaha."

.. er .. no, not the tophat. The villain.


Stange, I can see him like that but with the tophat laughing.:D But seriously, this script is evil. Remind me to avoid your quest when it comes out. I can only take so much evil in a single .qst file.

Anarchy_Balsac
10-01-2007, 07:04 PM
I thought about requesting one of those for link paradox, as with the plot it would make perfect sense. I decided it would have been cruel to make them lose their save when they're on, say, level 15. So in the end, I didn't request it.

Gleeok
10-01-2007, 07:06 PM
Is it possible to have this script only apply to certain dmaps?


Yeah, I figured people would want a temp version. Check back later, i'm in a bit of a rush right now. I'll put it up today though. ;)


I can only take so much evil in a single .qst file. Well think of it this way....Mwahahahahahahahaaaa!!!! yes, yes....excellent.....

C-Dawg
10-01-2007, 08:08 PM
Gleeok, you should make a few modifications so the others can use this script for what they need:

(1) Add some sort of reset and activation variables. This is so that in-game events can trigger the timer starting and stopping, or resetting.

(2) Make it more clear (with comments?) where the player needs to put what happens when the timer counts out.

The only problem with this script (and it's only a problem if you're using FFC scripts on every screen!) is that it will eat up three of your FFCs for the whole quest. And we only get 32 per screen. This is already a huge problem for large custom bosses with alot of projectiles.

Gleeok
10-01-2007, 11:55 PM
OK, here's the ffc version. Use "carry over ffc" with this, and just set the screen flag "No carry-over ffc's" if Link gets there on time.


//================================================== =======
//D0 - amount of time, in seconds, before time expires
//D1 - hours combo
//D2 - minutes combo. (+59 * IT WILL +1 FOR EVERY MINUTE)
//D2 - seconds combos. -again, +59!
//D3 - destination Dmap for warp if time is up!
//================================================== =======

ffc script Timebomb{

void run(int time_clock, int hour_combo, int min_combo, int sec_combo, int dest){

int doom = time_clock;

int sec_count = 0;
int min_count = 0;
int hour_count = 0;
ffc hour = Screen->LoadFFC(30);
ffc minutes = Screen->LoadFFC(31);
ffc seconds = Screen->LoadFFC(32);

minutes->Data = min_combo;
hour->Data = hour_combo;

while(true){
if (doom >=1){
Waitframes(60);
doom--;
sec_count++;
sec_combo++;
seconds->Data = sec_combo;
if (sec_count == 60){
sec_count = 0;
sec_combo = 9000;
min_combo++;
min_count++;
minutes->Data = min_combo;
}
if (min_count == 60){
min_count = 0;
min_combo = 9080;
hour_count++;
hour_combo++;
hour->Data = hour_combo;
}

} else {
Link->Pitwarp(dest,00); // change destination here
Game->PlaySound(n); // insert sfx here
Waitframes(600);
Link->HP = 0; // kills link :0
Quit();
}
}
}
}

*IMPORTANT*
There are now variables, meaning you can use this script for different things, and each is unique.

D0 - time in seconds
D1 - combos used for hours
D2 - minutes
D3 - seconds.....

Whatever combos you wish to use be aware that it will use that combo plus 1 for every change in hour, minute, second respectively.

D4 - Dmap to warp to. self explanitory.




(2) Make it more clear (with comments?) where the player needs to put what happens when the timer counts out.

Yes well there was some problems with the site earlier, and it's a miracle this was even posted, but look....there they are. :tongue:


The only problem with this script (and it's only a problem if you're using FFC scripts on every screen!) is that it will eat up three of your FFCs for the whole quest. And we only get 32 per screen. This is already a huge problem for large custom bosses with alot of projectiles.

Well it's gonna be a problem for any script-heavy quest but it's not a big one. Especially if you plan out what ffc is going to be used for what. For example: 30-32 used for global. 1-19 used for misc + custom enemies, bosses, and projectiles(that's actually plenty), and 25-29 for Link or items. That still leaves me with slots 20-24 unused at any given time. I'd say it's plenty.


*EDIT* Forgot to mention that this will NOT carry over saves, quits, or continues...Have fun!

Russ
10-02-2007, 12:12 AM
Finally! The perfect script! But what do you mean when you say it won't carry over saves, quits, or continues?

Anarchy_Balsac
10-02-2007, 12:14 AM
He means that the timer resets when those happen.

Gleeok
10-02-2007, 12:18 AM
If you die and continue, quit->continue, save->reload, retry, or save and restart later, the timer gets reset to default. Would you like the ffc version to carry over saved games also? Be warned that that particular Dmap will become inaccessible if not completed in time...

Pheonix
10-02-2007, 05:23 PM
Yes. Then you could make a secret dungeon that you can only beat if you get get through it within a specified amount of time, you get shunted out... and can never get the item within (thinks of way to do this in quest) Power 2 sword with sword beam in the first half of the game perhaps? It will only be accessible by the Power 1 sword with the sword beam though, so...

ShadowMancer
10-07-2007, 07:26 PM
Sweet evilness :evil:

Might I suggest you use drawing routines instead of FFCs to display your numbers, then you will save the questmaker those precious three FFCs.
(I am going to be modifying my shop script to do this also)
Now that I have learned of the wounder of drawing functions Im going to be useing them everywhere (Yay!)


I can just see you with one of those evil scientist mustaches and a villain-like tophat, going "Muwahahaha."
I can see that, and remeber he has like four heads and btw, They are all evil! :p