but it won't determine the actor who used it.
Ruby/RGSSx questions that don't deserve their own thread
RGSSx Script SupportYou mean the actor who is the target of the item? In battle, you have a user (the person whose turn it is when you select Items) and a target (the person the item is applied to). Out of battle, you only have a target. This is what confused me, and why I kept asking about battles, because you were using a battle term.
I think you would need to make a new $game_temp variable which will hold an array (or just an integer, if you can guarantee that this is only of interest with items that can be applied to a single person). Then in Game_Battler.item_apply, after the if @result.hit? test, place the user.id into that variable or array. You might also wrap that in a test to ensure it's an RPG::Item (not a skill) and the item.id is in the list of valid items that you're interested in. Then you can check later what it contains.
SOMEWHERE you would also have to clear it again - probably before any script that calls the item_apply method. But then you'd have to make sure whatever script you're working on that checks the contents is going to run after the item_apply method and before that method is called again (like in the Items menu, where you can use a dozen items in a row without going back to the map, so a common event would be no good for either clearing or checking it)
I think you would need to make a new $game_temp variable which will hold an array (or just an integer, if you can guarantee that this is only of interest with items that can be applied to a single person). Then in Game_Battler.item_apply, after the if @result.hit? test, place the user.id into that variable or array. You might also wrap that in a test to ensure it's an RPG::Item (not a skill) and the item.id is in the list of valid items that you're interested in. Then you can check later what it contains.
SOMEWHERE you would also have to clear it again - probably before any script that calls the item_apply method. But then you'd have to make sure whatever script you're working on that checks the contents is going to run after the item_apply method and before that method is called again (like in the Items menu, where you can use a dozen items in a row without going back to the map, so a common event would be no good for either clearing or checking it)
How or where can I start a script that will happen right after I start a new game on the title screen? I have an auto event but it shows my characters then starts the script. I want to do this in the script before the characters show up but do not see where this happens in the script.
You don't need a script for this.
If you just don't want to see your characters until after (or sometime during) your intro, go into your System tab and check the Transparent ON option. Then use the Change Transparency event command to make your player visible when you need to.
If you just don't want to see your characters until after (or sometime during) your intro, go into your System tab and check the Transparent ON option. Then use the Change Transparency event command to make your player visible when you need to.
Is there a script call to use in a conditional branch that determines whether or not the player is standing on a certain region?
[EDIT - never mind, all sorted now]
[EDIT - never mind, all sorted now]
Hi guys. I'm trying to figure out what the script call would be for this. Here's the method:
def call_event_effect note.scan(/<EVENT (\w+) (\d+): ([^>]*)>/i) do |type, id, value| event = $game_map.events[id.to_i] next unless event case type.upcase when "HUE" then event.set_hue_effect(value) when "OPACITY" then event.set_opacity_effect(value) when "ZOOM" then event.set_zoom_effect(value) when "TONE" then event.set_tone_effect(value) when "BLEND" then event.blend_type = $1.to_i if value =~ /(\d+)/i end end endThe script in question is Victors Character Effects
I want the script call equivalent of:
<event opacity i: x, d>
I'm trying to use "this" instead of $game_map.events[id.to_i] since currently, the script doesn't have this feature.
def call_event_effect note.scan(/<EVENT (\w+) (\d+): ([^>]*)>/i) do |type, id, value| event = $game_map.events[id.to_i] next unless event case type.upcase when "HUE" then event.set_hue_effect(value) when "OPACITY" then event.set_opacity_effect(value) when "ZOOM" then event.set_zoom_effect(value) when "TONE" then event.set_tone_effect(value) when "BLEND" then event.blend_type = $1.to_i if value =~ /(\d+)/i end end endThe script in question is Victors Character Effects
I want the script call equivalent of:
<event opacity i: x, d>
I'm trying to use "this" instead of $game_map.events[id.to_i] since currently, the script doesn't have this feature.
Assuming you're using that Character Effects script, the script call is:
$game_map.events[event_id].start_opacity_change(opacity, duration)Or in Move Route script call:
Code:
start_opacity_change(opacity, duration)
Thank you Mr bubbles magic maker. From that syntax I can figure out the rest of the calls!
Hello, i have an script on Game_Player class that checks when player press a button and it calls another Class where i display over the screen a few pictures using $game_map.interpreter and using method wait, but i get an error because it says:"Cant yield from a root fiber", can you explain what does it means and how can i repair it? It says: Script 'Game_Interpreter' line 240: FiberError ocurred ===>>> It is the method wait.
Maybe you should explain what you are trying to do, and why you are doing it that way. It sounds like a very strange combination to use, to me, and it's possible there are other, much easier ways to do what you're trying to do.
Thanks, well it is a little hard to explain, but... im doing a Turn Based System game, and my events fight between them, whan they are attacked damage is shown using a method that create some pictures and display them over the screen... it works fine, the problem is that it gets the error when i try that the player hit certain enemy (event)... because i call from the Game_Player my method in order to show the pictures and it gets the error.
PD: Im using # ** Picture Wrapper # Author: Tsukihime - # ** Extended Input System - Scripter's TOOL # Author Ramiro
My codes are:
def mostrar_txt(msje1, msje2, numero, id_target, duration_base=80) # Incorporar que se trata de ataque o heal # Incorporar mensaje("ataque",target,numero,msje) # Corregir AGILIDAD imagenes = [] color_img = [] grupo_player = $jugador[0].grupo case msje1 when "Hit" msje1 = false if @grupo == grupo_player color_img.push(0,0,0,0) else color_img.push(0,-100,-100,0) end when "Miss" numero = false imagenes.push("Miss") if @grupo == grupo_player color_img.push(0,0,0,0) else color_img.push(0,-100,-100,0) end when "Crit" imagenes.push("Crit") if @grupo == grupo_player color_img.push(255,0,-200,0) else color_img.push(0,-100,-100,0) end when "Wait" imagenes.push("Wait") if @grupo == grupo_player color_img.push(0,0,0,0) else color_img.push(0,-100,-100,0) end when "Heal" msje1 = false color_img.push(-100,100,-100,0) when "MP" msje1 = false color_img.push(-100,-100,100,0) end r = color_img[0] g = color_img[1] b = color_img[2] a = color_img[3] # creo los números a mostrar if numero != false n_1000 = numero / 1000 acum = n_1000 * 1000 n_100 = (numero - acum) / 100 acum += n_100 * 100 n_10 = (numero - acum) / 10 acum += n_10 * 10 n_1 = (numero - acum) if numero >= 1000 then imagenes.push(n_1000.to_s) end if numero >= 100 then imagenes.push(n_100.to_s) end if numero >= 10 then imagenes.push(n_10.to_s) end imagenes.push(n_1.to_s) end if msje2 != false then imagenes.push(msje2.to_s) end # defino el objetivo y su posición en screen if id_target == 0 objetivo_num = $game_player else objetivo_num = $game_map.events[$jugador[id_target].id_evento] end x = objetivo_num.screen_x - 5 y = objetivo_num.screen_y - 12 # muestra pictures limite = imagenes.size - 1 dist_x = 0 dist_y = 0 # crea y muestra las pictures en la posición del evento for i in 0..limite name = imagenes dist_x = (i * 15) dist_y = 0 dur_base = duration_base _wait = false # pone msje1 sobre el texto pero alineado if msje1 != false and i == 0 dist_y -= 15 dist_x = 15 end # pone msje2 bajo el texto pero alineado if msje2 != false and i == limite dist_y += 15 if msje1 != false then dist_x = 15 else dist_x = 0 end end if i == limite _wait = true if msje1 != false then dur_base += 30 end if msje2 != false then dur_base += 30 end end $game_map.interpreter.make_pic(i, name, 0,(x + dist_x),(y + dist_y),1,false) $game_map.interpreter.show_pic(i, name) $game_map.interpreter.tone_pic(i, r, g, b, a, duration=0, false) $game_map.interpreter.fade_pic(i, 255, duration=1, false) $game_map.interpreter.tone_pic(i, r, g, b, a, dur_base, _wait) end # las mueve hacia arriba mientras las desvanece for i in 0..limite dist_x = (i * 15) $game_map.interpreter.move_pic(i, (x + dist_x), (y - 15), duration=3, _wait) $game_map.interpreter.fade_pic(i, 0, duration=5, false) end # las elimina for i in 0..limite $game_map.interpreter.erase_pic(i) end end
Thanks
PD: Im using # ** Picture Wrapper # Author: Tsukihime - # ** Extended Input System - Scripter's TOOL # Author Ramiro
My codes are:
def mostrar_txt(msje1, msje2, numero, id_target, duration_base=80) # Incorporar que se trata de ataque o heal # Incorporar mensaje("ataque",target,numero,msje) # Corregir AGILIDAD imagenes = [] color_img = [] grupo_player = $jugador[0].grupo case msje1 when "Hit" msje1 = false if @grupo == grupo_player color_img.push(0,0,0,0) else color_img.push(0,-100,-100,0) end when "Miss" numero = false imagenes.push("Miss") if @grupo == grupo_player color_img.push(0,0,0,0) else color_img.push(0,-100,-100,0) end when "Crit" imagenes.push("Crit") if @grupo == grupo_player color_img.push(255,0,-200,0) else color_img.push(0,-100,-100,0) end when "Wait" imagenes.push("Wait") if @grupo == grupo_player color_img.push(0,0,0,0) else color_img.push(0,-100,-100,0) end when "Heal" msje1 = false color_img.push(-100,100,-100,0) when "MP" msje1 = false color_img.push(-100,-100,100,0) end r = color_img[0] g = color_img[1] b = color_img[2] a = color_img[3] # creo los números a mostrar if numero != false n_1000 = numero / 1000 acum = n_1000 * 1000 n_100 = (numero - acum) / 100 acum += n_100 * 100 n_10 = (numero - acum) / 10 acum += n_10 * 10 n_1 = (numero - acum) if numero >= 1000 then imagenes.push(n_1000.to_s) end if numero >= 100 then imagenes.push(n_100.to_s) end if numero >= 10 then imagenes.push(n_10.to_s) end imagenes.push(n_1.to_s) end if msje2 != false then imagenes.push(msje2.to_s) end # defino el objetivo y su posición en screen if id_target == 0 objetivo_num = $game_player else objetivo_num = $game_map.events[$jugador[id_target].id_evento] end x = objetivo_num.screen_x - 5 y = objetivo_num.screen_y - 12 # muestra pictures limite = imagenes.size - 1 dist_x = 0 dist_y = 0 # crea y muestra las pictures en la posición del evento for i in 0..limite name = imagenes dist_x = (i * 15) dist_y = 0 dur_base = duration_base _wait = false # pone msje1 sobre el texto pero alineado if msje1 != false and i == 0 dist_y -= 15 dist_x = 15 end # pone msje2 bajo el texto pero alineado if msje2 != false and i == limite dist_y += 15 if msje1 != false then dist_x = 15 else dist_x = 0 end end if i == limite _wait = true if msje1 != false then dur_base += 30 end if msje2 != false then dur_base += 30 end end $game_map.interpreter.make_pic(i, name, 0,(x + dist_x),(y + dist_y),1,false) $game_map.interpreter.show_pic(i, name) $game_map.interpreter.tone_pic(i, r, g, b, a, duration=0, false) $game_map.interpreter.fade_pic(i, 255, duration=1, false) $game_map.interpreter.tone_pic(i, r, g, b, a, dur_base, _wait) end # las mueve hacia arriba mientras las desvanece for i in 0..limite dist_x = (i * 15) $game_map.interpreter.move_pic(i, (x + dist_x), (y - 15), duration=3, _wait) $game_map.interpreter.fade_pic(i, 0, duration=5, false) end # las elimina for i in 0..limite $game_map.interpreter.erase_pic(i) end end
Code:
class Game_Player # ===========================================================================# BOTON DE ATTACK MELEE :V# =========================================================================== def comandos_player if $turno_player == true and movable? == true player = $jugador[0] x = $game_player.x y = $game_player.y dir = $game_player.direction # Ataque melee if Keyboard.trigger?(:V) msgbox_p("presione V") case dir when 2 y += 1 when 4 x -= 1 when 6 x += 1 when 8 y -= 1 end print("A") if player.jugador_en_ubicacion(x,y) != false print("B") player.target_enemigo = player.jugador_en_ubicacion(x,y) print("C") player.atacar_melee end end end end # FIN DE CLASE end
To be honest, I would start a new thread. I don't think it quite falls into the "questions that don't deserve their own thread" category, because what you're trying to do is quite complicated.
I'd split these posts off for you, if I could, but I don't see a way for mods to do that.
I'd split these posts off for you, if I could, but I don't see a way for mods to do that.
Thanks
I have opened a new topic and i have attached my demo if you want to try (it takes 1 minute because im working the fight mechanic).
http://forums.rpgmakerweb.com/index.php?/topic/12507-tbs-problem-calling-interpreterwait-from-game-player/
Thanks.
I have opened a new topic and i have attached my demo if you want to try (it takes 1 minute because im working the fight mechanic).
http://forums.rpgmakerweb.com/index.php?/topic/12507-tbs-problem-calling-interpreterwait-from-game-player/
Thanks.
Sorry if this is a stupid question, but how does one know if scripts will conflict with each other?
I've used a few scripts now and they seem to be working okay but I'm worried that I'll eventually try and use one that won't work that I'll really want.
Is there any way to know...?
I've used a few scripts now and they seem to be working okay but I'm worried that I'll eventually try and use one that won't work that I'll really want.
Is there any way to know...?
You could look to see what classes and methods they use. If there are going to be conflicts, it'd often be because they do different things with the same methods. But that's not the only reason. Sometimes, you just have to try as many things as you can during testing to see if something goes wrong.
Is there a z guide somewhere, a depth guide for images/overlays/parallaxes etc etc? Such as, what depth are characters, below and above events, tilesets, etc.
No, there isn't, but you can examine Spriteset_Map in the script editor or pretty much any of the Sprite classes. Viewports determine the z-value of most (if not all) sprites at initialization, but sprite z-values can be changed after initialization.
I only just browsed Spriteset_Map, but the general values are:
Code:
@viewport1.z # => [email protected] # => [email protected] # => 100 @parallax.z # => -100
oh nice, that'll come in handy. Thanks for showing me where I can find them~
Is it possible to fade-IN BGS?
Not sure.. but if you have the sound file (obviously you do) you might be able to load it up in something like Audacity and create the fade-in yourself as a separate file?
Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/