PDA

View Full Version : Time Script



SpacemanDan
04-23-2008, 04:22 PM
Could somone script a timer that I could use for various minigames? (Once time runs out, you get sent else where.) (If something like this already exists, sorry.)
Thanks if you can help! :D

Joe123
04-23-2008, 05:31 PM
I could script this in about 5 minutes....

....to be exactly the same as the screen's Timed Warp.



However, that'd seem rather pointless.


So could you clarify a little more?
In what way would you like it to differ from the timed warp?

The_Amaster
04-23-2008, 05:47 PM
Actually, a display counter in the corner that counts down from D0 would be cool.

SpacemanDan
04-23-2008, 05:53 PM
I'd need it so that it works over the course of many screens. (So, say, I want a time limit for a maze that stretches many screens, but once I reach the end, the timer ends. If I don't make it in time, it boots me to another screen.)

Joe123
04-23-2008, 06:16 PM
Ah, well that'd be quite easy.

You'd just need to tick the 'carry over' flag on the ffc.


However, there'd need to be some way to stop the timer once you go to the correct screen.
Hrm.


So if D0 was 'if you reach this screen number the script quits', would that work?

And did you want a visual display of the seconds counting down too?
Cause if you do you'll need to supply me with some graphics so I know what I'm working with.

The_Amaster
04-23-2008, 06:25 PM
Maybe D0 is duration, D1 the co-ord of the screen where the timer ends?

Can't ZScript draw numbers and text somehow? I remember reading something about that...

Joe123
04-23-2008, 06:28 PM
Yeah, that was what I was thinking of.
I need graphical arrangement so I know how to reference the tiles/combos though.

You could make an algorithm to draw numbers using putpixel or line or something, but I sure as hell don't want to do it.

Gleeok
04-23-2008, 06:29 PM
Peekaboo (http://www.armageddongames.net/forums/showthread.php?t=99574)

SpacemanDan
04-23-2008, 06:33 PM
No, I won't need any sort of graphical timer.

EDIT: Doesn't that script pretty much permanantly kick you out of the DMap, though? I'm not sure.

The_Amaster
04-23-2008, 06:33 PM
I thought someone had written one. It was nagging at the back of my head, but I wasn't sure...

Oh, and Gleeok, I'm slightly confused. Do you need to create tiles for every number 0 - 59?

Joe123
04-23-2008, 06:38 PM
That script's a little urm...

final?


It runs only once on the global script, and then (if you're Gleeok) kills Link at the end.


It'd be nice to have a more generic, ffc script for it too.

Gleeok
04-23-2008, 06:39 PM
Scroll down to the ffc version....also I've been meaning to change the ffcs with drawtiles. If there is a demand for it, I'll upgrade it.


Oh, and Gleeok, I'm slightly confused. Do you need to create tiles for every number 0 - 59?

...umm, actually I forgot. I'll have to look at it.

Joe123
04-23-2008, 06:44 PM
Oh, no carry over!


const int autowarp = 0;

ffc timer{
void run(int min, int sec, int frm){
int dly = 60*60*min+60*sec+frm;
Waitframes(dly);
this->Data = autowarp;
}
}

If you put that on an ffc, and give it the 'Carry Over' flag, and then put 'No Carry Over' in the end room's screen flag, and then change the value of the 'autowarp' integer to that of an 'autowarp[X]' type combo ID, set each Side-warp[X] to where the 'bad' screen is on each screen of your puzzle, and then put in D0 minutes, D1 seconds and D2 frames for the game to wait before warping Link, it should have the desired effect.

I don't doubt that Gleeok's is better, but it's rather complicated looking, and I'm sure it has about 3x10^4934 other things in it that involve killing Link very quickly =P

SpacemanDan
04-23-2008, 06:51 PM
Alrighty! Thanks alot! :D

Russ
04-23-2008, 07:47 PM
Gleeok, if you happen to read this, I'm having problems with your script. No matter how hard I try, the dang coutdown times is always glitched. It seems to just scroll through random combos that are near the combos I tell it to use.

Gleeok
04-24-2008, 01:04 AM
Gleeok, if you happen to read this, I'm having problems with your script. No matter how hard I try, the dang coutdown times is always glitched. It seems to just scroll through random combos that are near the combos I tell it to use.

Can you send me a quest file, or take a few snapshots of your combos for me to look at?

..hmm, I'm going to make them use drawtiles, I think that would make for a script that's much easier to *implant* by anyone.

..Can you post it in the showcase thread? I'll fix it up this weekend for you.