hello everyone I have been using a parallel common event where depending on what weapon the players had equipped a different picture shows on screen and I have been using that as a way to show which weapon the player has equipped in battle as well which works fine since I am using the FPLE script use map as battleback which takes a screenshot of the screen to use as battleback and that includes the weapon picture . But I have a problem since I want the player to be able to change weapons in combat I made skills which when used would use a common event to change the players weapon and show the new weapon on screen by overlaying a new picture over the old one but when you use a show picture command in battle the images reappears in all future battles when the battle is over it does not erase that image instead it reappears when ever you go back into combat so what I need should theoretically be quite simple can someone show me how to add a simple line of programing to the battle end script which would delete the weapon picture
out of combat
[IMG]http://s28.postimg.org/58j6xjbkt/systemshock_3.png[/IMG]
in combat
[IMG]http://s10.postimg.org/83rfgru09/systemshock_9.png[/IMG]
the weapon change images
[IMG]http://s15.postimg.org/wt2tx7jcr/incombat_rifle.png[/IMG]
a picture of my weapon change common event if anyone wants to see it
[IMG]http://s17.postimg.org/6qtetnpan/helpme_picture.jpg[/IMG]
right sorry about the double post won't happen again.
now on to the problem at hand I am afraid you idea did not work I did as you said but it still shows the last image in battle
[IMG]http://s15.postimg.org/ne7cukeuz/helpme2.jpg[/IMG]
like you said I put a command to turn on the switch just before battle but it seems trying to delete the image outside of battle won't do it we will probably have to fiddle with the battle scripts
Oh ... set an event at the start of battle to erase the picture.
I thought you wanted to erase it when you were back on the map.
Make sure you're always using the same picture number for this purpose - don't use a different number for each weapon.
that was the first thing I tried it appears if I try to erase the picture outside of battle it does nothing the only way to get rid of the image in-battle is by calling a common event I asked on another forum the same problem. (I find posting on multiple forums is the quickest way to find an answer) and they suggested placing this line of code
$game_screen.pictures[5].erase
into the Scene_Battle1 script under battle end results and it does not seem to have any affect
and yes my image was 5 🙂
No, there's no such thing as $game_screen. The map has a screen variable, and each troop has a screen variable. In fact, I'm surprised it "didn't have much of an effect" - I would expect it would cause your game to crash.
The interpreter uses the appropriate one when you use the Show Picture and Erase Picture command.
If you use Show Picture when in battle, you should also use Erase Picture when in battle.
I still think Erase Picture on each troop tab, set to run at start of battle, should do the job. If it's not, please show us a screenshot of your troop page with that tab visible so we can see how you're trying to do it. Actually, one where you show the picture AND one where you erase it, so we can be sure they're being used in the correct places.
I'm sorry - you're right. I was looking at Ace.
apologies for the delayed response been super busy with work anyway tried the 55 that did nothing I also tried this
#-------------------------------------------------------------------------- # * Battle Ends # result : results (0:win 1:lose 2:escape) #-------------------------------------------------------------------------- def battle_end(result) # Clear in battle flag $game_temp.in_battle = false # Clear entire party actions flag $game_party.clear_actions # Remove battle states for actor in $game_party.actors actor.remove_states_battle end # Clear enemies $game_troop.enemies.clear # my picture erase edit for i in 1..100 $game_screen.pictures.erase end # Call battle callback if $game_temp.battle_proc != nil $game_temp.battle_proc.call(result) $game_temp.battle_proc = nil end # Switch to map screen $scene = Scene_Map.new endwhich was meant to delete all images but no it did nothing.
I just want to say thank you again for takeing the time to try and help me I hope we can still solve this I don't want to lose my lovely hud
Ok, so everything you've tried so far really should have worked. Especially erasing all the pictures. My best guess is that something in the custom scripts you're using is causing the erase picture function to not work as intended. If you can, post a link to the scripts you're using particularly the "map as battleback". In the meantime, try the following to help diagnosis the problem.
1. In a battle, use events to show a picture on the screen, and then erase it. Exit the battle, and re-enter. Does the picture show up?
2. In a battle, use events to show a picture but don't erase it. Exit the battle, and re-enter. Does the picture show up?
3. In a battle, use events to show a picture but don't erase it. Replace the picture with a different one and erase it. Exit the battle, and re-enter. Does the picture show up?
4. In a battle, use events to show a picture but don't erase it. Replace the picture with a different one but don't erase it. Exit the battle, and re-enter. Does the picture show up?
Just so you know, based on what's happened so far, I'm expecting the answers to all be yes. But when I do these on a fresh project, I get "No", "Yes", "No", and "Yes" respectively which is partly why I suspect it might be some custom scripts.
Huzzah! I've found the problem. But first a quick lesson about scripting.
When you write scripts, occasionally you have to overwrite methods. This leads to the order of scripts in the script editor being important and it's why custom scripts will tell you to place them below all of the defaults but above "Main". Essentially, when you start the game it goes through the scripts in order from top to bottom. As it goes through them, it will define all of the classes, methods, and other scripting things. If it ever encounters something with the same name as something previous, it will overwrite it. So as a very basic example, if you did the following.
A = 2
B = 3
C = A + B
A = 4
D = A + B
C would equal 5 while D would equal 7. So what's the point of all this? Well all of your changes that you made to "Battle_End" get overwritten in another custom script that you are using. So it's like you're telling the game that A equals 2 but further down your script list you tell it that A equals 4 instead. That's why it didn't work. So what you need to do is put "$game_screen.picutres[55].erase" in the "battle_end" method that's in the custom script marked "one player battle".
YES YES OF COURSE I totally forgot about the single player battle script no wonder it did not work before thank you thank you so much