mars714

Veteran
Veteran
Joined
Jun 6, 2017
Messages
41
Reaction score
12
First Language
English
Primarily Uses
Other
Hello! I'm trying to make a spawnable event that changes its appearance over time. You know, a like the character plants a seed and it grows into a tree or plant. I have Yanfly event spawning and have been able to spawn the event tiles under desired conditions, However I've yet to make the event change over time. I have a time system implemented in the game, with 0-4 day progress points when the screen tints to show time passing. So I tried the obvious, parallel event, self switch on when day gets to a point. To bare fruit an additional self switch goes on and is only switched off when it's picked. For whatever reason that did not work... I figured it must be due to the use of multiple event pages, and not all being parallel... So I tired to condense it to one page. Using an alternate version of the script call this.character(EventID).setImage("imageName", imageIndex) I created a page to change the event image if day progress occurs. Then on the same page it would deploy text on a different day progress and if the chacraxcter over laps. Bam one page. But It still wouldn't change the image. the alternate script I used was: Game_CharacterBase.setImage("imageName", imageIndex) or also: Game_Event.setImage("imageName", imageIndex) the reason for this change was the fact that I have no control over what the event ID will be, all maps already auto spawn rocks for mining, so the event ID could be anything from the starting Spawn ID + the first 30 rocks, or any number of additional rocks.

I will now add screen shots of the events:

FQiRNYY.png
AYzYJH0.png

gR41BK0.png
lteI9Ud.png
J3B2Ql8.png
lKDbiUY.png

I hope someone can help me figure this out, oh, and happy new year everyone!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,403
Reaction score
15,212
First Language
English
Primarily Uses
RMMV
you really don't want to use parallel events for this. Too many and your game is going to lag like crazy.

If you want them all to progress at the same time, just use the day progress variable as a condition in the upper left corner of each page. But that has the problem of reverting if the day progress resets to 0 and the player hasn't picked it.

I don't know how it'll go with a spawning script, but you could try my multi timer plugin, which is designed specifically for harvest-type events.
http://forums.rpgmakerweb.com/index.php?threads/multi-timers.50474/
 

mars714

Veteran
Veteran
Joined
Jun 6, 2017
Messages
41
Reaction score
12
First Language
English
Primarily Uses
Other
If you want them all to progress at the same time, just use the day progress variable as a condition in the upper left corner of each page. But that has the problem of reverting if the day progress resets to 0 and the player hasn't picked it.

Oh my gosh IDK why I didn't think to use the variable in the conditions box? I can totally make that work. I just have to figure out how to keep the harvest event from being retriggerable all though that day time. Its a simple thing, I can probably actually use the self switch for that. X D

Anyway my current set up for all who's curious is a three or four page event (depending on the plant) instead of starting as a seed it starts a smaller version of the plant. then it changes to the ripe version without the ability to harvest at a day progress point. Then at the next day progress the image doesn't change but it becomes harvestable.

Thanks for you help Shaz, I think your plugin is nice but I'm not sure if I could use it with this system, I may use it for the animal growth in my game, If I do you will be included in the credits. Thanks again, sorry it took it a bit to reply.
 

mars714

Veteran
Veteran
Joined
Jun 6, 2017
Messages
41
Reaction score
12
First Language
English
Primarily Uses
Other
@Shaz Hey I'm trying to use your plugin for my animal events with staged growth. Is this Plugin Command A correct one?

addTimer <thismap>.<thisevent>.B 60 \setss([<thismap>, <thisevent>, 'B'], true)

It doesn't seem to work...

Also could you please explain what the true/false controls, its just a boolean identifier, it could be any command with two values. (you probably did say it inn your thread, but I my eyes just can't find it...)

Oh and this is the full event:

cIYxTli.png

Kw20hSr.png
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,403
Reaction score
15,212
First Language
English
Primarily Uses
RMMV
I don't see anything wrong with that plugin command.

The name of the plugin shouldn't matter, because there are no parameters. It also shouldn't matter whether you start a new game or continue a saved game, as the function initializes the variables if they're not already defined.


Could you add the following into the Else statement of the first page?
Code:
Plugin Command: TimeLeft <thismap>.<thisevent>.B 5
Text: \v[5]

but replace 5 on both lines with an unused variable number.

Then play, interact with the chicken, then interact with it again a few times. Let me know what the message says each time.

OR you could do this instead (but only do it if you have just ONE event that uses the timer - there'll be too much console output otherwise)

Change this part of the script:
Code:
  var _Game_Timer_update = Game_Timer.prototype.update;
  Game_Timer.prototype.update = function(sceneActive) {
    _Game_Timer_update.call(this, sceneActive);
    if (sceneActive && this._timers) {
      keys = Object.keys(this._timers);
      keys.forEach(function(timer) {
        this._timers[timer][0]--;
        if (this._timers[timer][0] === 0) {
          eval(this._timers[timer][1]);
          this.deleteTimer(timer);
        }
      }.bind(this));
    }
  };

to this (just inserting one line):
Code:
  var _Game_Timer_update = Game_Timer.prototype.update;
  Game_Timer.prototype.update = function(sceneActive) {
    _Game_Timer_update.call(this, sceneActive);
    if (sceneActive && this._timers) {
      keys = Object.keys(this._timers);
      keys.forEach(function(timer) {
        this._timers[timer][0]--;
        console.log(timer + ' has ' + this._timers[timer][0] + ' frames left');
        if (this._timers[timer][0] === 0) {
          eval(this._timers[timer][1]);
          this.deleteTimer(timer);
        }
      }.bind(this));
    }
  };

then play with the console on. Interact with the chicken once, and watch what the console says. Copy/paste the text back here so I can see what's going on.

Re the true/false - do you mean right at the end of the command? Switches and self switches can only have a true (on) or false (off) value. In the editor you see ON and OFF, but in the code, it uses true and false. So when you say \setSS([...], true) you are telling it to turn that self switch on.
 
Last edited:

mars714

Veteran
Veteran
Joined
Jun 6, 2017
Messages
41
Reaction score
12
First Language
English
Primarily Uses
Other
Ah so it displays the time left right? I did it, but when it got to zero, nothing happened? Here are screen shots:

n1IA10p.png

First interact.
A3H4HRN.png

second, I did a few more inbetween zero but, clearly counting down.
rSWf1WQ.png

first zero.
4K1KWDE.png

waited for movement, check, still zero.

Should I list all my plugins? mostly Yanfly.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,403
Reaction score
15,212
First Language
English
Primarily Uses
RMMV
No, I don't think it's a plugin incompatibility. But to test it out, you could create a new project with just the timer plugin and try it.

It could also be that there's an error happening, but it's being caught and not displayed. Yanfly has a plugin that will do that.

Also, try this ... find this line in the plugin:
Code:
eval(this._timers[timer][1]);

Insert a new line above that, and put this:
Code:
console.log(this._timers[timer][1]);

play with the console open (F8 for developer tools) and post what appears in the console when the timer hits 0.
 

mars714

Veteran
Veteran
Joined
Jun 6, 2017
Messages
41
Reaction score
12
First Language
English
Primarily Uses
Other
This is the line the console displayed when I changed the plugin:

$gameSelfSwitches.setValue([1, 1036, 'B'], true)

The 1036 for event line sorta makes sense. The spawn event plugin from Yanfly starts new spawns at 1000, and I have 3 events spawned to that page to monitor time, and additional 30 that spawn for as item mining events. As for the 1 for the map, I'm not sure thats right? Its actually on the third map you enter that I spawned the chicken...

As for trying it as the only plugin, I started a new project and it actually worked it that environment. I had copied and pasted the chicken event and all artwork used for it, and used your plugin. this time the console line was:

$gameSelfSwitches.setValue([1, 1, 'B'], true)

And the in game result was as desired:

HNsYtd0.png

So at this point I feel like its ether a plugin interfering, or I have some kinda other thing I can't identify messing it up?
 

mars714

Veteran
Veteran
Joined
Jun 6, 2017
Messages
41
Reaction score
12
First Language
English
Primarily Uses
Other
@Shaz Okay I just did another test in another new file, this time I had only the most essential plugins to the game included, Yours, Yanfly's Event Spawner and Core engine, A common event equip plugin, (used in my game to change sprite with equipment/outfits but completely idle in this test run,) and Hime's common even queue, (for the equip plugin)

In this test run, I had the event spawn in, and then I activated the timer plugin. I waited for the timer to hit zero and the console displayed the following text:

$gameSelfSwitches.setValue([1, 1001, 'B'], true)

Yet the chicken event did not change. My only though on how the Yanfly event spawner could be interfering, is that I have a setting on the spawn in called "preserved' that I set to true on these events. Yanfly says this just means that the spawned event remains on the map if you leave and return. But IDK I'd be greatful if you could find why its not working, if not I'll find another way to make the animals age.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,403
Reaction score
15,212
First Language
English
Primarily Uses
RMMV
You would need to confirm that the event spawner was giving the chicken event the correct (and same) event id every time. The "preserved" setting is something I think you need - it might ensure the event has the same id each time the map is loaded.

Can you zip up your project and load it up and send me a link? I can have a tinker around with it to see what's going on behind the scenes.
 

mars714

Veteran
Veteran
Joined
Jun 6, 2017
Messages
41
Reaction score
12
First Language
English
Primarily Uses
Other
Actually the point of the spawner is too be able to call from a template event and make it appear again and again on one map. An instance of this may be if you want to spawn crops in multiple locations. The would have the same base event, but since no two events on one map can have the same ID, They will always be spawned with a new ID, depended on the order spawned.

I uploaded two zipped files to my google drive though, I appreciate your help on this.

https://drive.google.com/drive/folders/1t-dJbs69BaehbnbCDo57dUYNCZW4ayG9?usp=sharing

The test demo is the failed test run with just your plugin and Yanfly's, (plus like two idle ones) and the other file is my current game work, It has Plants spawns that change by day time, (still have there re-harvest bug) and has unobtainable as of yet animal spawns. There is a bonus chest hidden in the the first building, this contains some animal spawns.
 

Latest Threads

Latest Posts

Latest Profile Posts

Making his first game
This scene was suppose to be a test... but now, it's going in the game as official side/optional content. :kaosalute:


functionality(This is function demo not game demo)
1 The door of ABS map can open upon clearing all the monsters
2 Secret room/road arrow/lighting/whatever others can be shown upon clearing too
3 Boss HP bar and loot effect, loot jump and item name color as well as the pick-up animation effect
4 Back to town and "victory aftermath" screen for ABS maps/rooms
Playing one of the two RM2k3 games I was best known for back in the day, one I made in the Spring semester of my Freshmen year in college like 15 years ago, feeling all kinds of ways about it. I have not played this game in WELL over 10 years. I feel a million years old RN.
One of these days, I need to find/figure out how to replicate the Brave/Default system. Heheh...

Forum statistics

Threads
115,327
Messages
1,089,001
Members
149,984
Latest member
bagil
Top