Calendar/Moonphase and Eventing help.

Joined
Sep 16, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
Hi there, I've been playing with a script that adds a night and day cycle to game. (https://docs.google.com/file/d/0BywhvOtY4_H9dGNFSTlWQlVEZ3M/edit) The script has the ability to run Common events at certain times in game.

I am trying to set it up so that a common event runs each night at Midnight and adds a counter to a variable. I then want to set up another common event to check that variable and set another variable with a string using a conditional branch, my hope is to use the counter to have a working moon phase calendar. That will update a variable with the current Moonphase as a string that can then be displayed by the Variable HUD script (http://niclas-thornqvist.se/rpg/scripts/ace/xs-variable-hud.txt)

I can't seem to figure out how to assign a string to a variable and how to get the Common event that adds to the ticker to run properly or how to get the Variable HUD to display the proper variable. 

Any help would be appreciated.
 
Joined
Sep 16, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
This might be in the wrong forum, but it's a mix of eventing and scripting help. >_>
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
DogGirlKari, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


I've moved this thread to RGSSx Script Requests (because you need help with the hud). Please be sure to post your threads in the correct forum next time. Thank you.


Why are you using two common events? Can't you just put them into the same common event? Add a counter to a variable, do a test on the variable, if the condition is met set the other variable with a string.


In Control Variables, I think you can use the Script box at the bottom to put a string into a variable. If that doesn't work, use the Script event command (tab 3, at bottom) and do this:

Code:
$game_variables[id] = "This is my string"
where id is the variable id ($game_variables[1], not $game_variables[0001]).
 
Joined
Sep 16, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
DogGirlKari, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.

I've moved this thread to RGSSx Script Requests (because you need help with the hud). Please be sure to post your threads in the correct forum next time. Thank you.

Why are you using two common events? Can't you just put them into the same common event? Add a counter to a variable, do a test on the variable, if the condition is met set the other variable with a string.

In Control Variables, I think you can use the Script box at the bottom to put a string into a variable. If that doesn't work, use the Script event command (tab 3, at bottom) and do this:

$game_variables[id] = "This is my string"where id is the variable id ($game_variables[1], not $game_variables[0001]).
Thanks for getting back to me, I actually did read the rules and since it had been longer than 72 hours believed it was alright to bump my post. I apologize for not knowing how to do that without posting.

I did what you said and I got two issues.



First one is a conflict in the HUD script, no idea what's causing it.



I removed the HUD script and it worked for a few seconds. Though I would like the HUD to display the time.



But after a few second, I get this error.



 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
It seems that you are using the same variable for the hour counter and the text storage you wanted.

You can't do that, because the hour variable already got some functions scripted in which can't be done with a string (adding numbers to it is one for example).

In both errors you posted, the variable tried to do an operation meant for numbers, but the variable was a string, so it could not proceed.

You probably mixed up the variables in your common event, so check them, and make sure that you don't use the same ones for the hour and the text display.
 
Joined
Sep 16, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
My variable for the Counter is 100 and my variable for the String is 99. As far as I can tell neither of those are used by the time or HUD script already. 
 

Funplayer

Self proclaimed sponge.
Veteran
Joined
Oct 9, 2013
Messages
120
Reaction score
35
First Language
English
Primarily Uses
This script appears to be very buggy.  I cannot get it to function without setting nil checks in the Game_Screen class to protect it from cloning a nil tone.

Code:
class Game_Screen  #--------------------------------------------------------------------------  # * Start Changing Color Tone  #--------------------------------------------------------------------------  def start_tone_change(tone, duration)    if !tone.nil?      @tone_target = tone.clone      @tone_duration = duration      @tone = @tone_target.clone if @tone_duration == 0    end  endend
 
Last edited by a moderator:
Joined
Sep 16, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
This script appears to be very buggy.  I cannot get it to function without setting nil checks in the Game_Screen class to protect it from cloning a nil tone.

class Game_Screen #-------------------------------------------------------------------------- # * Start Changing Color Tone #-------------------------------------------------------------------------- def start_tone_change(tone, duration) if !tone.nil? @tone_target = tone.clone @tone_duration = duration @tone = @tone_target.clone if @tone_duration == 0 end endend
I agree, the script is very buggy, but I don't know of another script that does the same functions.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Have you tried Evgenij's Time and Period System?


That one is an awesome time+date system.
 
Joined
Sep 16, 2013
Messages
28
Reaction score
0
First Language
English
Primarily Uses
Have you tried Evgenij's Time and Period System?

That one is an awesome time+date system.
I checked it out, it works a lot less buggy for sure, but I can't run common events at certain times with it as easily and it doesn't really solve the issue with the Varible HUD.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You don't need that variable HUD display script, if the only purpose of that for you is to display some time period on the screen.


Evgenij's script should already do that.


And you can operate a variable during specific times easily.


Setup a switch to be turned on at the time you want to increase the variable.


Now, make a parallel common event tied to that same switch.


After that, in the common event, make the variable operations you want and at the end of the common event, turn off the same switch that activated the common event.


This should do what you want. Actually, following the same logic, you can make your common events the same way and do whatever you want at the times you want it in the game.


Experiment with the script, it is the best time and period script out there, in my opinion, and it is the less performance killer, in my experience.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,858
Messages
1,017,023
Members
137,565
Latest member
Callmelogann
Top