Parallax BG issue

a parallel process running as a common event that changes the parallax background doesn't execute when the conditions are met:

var period = $gameVariables.value(n); if (period === x) { parabg = "Mountains1"; } else if (period === y) { parabg = "Mountains3"; } else { parabg = "Mountains2"; }$gameMap.changeParallax(parabg, true, false, 4, 0);or have i got the syntax wrong?

The flow control conditionals equivalent doesn't work either.
Show us the whole common event - a screenshot.


Why are you doing it via a script call? You can just do conditional branches to test what the variable is set to and use the event command to change the parallax background.


Have you verified that the common event is actually being called? F9 will let you check the switches so you can confirm that it's being turned on.


It may well be one of those things that affects the NEXT parallax to be loaded, rather than change it immediately, like changing the battle BGM.
Show us the whole common event - a screenshot.


Why are you doing it via a script call? You can just do conditional branches to test what the variable is set to and use the event command to change the parallax background.


Have you verified that the common event is actually being called? F9 will let you check the switches so you can confirm that it's being turned on.


It may well be one of those things that affects the NEXT parallax to be loaded, rather than change it immediately, like changing the battle BGM.
 
i did a script call because the conditional branches didn't work lol, see this:

Spoiler
[IMG]http://i1379.photobucket.com/albums/ah157/koldsack/screeny_parallaxbg_zpsn9khxkxe.png[/IMG]

yep, F9 console showed the variables were correct and parallel process were indeed active.


the parallax bg doesn't change nor startup.


strangely enough, if i were to do $gameMessage.add("text"), the text would show up.
Did you try leaving the map and returning to see if it's as I said, and only updates when the map is next loaded?
Did you try leaving the map and returning to see if it's as I said, and only updates when the map is next loaded?
it does show up if i do a screen refresh, such as accessing the menu. but that would defeat the purpose of a parallel process i think. i had been able to do this in VX ACE, an alternative to the day/night tinting which kills fps to the point of the game being unplayable.
I just tested in MV using event commands and it changed immediately.


So there's something wrong with your script commands. I suggest you go back to events and figure out why they're not working.


What is Time: Period? is it always an integer? If not, I would expect it to show Mountains2 the vast majority of the time, and the other two will only show for a single frame. Depending on what's controlling it. How is it changed?
it's like this:
hudell's timesystem+event plugin which updates the time period of a day in 4 parts, 1-4 to 4 variables.
----> calls common event for each period update ----> change parallax.

hudell's plugin does exactly what it should do. the common event does activate, the problem is the image does not show.
if i try to insert the $gameMessage.add("text") script call, the text would show up every single time the period changes, just not the image.

so i tried using the branch conditional equivalent and the same thing result:
(btw, yes, i forgot add a turnoff to switch[11], so lag is not an issue)

Spoiler
[IMG]http://i1379.photobucket.com/albums/ah157/koldsack/screeny_parallaxbg2_zps96dtrcoi.png[/IMG]
that didn't work, so i tried:
 var period = $gameVariables.value(8); if (period === 2) { parabg = "Mountains1"; } else if (period === 4) { parabg = "Mountains3"; } else { parabg = "Mountains2"; }$gameMap.changeParallax(parabg, true, false, 4, 0);$gameSwitches.setValue(11, false);instead of using lighting, i just use the background to inform of the day/night cycle. the mountain images speak for themselves.

i had been able to do it with ACE, the bg parallax would change with the advent of certain times of the day. hope i'm making sense.

EDIT: i forgot to add i'm running the 1.01 build of MV.
I just tested in MV using event commands and it changed immediately.


So there's something wrong with your script commands. I suggest you go back to events and figure out why they're not working.
ok, been trying to figure this out the whole day, driving me nuts!
What is Time: Period? is it always an integer? If not, I would expect it to show Mountains2 the vast majority of the time, and the other two will only show for a single frame. Depending on what's controlling it. How is it changed?
Time: Period is a variable that is always an integer, yes.
koldsack, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


I really would do it with events. Neither of them are working as they are, so opt for the easier one.


What is turning the switch on? If you turn it on, the event runs and a background is set, and you turn it off again, what turns it back on so it checks the next time?
apologies on the d-post, was replying to the latest edit of your last post. thought it was a new post.

koldsack, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


I really would do it with events. Neither of them are working as they are, so opt for the easier one.


What is turning the switch on? If you turn it on, the event runs and a background is set, and you turn it off again, what turns it back on so it checks the next time?
 
Hudell's event activator would activate a common event with a parallel switch (which is [11]). the parallel switch in turn runs the Parallel Check common event as in my screeny. it should change every 4 periods, here's how i did in ACE with VLUE's advance time script:

Spoiler
 
[IMG]http://i1379.photobucket.com/albums/ah157/koldsack/parabgvlue_zpsgoosrwc6.png[/IMG]
EDIT: i did a test, this time i turned off all plugins, No Parallel Processes, No Plugins. just an event switch:

Spoiler
[IMG]http://i1379.photobucket.com/albums/ah157/koldsack/screeny_parabg1_zpsyrtsohwy.png[/IMG][IMG]http://i1379.photobucket.com/albums/ah157/koldsack/screeny_parabg2_zpshhyoyaia.png[/IMG]

result is a no go:

Spoiler
[IMG]http://i1379.photobucket.com/albums/ah157/koldsack/screeny_parabg3_zpshcmapavp.png[/IMG]
I did another test, this time with just branch conditionals. result is the same.
Just tested this on an empty project. The "Change Parallax" event command does absolutely nothing.

So, it's a bug on RM itself.

I'll debug it for a solution.

Edit: Done.

I created a plugin for bug fixes and included the fix for this. Download it here.
Can you state why you believe it's an MV bug? It worked perfectly for me.
Can you state why you believe it's an MV bug? It worked perfectly for me.
I created a new project, made a map with a parallax image, added an event with the command "change parallax background". I playtested and executed the event, nothing happened.

Debugging the code, I noticed that RM was not marking the parallax bitmap as "changed", so it would only reload it when opening the menu or something like that.
I made a new map with no parallax background, and I made an event with 2 event pages. On each page I changed the parallax background and activated the other page. I was able to toggle between the two backgrounds each time I interacted with the event.
This is the event I tested: This event is the only thing on the project
 
page1.png

 
page2.png

 
The background only changed when I opened the menu and closed it again.
With the BugFixes plugin I linked before, it worked properly.
Does that event work (without the fix) if you start without a parallax background? So just a mostly transparent map?
nope

nope.pngnope.png
Very interesting. What version of MV are you running?


I'm on 1.0.1 standalone, and it works perfectly for me, whether I give the map an initial parallax background or not. No plugins installed.
1.0.1 from steam.

The fix was just this:

//Fixes the issue of parallax images never refreshing. var oldTillingSprite_onBitmapLoad = TilingSprite.prototype._onBitmapLoad;TilingSprite.prototype._onBitmapLoad = function() { oldTillingSprite_onBitmapLoad.call(this); this.texture.baseTexture.dirty();};It just had to call .dirty() on the texture when it is changed. Can you check your rpg_core.js to check if there's anything like that on your version?
no, it hasn't.

TilingSprite.prototype._onBitmapLoad = function() { this.texture.baseTexture = this._bitmap.baseTexture; this._refresh();};Just tried the Steam version and it also works for me.Are you using the scripts as they are in the engine, or are you using Zalerinian's split scripts?

Original thread: https://forums.rpgmakerweb.com/threads/parallax-bg-issue.49687/