Page 3 of 3

Re: Adding Time with LunaDLL Tutorial

Posted: Sat May 17, 2014 10:51 pm
by Chad
MECHDRAGON777 wrote:So, What is 360 seconds, When I did the math, I got 362 seconds on the clock!
Sometimes you have to play with the number a little bit. If you want a slightly lower number of seconds, you can just put a slightly lower number in the text.

Re: Adding Time with LunaDLL Tutorial

Posted: Sat May 17, 2014 10:57 pm
by MECHDRAGON777
Chad wrote:
MECHDRAGON777 wrote:So, What is 360 seconds, When I did the math, I got 362 seconds on the clock!
Sometimes you have to play with the number a little bit. If you want a slightly lower number of seconds, you can just put a slightly lower number in the text.

Code: Select all

#0
// Set timer to 360, trigger kill event when expired
Timer,0,1000,1,0,21780,0

#1
//message
ShowText,0,250,250,3,195,-- CASTLE GROUNDS --

#6
//message
ShowText,0,250,250,3,195,-- CHECKPOINT --

#7
//message
ShowText,0,250,250,3,195,-- CLOUDY ROOF-TOP --

#8
//message
ShowText,0,250,250,3,195,-- BOSS DOOR --

#9
//message
ShowText,0,250,250,3,195,-- SECRET EXIT --

#11
// Set boss timer to 100, kill player when expired
Timer,0,1000,1,0,6050,0
//message
ShowText,0,250,250,3,195,-- Dimention D --

#12
// Stop kill event upon completing level
DeleteEventsFrom,1000,0,0,0,0,0

#1000
// Kill player when time runs out
Kill,0,0,0,0,1,0
// Delete event 1000 to prevent infinite triggering
DeleteEventsFrom,1000,0,0,0,0,0

#END
What math I did to even get it that close was from your SLSE Demo when you used 6050 for 100 seconds! I divided by 100, and multiplied by 360!

Re: Adding Time with LunaDLL Tutorial

Posted: Sat May 17, 2014 11:08 pm
by Chad
The math isn't perfect. If you watch closely as the timer goes down, you'll see the seconds are a little shorter than actual seconds (like in classic Mario games). So if 21780 represents 362 seconds, maybe try 21600-something. And if that doesn't do it, go a little lower. It won't always work correctly on the first test.

Also, I know this isn't the issue you're having, but you shouldn't have a timer in both #0 and #11. #0 is "always", so it will overlap with Section 11's timer and they'll operate simultaneously, and either one will kill you depending on which runs out first. Since you can't stop a timer after you've started it, I'd recommend removing the #11 timer and increasing the #0 one to compensate.

Re: Adding Time with LunaDLL Tutorial

Posted: Sat May 17, 2014 11:13 pm
by MECHDRAGON777
Chad wrote:The math isn't perfect. If you watch closely as the timer goes down, you'll see the seconds are a little shorter than actual seconds (like in classic Mario games). So if 21780 represents 362 seconds, maybe try 21600-something. And if that doesn't do it, go a little lower. It won't always work correctly on the first test.

Also, I know this isn't the issue you're having, but you shouldn't have a timer in both #0 and #11. #0 is "always", so it will overlap with Section 11's timer and they'll operate simultaneously, and either one will kill you depending on which runs out first. Since you can't stop a timer after you've started it, I'd recommend removing the #11 timer and increasing the #0 one to compensate.
I forgot to remove that, sorry

Re: Adding Time with LunaDLL Tutorial

Posted: Mon May 19, 2014 2:30 pm
by Darkonius Mavakar
hey uh, how do i make 300, 100 and 200 seconds timers?

(yeah it's a bump)

Re: Adding Time with LunaDLL Tutorial

Posted: Mon May 19, 2014 2:36 pm
by zlaker
#0

// Set timer to 100, trigger 1000 when expired
Timer,0,1000,1,0,9050,0

// Trigger 1001 when exit is collected
IfNPC,11,2,0,1001,0,0

#1000

// Kill player when time runs out
Kill,0,0,0,0,1,0

#1001

// Delete kill event
DeleteEventsFrom,1000,0,0,0,0,0

#END
Just add 3000 on each 100 seconds you want to add on the number I just bolded

Re: Adding Time with LunaDLL Tutorial

Posted: Mon May 19, 2014 2:58 pm
by Chad
I'd like to note that the "11" in the "IfNPC" line assumes that the level ends in a SMB3 roulette exit. If it ends in a SMB3 star, change it to "97", and so on. The number has to match the npc-# of the exit type used.

Re: Adding Time with LunaDLL Tutorial

Posted: Sat Jun 14, 2014 8:25 pm
by SMBXxer
Thanks, this is amazing.
EDIT: Please help, The timer works fine up until about five seconds then it just stops all gameplay and freezes SMBX.