Jump to content


Photo

Ruby/RGSS3 questions that don't deserve their own thread


  • Please log in to reply
1691 replies to this topic

#1681 William C

William C

    Sanubian Menace

  • Ace Member
  • 1,013 posts
  • RM Skill - Jack of All Trades

Posted 09 March 2015 - 08:44 PM

Is there a way, via script, to precache all of the files in a certain folder whenever you start a new file or load a save game? I've got a script that handles parallax maps, and it allows animated frames, but it causes some serious lag spikes when the map is loaded, even wit the mighty Effectus installed. The lag spike is short but seriously noticeable. Would precaching all of the images in the folder when loading a game alleviate this issue?


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#1682 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 1,202 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 09 March 2015 - 09:05 PM

Did you try seeing if my cache script helped? It can precache stuff if you really want, but it also might help a bit without it. I don't have the ability to precache a whole folder by default but it might not be hard to add... then again I am not 100% sure about dealing with encrypted archives and stuff.

 

Honestly I recommend you don't precache lots of huge images like that though. It wastes a heck of a lot of memory, and the game might need to swap in and out memory pages a lot more as a result. If anything, it would be better to cache the animation images when the map is loaded instead but that may involve more work.

 

I think this might be better if you formally make a parallax animation class to add to the spritemap and have it cache all the bitmaps on creation and dispose them when disposed. Don't just cache it when you change the graphics. Can I see the script you use?


Edited by KilloZapit, 09 March 2015 - 09:06 PM.


#1683 William C

William C

    Sanubian Menace

  • Ace Member
  • 1,013 posts
  • RM Skill - Jack of All Trades

Posted 09 March 2015 - 09:30 PM

Spoiler

 

I did try Cache Back, Cache Optimization, all that. Still lag spiked down to about 7 FPS while it loaded the images. Here is the script. I like that it allowed for multiple layers and animated frames, but it seems it's too much for VX Ace to handle by default. Bummer.


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#1684 KilloZapit

KilloZapit

    FAIRY DUST! FAIRY DUST FOR EVERYONE! WHEE!

  • Ace Member
  • 1,202 posts
  • LocationFairyland!
  • RM Skill - Coder

Posted 10 March 2015 - 03:03 AM

Well it's kinda always going to take that long to load anyway. It might be able to be modified to cache all the images at once when the sprites are created though, but it looks like kind of a pain.



#1685 William C

William C

    Sanubian Menace

  • Ace Member
  • 1,013 posts
  • RM Skill - Jack of All Trades

Posted 10 March 2015 - 10:32 AM

Hrm... I'm gonna move on to a new problem.

 

I'm trying to manually input a wait time between the end of a battle and the point when the victory music and text appears. Even though BattleManager has a wait method, it doesn't seen to work when called from process_victory.

 

Anyone know of a way to do this?


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#1686 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 274 posts
  • LocationPortland, Oregon
  • RM Skill - Jack of All Trades

Posted 10 March 2015 - 12:53 PM

 

Asked in a different Forum and got nada, how would a spell only hit a group based on the target. 

Example: I cast 'Acid Chain' and then target monster B. I want all monster B's I am fighting to have it cast on them, not A, not C.

Is there a script for that or is it built in and I am missing it?

You can loop through all the enemy and check the ID if it's the same with enemy ID that you've selected.

 

Example :

id = enemy.enemy_id
$game_troop.each do |enemy|
  if enemy.enemy_id == id
    #Do something
  end
end

I have been using plug and play stuff for so long, I am not even sure where to put this. In theory (cuz at work) could I have skill run a common event and then this code to do the skill 'Acid Chain'?



#1687 DrDhoom

DrDhoom

    *wink~*

  • Ace Member
  • 84 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 10 March 2015 - 10:47 PM

Hrm... I'm gonna move on to a new problem.

 

I'm trying to manually input a wait time between the end of a battle and the point when the victory music and text appears. Even though BattleManager has a wait method, it doesn't seen to work when called from process_victory.

 

Anyone know of a way to do this?

Scene_Battle itself has a wait method, use it instead.

 

 

 

 

Asked in a different Forum and got nada, how would a spell only hit a group based on the target. 

Example: I cast 'Acid Chain' and then target monster B. I want all monster B's I am fighting to have it cast on them, not A, not C.

Is there a script for that or is it built in and I am missing it?

You can loop through all the enemy and check the ID if it's the same with enemy ID that you've selected.

 

Example :

id = enemy.enemy_id
$game_troop.each do |enemy|
  if enemy.enemy_id == id
    #Do something
  end
end

I have been using plug and play stuff for so long, I am not even sure where to put this. In theory (cuz at work) could I have skill run a common event and then this code to do the skill 'Acid Chain'?

 

I think you could, it's tricky though.


Open for Script Commissions. Interested? PM me.

Check out my DA

My Blog


#1688 William C

William C

    Sanubian Menace

  • Ace Member
  • 1,013 posts
  • RM Skill - Jack of All Trades

Posted 11 March 2015 - 01:08 AM

I don't see anything in Scene_Battle referencing the end of a battle or a victory in battle, which is where I want to insert the wait time, right before the victory ME and text appears. BattleManager, however, looks like it handles that, with the "process_victory" method. Where in Scene_Battle would I insert the wait time?


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#1689 DrDhoom

DrDhoom

    *wink~*

  • Ace Member
  • 84 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 11 March 2015 - 01:43 AM

You can call Scene_Battle method from BattleManager by using SceneManager.

 

Example:

SceneManager.scene.wait(240)

Edited by DrDhoom, 11 March 2015 - 01:44 AM.

Open for Script Commissions. Interested? PM me.

Check out my DA

My Blog


#1690 William C

William C

    Sanubian Menace

  • Ace Member
  • 1,013 posts
  • RM Skill - Jack of All Trades

Posted 11 March 2015 - 06:51 AM

Awesome, thanks a lot DrDhoom.


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#1691 Traverse

Traverse

    Advanced Member

  • Ace Member
  • 82 posts

Posted 11 March 2015 - 08:36 AM

 

Even though BattleManager has a wait method, it doesn't seen to work when called from process_victory.

 

I don't know what scripts you're using exactly, but the default BattleManager doesn't have a "wait" method. The closest it gets is "wait_for_message", which only works if a message is being displayed.

 

As DrDhoom mentioned, Scene_Battle does have a "wait" method that could do what you want (assuming no conflict with any of your doubtlessly numerous battle scripts), but bear in mind that the amount of frames it waits will be cut in half if the player holds down the same button used for fast-forwarding through the battle log. You might want to use "abs_wait" instead, since that doesn't proc the fast-forward.



#1692 William C

William C

    Sanubian Menace

  • Ace Member
  • 1,013 posts
  • RM Skill - Jack of All Trades

Posted 11 March 2015 - 12:12 PM

Here's how I solved it. I added a script that allowed a common event to run after a battle ends (before the victory processes). In that common event, I used script calls to close all of the windows in battle, then added a 1 frame wait afterwards. The purpose was to ensure that enemies with custom collapse effects ran through their collapses fully before the battle would process the victory BGM and message windows (previously, as soon as the last enemy started collapsing, the victory would process).

 

DrDhoom's method also worked, before I added this in.


My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users