Time and Period System

cluthz

Warper
Member
Joined
Jun 22, 2014
Messages
3
Reaction score
0
First Language
Norwegian
Primarily Uses
Yes,

I did manage to fix it earlier today.

My coding skills aren't great, but it seems like this did the trick:

I just added "@tint_picture" a few places.
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
Have I missed something? What I have seen is, that you have added a new variable, but how did you manage to make the pictures tinting too?
 

cluthz

Warper
Member
Joined
Jun 22, 2014
Messages
3
Reaction score
0
First Language
Norwegian
Primarily Uses
Have I missed something? What I have seen is, that you have added a new variable, but how did you manage to make the pictures tinting too?
I have no idea, It does work tho :p
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
I have no idea, It does work tho :p
That's functional "scripting" in my style too! :D
@Evgenij


Khas Awesome Light Effects script uses a different method of tinting the screen. It plays with opacity and variance to make a more realistic light/darkness/shadow effect.


In theory, all you have to do is to change the way of tinting done in your scripts to the way of tinting from Khas's script, add a switch for it in the settings part of your main script, and it should work.


There is no real "compatibility" issue with these scripts, as someone already mentioned, no errors pop up in the game.


It will be purely a functional add-on to your script if you make it possible to use Khas' tinting methods.
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
Thanks for the detailed explaination, I will add support for the khas script in some days, I thought there would be some other issues but if its only the tinting it shouldnt be a big problem.
 

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
Sorry for taking long to answer, what @sixth said is what I was about

to say, thanks again sixth. =)

If you call the light effect on map it will not work unless you make

the tint call that khas has in his script, and that would override any other

effect on your period system, know what I mean?

I would just like to use them when it's evening/night on your script. 

Edit.:

Since my game will have a crafting system by Venka, the player should be 

able to gather resources from the world, like crops, wood, minerals, etc.

How can I add those to a variable linked to the system? Like, in 2 days

a crop will grow up again, in 1 and 1/2 days cooper ore will reappear in the

cave you previously mined it from, etc.

I know how to set up how the crops will work, just I'm kinda lost at how to use

the time system to help do it.

Another thing is, setting up the stores not to open on saturday's after miday

and not open at all on sunday, do I need to set those like they were holidays?
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
I need to look into venkas script for you to help with this, maybe I can write a small patch.

For your shop phase you need to make a main shop phase and and a exclude phase for saturday:

:shop_open_main => {           priority: 0,        exclude: [:shop_exclude_sat]        time: [480..1200],   # this would be from 8 am till 8 pm        days: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],        months: :all,        years: :all,        switch: SWITCH_ID,    },:shop_exclude_sat => {           priority: 0,        time: [780..1200],   # this would be from 1 pm till 8 pm        days: ["Saturday"],        months: :all,        years: :all,    },So you have made a phase which will be only active on saturday from 1 pm till 8 pm and put

this phase in the exclude list of your main shop phase which is active the whole week except sunday from 8am till 8pm.

Exclude means that aslong a phase in the exclude list is active the main phase wont be active.

I hope you understand.

I think about making an easier way for defining phases, but currently I dont have a good idea.

And regarding khas awesome lights, I plan to release an update for the tint addon today or tommorow.
 

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
Thanks for the snippet, that will do it!

About Venka's, I mean, I need something for the materials to grow on

world, I mentioned her script just to illustrate why I need crops, materials, etc.

Like, if the player cuts down a wood tree, he will get wood, and after 3 days

the tree will grow back, it' not really related to her script. So, would I simply

set up a time variable of 4320s for the crop to grow?

If I could use your system's days in order to do that, if the player slept and

the time advanced, it would work better.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
About Venka's, I mean, I need something for the materials to grow on

world, I mentioned her script just to illustrate why I need crops, materials, etc.

Like, if the player cuts down a wood tree, he will get wood, and after 3 days

the tree will grow back, it' not really related to her script. So, would I simply

set up a time variable of 4320s for the crop to grow?

If I could use your system's days in order to do that, if the player slept and

the time advanced, it would work better.
You could try to use - CSCA Gathering - Script.

http://www.caspergaming.com/Developer_Tools.html

It will automatically respawn "gathering" events (but only after you leave the current map and re-enter it first! - which might sound bad, but after some thinking, I realized that this prevents excessive farming (without having to move and/or fight battles at all), which I do not want to see in my games, so it is perfectly designed in this case too for me).

You can set after how many frames it respawns, you can define rare finds (when setting this up, 100% is equal 10000 and 1% is equal 100 for some reason, guess it's a forgotten bug, just a heads up, I spent quite a lot of time to figure this one out, because the instructions say that 100 is the max amount for it), assign special items needed to reap the items (like a "Herbalists's Gloves" for gathering herbs on the fields, "Rods" and "Baits" for fishing, "Saw" for woodcutting, etc), you can even assign a proficiency system for it with another great script called - CSCA Professions -, so if you cut down, let's say, 10 trees, you will gain a level in "Woodcutting" and assign bonuses according to your level in the proficiency. 

I am currently experiencing with this system, and I am very satisfied with the results.

But I won't lie, it is a little bit complicated to set it up properly. However, when you get the hang of it, creating gathering events will go smoother and faster.

Before I found these excellent scripts, I used another similar system from Falcao, called - Falcao Mmorpg Alchemy and Extraction System -, which is also a great script. This system got automatic respawn timer too, but it lacks some of the great features the other scripts mentioned above have. Nevertheless, this one is much easier to set up. Just disable the crafting menu (since you use Venka's, right?) and use the extraction system only.

Whichever system you decide to try out, just match the respawn time frame to the time frame rate of Evgenij's Time System, so it can respawn exactly after 3 days, for example, like in your example. With a little math, this shouldn't be hard to do. :)

But just now I realized that this won't count the time spent on "sleeping", so if you really want to do it like that, it can be done with script conditional checks somehow for sure. Setting up a single time variable will not count the time slept also, unless you make a system with that variable. That variable would go down by some frame rate normally (could tie this with the time system's frame rate somehow for sure) and if you trigger sleep, you would need to stop that same variable temporary and reduce it with some value depending on the time spent on sleeping. After this, start the countdown for that variable again. Also would need to make a reset variable command at each gathering/extraction events (with the set variable command) after getting the item. Once you get the correct math done for that sleeping scene, it will be easy to implement your idea this way.

Note that this should be done for each trees or flowers you get, so it is not recommended to do it like this, unless you want to use countless of variables only for this, and if you want to get a huge FPS drop, because counting and checking a lot of variables will certainly drop it by a significant amount.

Another idea just came to my mind after carefully reading through this Time System's options.

There is that Current time variable setup. You can use that variable and another one to conditional check them after some math done.

First save the current time in another, separate variable (not the in the one which you define in the script itself!). This should be done whenever getting the item (the wood from the tree, etc.). Event whatever you want in this page, like adding the item, messages, etc, and turn selfswitch A on.

On the second page, make a variable operation. Subtract the saved variable from the variable set in the script. If it gives more than the desired amount of respawn time, it should turn off selfswitch A, so the item would respawn only then, This would work just like you wanted, would include sleeping time as well.

I recommend the subtracting part to be done only on map changes, so you won't lose any FPS by constantly subtracting and checking variables. This can be done with a simple repetitive common event which ends with an "Erase Event" command.

This is theory only, I haven't tested it yet. 

In theory it, everything what works in theory should work in practice too, but in practice... :D

Sorry for the off-topic Evgenij! *-*

I still haven't implemented your time system into my game, but soon I will arrive there too. :D
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
@luiscesjr

Do you want to make crops trough events or are they build-in in the crafting script you use?

If its the first case, just wait a little bit Im working on a harvest system, which will be compatible with my time system.

If its the second case, its how I said, I then need to look at how venka handle crop growth to give you an answer.

*edit*

I think I will make you a small demo on how you can use evented crop and ore respawns with my time system, if you want to use an evented solution

@Sixth

no problem :)
 
Last edited by a moderator:

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
@Sixth,

I found the script rather interesting, but it would be the same problem as

setting up a time (Outside the time system) for it to respawn.

For example, the players sleeps, 6 hours is passed on the clock, but for real it only

passed like 30 seconds. So it would be a bit impractical.

Like on Skyrim, crops and ores respawn after a certain in-game time, or real time depending

on how you spent it, playing or advancing it's time.

So doing this by eventing, countless of events with countless of the same variable,

or different depending on the type of material, would drop the fps.

I thought about that, as I already have some other scripts, running or not, there are

some other many scripts on the project.

Anyway, I will study more the scripts you mentioned above, I just feel that Venka's one

is so complete =)

@Evgenij,

The first case, through events. I will wait for you to release your harvest system tied to

the time system, no need for the demo before that. Then you can add your new

script on the demo.

Because, even with your new script I will need an event system anyway, so I will

wait, while studying sixth's other solutions =)

Thanks guys
 

chminj7

Warper
Member
Joined
Jul 23, 2014
Messages
1
Reaction score
0
First Language
korean
Primarily Uses
I do not speak English. So I use the Google translator. 

 

Fixed a bug? 

(I can not be sure that the correct solution did not know the script.) 

 

Fixed variables year and month did not work properly. 

 

In [TPS-Core] 

 

Additional: This is not quite variable update problem. 

   # --------------------------------------------------- ---------------------------- 

   # Next Month 

   # --------------------------------------------------- ---------------------------- 

   def next_month 

     current_day = 0 

     current_month + = 1 

     next_year ifcurrent_month> = months_in_year 

     update_month_variable # Add 

 

# --------------------------------------------------- ---------------------------- 

   # Next Year 

   # --------------------------------------------------- ---------------------------- 

   def next_year 

     current_month = 0 

     current_year + = 1 

     year_counter + = 1 

     update_year_variable # Add 

 

 

Fixed: It was marked by months. 

   # --------------------------------------------------- ---------------------------- 

   # Update Year Variable 

   # --------------------------------------------------- ---------------------------- 

   def update_year_variable 

     return unless YEAR_VARIABLE_ID 

     $ game_variables [YEAR_VARIABLE_ID] =current_year # Change 

   end 

 

Not do that, but I'm sure it works properly.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Well, I finally got to implement your time system into my project.

I must say that I am very satisfied with the results so far. :)

Also, your "experimental" Khas tinting works fine as far as I can tell. :p

I find two (well, basically the 2 is the same) features missing. Not a big issue, as I already made it for myself, but maybe someone else would like to see it too.

So, the ability to put the clock HUD and the popup to a specified X and Y co-ordinate, rather than to a few predefined places.

I, for example, have those predefined places already occupied with some other HUDs, so I needed to make this feature happen. :D

It will take a while to set it up for all the things I want, but I think it will be worthwhile. 

Thank you very much again for this awesome script!
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
So I tested my tinting script with khas, but I cant make it work. I dont know why no tinting is happening.

Could you upload a demo which is working, so I can look how you have set it up.

I have added the custom position features to both scripts.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Well, I am using a lot of scripts in my project, no idea if some of them affects the outcome or not.


But I haven't touched much in your scripts, neither did I touched a lot in Khas's script.


My script list setup in order (including only your and Khas's scripts):


TPS Core


TPS Phases and Weather


TPS Tints for Periods


TPS Clock Window


TPS Period Popup


Khas Awesome Light Effects


Just set the speed of the time to a very high value, so it moves forward quickly, and you will see the tinting happen, at least you should.


It happens at random times though, it seems, that is why the quick time skip is needed for testing.


Or maybe it is set up like that by default in your tinting script, I haven't changed anything there yet.


You can set a light effect too with Khas's script on your testing map, and if that light effect works, it means the Khas tinting works too. If that light effect is invisible, than it is not working.


But seeing that light effect requires a dark enough screen.


Khas uses the "gray" value as the opacity for the tinting, which I suppose is the 4th value in your tinting arrays, that one controls the darkness, so try to set those to around 100 at least, and you should see the tinting happen and the light sources working.


But there is a minor problem with Khas tinting, which made me not using it at all in another time system before.


Here is the issue:


I have a dark cave, which is tinted by Khas' script to a very dark level.


When I enter to that cave, my map is automatically tinted to be dark, and when I exit it, it will get the normal tint.


The problem occurs when I exit that cave. I can't seem to make the previous, outside tint appear again when I exit the cave.


I tried it with stopping the auto tint on entering the cave and resuming on exiting, but that won't work, as it will only auto-tint again at the next tint period, and until then, my screen is either very dark (if I haven't reset the dark cave tinting on exit), or very light (aka normal tint, if I reset it on exit).


Is it possible to store the current tinting values in a variable with a script call? That would solve my problem entirely.


And I looked at chminj7's post, and he really found a minor bug, or better to call it a forgotten copy/paste bit. :D


The 'update_year_variable' definition stores the info in the 'MONTH_VARIABLE_ID' instead of the 'YEAR_VARIABLE_ID'. It was still like that yesterday, when I downloaded the latest version.


Which reminds me, can you place a little text beside your demo with something like "(outdated)"?


Or you could update it instead, either way is fine. :p


Edit:


Ohh, and do note that Khas tinting uses a different value of 'z', which can be defined by the maker in Khas's script, and the clock HUD will be tinted with the screen too if that 'z' value is higher than the clock's 'z' value, and when that happens, if you managed to set the tint to a very dark one, you won't be able to see the HUD at all.


Same with the period popups.


So, a 'z' value option for the clock and the popups would work flawlessly.
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
I have got it working, it was the opacity value which was too low.

I will adress all things you mentioned sometime this week. And will update the demo, too.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Ohh, I forgot to ask...


Would it be possible to add custom weather effects?


Or a compatibility patch for Moghunter's Weather Effects script? Those effects are just so beautiful, it would be a shame to let it go. *-*


That script uses almost the same method of calling the weather change, but instead of using just a weather type and power, it uses an image file too for an extra argument. And it uses a custom script call too.


Basically, it is like what you did with Khas light effects, just with weather effects now. At least it seems so, looking at your script and at Moghunter's.


If you decide to make it, make it possible to use the default and the custom weathers too, not just one or the other, I like diversity in my game, and any extra is good to have. :D


Of course, this is just a suggestion. :)
 

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
I have started to rewrite my weather script so it would support some of the most used custom weather scripts, but havent continued yet.

So there will be support in the future but I dont know when Im finished.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
I actually went ahead and started to implement it.


I already managed to implement the automatic weather change using the Moghunter version.


Just one tiny issue, and I will finish it.


No idea how to update or implement the 'dur' argument for the custom weather method.


Ohh, well, I will keep trying. :)


I mixed something up, it seems.


'dur' is not needed for the Moghunter version.


I couldn't get why the Moghunter weather won't disappear.


Turns out, I just needed to do a weather_stop when a default weather would pop, just before it changes to the default weather.


And with this, I am done. Yay! :D


I can send you the patched version if you want, and then you can decide if my method is good enough for releasing or not. :)
 
Last edited by a moderator:

Evgenij

Veteran
Veteran
Joined
Aug 28, 2013
Messages
349
Reaction score
100
First Language
German
Primarily Uses
N/A
You can send it to me, but I rewrote most of the weather code cause I wasnt satisfied with the way I handled it before.

The updated version will support much better integration for custom weather scripts and a much better readability. You could upload your version, so ppl who want to use it with moghunters weather script dont need to wait till I release my version
 

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

Latest Threads

Latest Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,240
Members
137,609
Latest member
shododdydoddy
Top