Registrarse

Contador de tiempo en FR? (duda)

Estado
Cerrado para nuevas respuestas.

Jo7a

Kiero mi nick amarillo D:
Hay alguna manera de poner una espécie de contador de tiempo, por ejemplo:
Te dan 10 minutos para encontrar 4 objetos, si los encuentras te envia a X offset, si se acaba el tiempo y no los encuentras te envia a Y offset.

Sé que es una especie de script en segundo plano, y tengo entendido que en pokemon ruby/fr no se pueden hacer scripts en 2º plano (ojalá me equivoque) pero me gustaría saber si se puede hacer.
 

Cheve

MoonLover~
Miembro de honor
No se si es posible, pero se me ocurre que al haber insertado en un Hack el RTC (Real Time Clock) (En Ruby, FireRed ya lo trae implementado) puedes almacenar el tiempo actual en una variable, y, al encontrar todos los objetos, almacenas el valor del tempo actual en otra variable, luego restas la segunda var con la primera, si el resultado es menor o igual a los minuto que tienes para completar el evento, genial! Pasas, sino, no pasas
 

Javi4315

Babyface
Miembro de honor
Puedes hacer lo que dice Cheve. Aunque también hay unas rutinas de JPAN para crear un timer. Estas son las instrucciones:

Timer Specials

These functions are the ones I talked about on the Key specials section. These functions grant you access to one of the GBA’s timers, which will accurately register seconds. You only have one Timer, so it’s impossible to create more than one timed event at one time.

None of these specials receive an argument.

Special 0x46 – Timer starter

Starts the timer, nothing more. If called after it started running, it resets the timer.

Special 0x47 – Halt timer

Halts the timer – to resume use

Special 0x48 – Resume timer

Resumes timer. Returns nothing

Special 0x49 – Stop timer

Returns the current time.

Stops the timer in a way that, if the game needed it, it would be available. Using Special 0x48 now would start an inaccurate timer.

Special 0x4a – Read timer

Returns the time counted.

Simple reader, gets the time and delivers it

Special 0x4b – Stop timer and Update time

This is a special function. This is meant to update playing time if an ASM function takes too much time to be executed (several seconds).

Special 0x4c – Update time

Updates the time with the time taken. To be used after the ASM function that took too long if you plan on using the timer until the end, like when you need the timer to keep working after the function or the script but still want to keep an accurate playing time record.

Special 0x4d – Compare timer to 0x8010

Returns 0x1 if the timer is greater or equal to the contents of 0x8010

This is one of the functions you will use the most. Just place on this variable the time limit, run a cycle that reads the timer at the end, and you got yourself a timed mini-game. Also, an interesting fact, the timer can go for a maximum of 18 hours, so you will most likely never run out of time.

Special 0x4e – Store timer

Stores the value of the timer at 0x0203f4dc, so that you can stop the timer if you need, and restore it again with the below Special

Special 0x4f – Restore timer

Restarts the timer with the value stored at 0x0203f4dc.

Special 0x50 – Store timer to variable
One argument.
0x8006 = variable to store value to

Warning: this requires Special 0x4e to be used before it

Basically this special allows you to save as many timer results as you want and put them on hold for a while, for as long as you want. That way, you can run extra timers although you have only one.

Si las quieres, las puedes bajar de aquí: https://mega.co.nz/#!Tt5DFAjJ!PYf9mFY1JZw_f5bh1NTV13Xq0stOifjef3v90XDkooc

Yo no las he probado personalmente, así que no te puedo decir, pero quizás vayan bien.
 
Estado
Cerrado para nuevas respuestas.
Arriba