Difference between revisions of "User:Rasikko"

Jump to navigation Jump to search
1,295 bytes added ,  06:27, 12 February 2018
imported>Rasikko
imported>Rasikko
Line 156: Line 156:


== Lunar Functions ==
== Lunar Functions ==
Really starting to hate math..
Returns the time Masser rises. If the current time is beyond this, will return how many hours til the next moonrise.
If more than 1 day has not passed, will return the time Masser will rise instead.
<source lang="papyrus">
Float Function GetMasserRiseTime()
    Float gameTime = Utility.GetCurrentGameTime()
    Float riseTime = 20.00 ; 8PM
    Float hoursPerDay = 24.00
    Float currentHour = (gameTime - gameTime as int) * hoursPerDay
    if (gameTime >= 1.0)
if currentHour > riseTime
     
    riseTime = currentHour - (riseTime - 12.00)
    return riseTime
else
    return riseTime
endif
    endif
   
    return riseTime
EndFuntion
</source>
<br/>
Same above, but for Masser's setting time.
<source lang="papyrus">
Float Function GetMasserSetTime() Global
    ; Returns the time that Masser sets. If the current time is passed the moonset time,
    ; will return the number of hours til the next moonset.
    Float daysPassed = Utility.GetCurrentGameTime()
    Float hoursPerDay = 24.00
    Float setTime = 4.00 ; 4AM
    Float currentHour = (daysPassed - daysPassed as int) * hoursPerDay
    if daysPassed >= 1.0
if currentHour > setTime
 
  setTime = currentHour - setTime
  return setTime
else
  return setTime
        endif
    endif
    return setTime
EndFunction
</source>


== Self Reminders ==
== Self Reminders ==
* When time permits, add another example concerning the Events OnActivate, OnTriggerEnter and OnTriggerLeave.
* When time permits, add another example concerning the Events OnActivate, OnTriggerEnter and OnTriggerLeave.
* Test out function for acquiring the xp for the next level and add it to the condition function page of the same name as an alternative to it.
* Test out function for acquiring the xp for the next level and add it to the condition function page of the same name as an alternative to it.
Anonymous user

Navigation menu