RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
help with script [xp] (making a varible from time.now)

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
This is just confusing me mostly. I think I have everything correct but saddly I am not sure. It doesn't seem to work and I have no idea why the devil not.

I took this code and pasted it above Main

Spoiler for:
class Game_System
   
   attr_accessor :time
   
   alias init_time_system initialize
   def initialize
     init_time_system
     @time = Time.now
   end
   
   def update_time
     @time = Time.now
    $game_variables[101] = @time.min if $game_variables != nil
     $game_variables[102] = @time.hour if $game_variables != nil
     $game_variables[103] = @time.mday if $game_variables != nil
      $game_variables[104] = @time.wday if $game_variables != nil
      $game_variables[105] = @time.mon if $game_variables != nil
       $game_variables[106]= @time.year if $game_variables != nil
      end
 
 end

yes I have tried smaller varibles like " $game_variables[1] "

I tried removing @time and replacing it to something like

$game_variables[101] = Time.now.min

I even tried removing  " if $game_variables != nil " however this one liked giving me some errors.

so if anyone know what is incorrect please help me figure it out. Thank you


Btw I did look up in the search bar, unable to find anything that would help with "Time.now" "time , varibles"

 - Kathis
Project
New project. The other dimention DND
RPG makers challenge http://rmrk.net/index.php/topic,13503.0.html

********
Hungry
Rep:
Level 96
Mawbeast
2013 Best ArtistParticipant - GIAW 11Secret Santa 2013 ParticipantFor the great victory in the Breakfast War.2012 Best Game Creator (Non-RM Programs)~Bronze - GIAW 9Project of the Month winner for December 2009Project of the Month winner for August 20082011 Best Game Creator (Non RM)Gold - GIAW Halloween
Code: [Select]
class Game_System
  alias init_time_system initialize
  def initialize
   init_time_system
   @time = Time.now
  end
  def update_time
    @time = Time.now
    if $game_variables != nil
      $game_variables[101] = @time.min
      $game_variables[102] = @time.hour
      $game_variables[103] = @time.mday
      $game_variables[104] = @time.wday
      $game_variables[105] = @time.mon
      $game_variables[106]= @time.year
    end
  end
end
class Scene_Map
  alias update_old update
  def update
    $game_system.update_time
    update_old
  end
end

that'll update the time constantly on the map
should work the way you want it to

all I did was have it call update_time every time the map refreshed

FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon