[XP] Tons of Add-ons

Started by Blizzard, January 09, 2008, 08:50:47 am

Previous topic - Next topic

SolarisSpell

Thanks for the help.

 def check_events
    events, names = [$game_player], [nil]
This solved the problem of some transfer events being show as a square, but one as an arrow.
Now it always differentiates some events as arrows and some as squares. I've come to the conclusion that it depends if the events can face different directions (for example, the end of the map is a transfer event with nothing more, so it's a square, but a door is an arrow). I'm still trying to make it so that it is always a square.

The problem with the player arrow disappearing in some maps was fixed just increasing sprite.z


It's strange, but this script is giving a lot of problems, and I'm even thinking that maybe something in my project is affecting it.
For example, all the customizations options seems to not have any effect:
PLAYER_COLOR = Color.new(0, 255, 0)
EVENT_COLOR = Color.new(0, 128, 255)
TELEPORT_COLOR = Color.new(255, 255, 0)
SPECIAL_COLOR = Color.new(255, 0, 0)
MINIMAP_X = 0
MINIMAP_Y = 0
MINIMAP_WIDTH = 160
MINIMAP_HEIGHT = 160
MINIMAP_OPACITY = 160
MAP_MOVE_BUTTON = Input::Z
If I change these vales, nothing happen. I even tried using script calls as it says in the instructions with no result.

If I add \spc as a comment in an event, nothing happens, but if I add it in its name, it is shown. Right now, I can only see the player arrow, transfer events and these \spc in name events. I don't know if it should work any different (as I'd like to show with different colors events if they are enemies, npc, treasures, etc)

I'll try messing around with the code, but it seems the script is just not being fully compatible with my game

KK20

Quote from: SolarisSpell on June 01, 2021, 04:52:07 pmIf I change these vales, nothing happen. I even tried using script calls as it says in the instructions with no result.
-squints-
-CTRL + F's the script-

...Blizzard what the fuck. How did no one ever report this?

Quote from: SolarisSpell on June 01, 2021, 04:52:07 pmI've come to the conclusion that it depends if the events can face different directions (for example, the end of the map is a transfer event with nothing more, so it's a square, but a door is an arrow).
Yes, that is how it works.

Quote from: SolarisSpell on June 01, 2021, 04:52:07 pmI'm still trying to make it so that it is always a square.
You put \box in the event name. You should have been able to infer that from my previous post, though I will admit it's not documented anywhere.

Quote from: SolarisSpell on June 01, 2021, 04:52:07 pmRight now, I can only see the player arrow, transfer events and these \spc in name events. I don't know if it should work any different
No, that's all it does. They will all be marked the same color.

Quote from: SolarisSpell on June 01, 2021, 04:52:07 pm(as I'd like to show with different colors events if they are enemies, npc, treasures, etc)
Again, that is a script request.

Quote from: SolarisSpell on June 01, 2021, 04:52:07 pmbut it seems the script is just not being fully compatible with my game
...or do you mean "doesn't fulfill your needs"?
Incompatible would mean it doesn't work with another script.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

SolarisSpell

June 02, 2021, 05:16:44 pm #982 Last Edit: June 02, 2021, 05:19:14 pm by SolarisSpell
Quote...or do you mean "doesn't fulfill your needs"?
Incompatible would mean it doesn't work with another script.

Sorry, I didn't mean to be pretentious. I just was sure something had to be wrong with my game, as I tried following the instructions and some things weren't responding, so I thought some other script were messing the code. (And when restarting the game with F12, the minimap changed. It was there, but blocky instead of drawing diagonals).


QuoteYou put \box in the event name. You should have been able to infer that from my previous post, though I will admit it's not documented anywhere.

It's so simple... argh. I did try it, but I only created an event with \box in it's name with no result. I didn't try to create a '\spc \box' or add it to the transfer event... I've done it now and have seen that it works perfectly.


Thanks again. It works and it was just me not knowing how to implement it in the game.


Thommy

July 07, 2021, 10:02:36 am #983 Last Edit: July 07, 2021, 10:31:35 am by Thommy
Hello

I have an odd error when i display the MiniMap with F5.

The map shows everything except the green arrow for the player, but strangely it shows the arrows of the followers.
Any tip for me?

EDIT: i found out that if i've no Transfer scripts with the 'Player touch' Tag, the players arrow is shown. But when i activate the Event the arrow is Not shown. Also, when i have the caterpillar activated and for example two Transfer Events, than only two follower arrows are being shown.

What the hell did i Do wrong? xD

KK20

Replace the relevant minimap methods with these
  def check_events
    events, names = [$game_player], [nil]
    if $game_system.CATERPILLAR
      $game_player.members.each {|event|
        if event.character_name != ''
          events.push(event)
          names.push(event.character_name)
        end
      }
    end
    $game_map.events.each_value {|event|
        next if event.name.clone.gsub!('\nomap') {''}
        if event.is_a?(Game_Event) && !event.erased && (event.teleport ||
            event.name.clone.gsub!('\spc') {''})
          events.push(event)
          names.push(event.character_name)
        end}
    return events, names
  end
 
  def create_sevents
    @sevents = []
    @events.each_index {|i|
        sprite = Sprite.new(viewport)
        rect = Rect.new(0, 0, 56, 14)
        if @events[i] == $game_player
          if @names[i] != ''
            sprite.bitmap = Bitmap.new(56, 14)
            sprite.bitmap.blt(0, 0, $tons_cache.get_image('green_arrow'), rect, 128)
          end
          sprite.z = 100
        elsif @events[i].is_a?(Game_Member)
          if @names[i] != ''
            sprite.bitmap = Bitmap.new(56, 14)
            sprite.bitmap.blt(0, 0, $tons_cache.get_image('blue_arrow'), rect, 128)
          end
          sprite.z = 80
        elsif @events[i].is_a?(Game_Event)
          if @events[i].name.clone.gsub!('\spc') {''}
            color, arrow, sprite.z = Color.new(255, 255, 0, 128), 'yellow_arrow', 60
          elsif @events[i].teleport
            color, arrow, sprite.z = Color.new(128, 0, 255, 128), 'violet_arrow', 40
          end
          if @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
            sprite.bitmap = Bitmap.new(8, 8)
            sprite.bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0, 128))
            sprite.bitmap.fill_rect(1, 1, 6, 6, color)
          else
            sprite.bitmap = Bitmap.new(56, 14)
            sprite.bitmap.blt(0, 0, $tons_cache.get_image(arrow), rect, 128)
          end
        elsif @names[i] == '' || @events[i].name.clone.gsub!('\box') {''}
          sprite.bitmap = Bitmap.new(8, 8)
          sprite.bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0, 128))
          sprite.bitmap.fill_rect(1, 1, 6, 6, Color.new(255, 255, 255, 128))
        else
          sprite.bitmap = Bitmap.new(56, 14)
          sprite.bitmap.blt(0, 0, $tons_cache.get_image('white_arrow'), Rect.new(0, 0, 56, 14), 128)
        end
        sprite.bitmap = Bitmap.new(1, 1) if sprite.bitmap == nil
        sprite.ox = sprite.oy = 64
        if sprite.bitmap.width != 8
          sprite.src_rect.set((@events[i].direction-2)*7, 0, 14, 14)
        end
        @sevents.push(sprite)}
  end
These are clearly bugs, so hopefully Blizz sees this and updates accordingly.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Thommy


Blizzard

Uploaded a new version with KK20's fix.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Thommy

Yay it's me again! xD

Some issue with the minimap again.

When i Look At the the whole minimap by pressing F5 two Times the Green arrow for the Player freezes and doesn't move anymore.

Any fix for that?

KK20

Quote from: KK20 on June 01, 2021, 01:51:22 amAs for the map being moved to the middle of the screen, I don't know if not updating the events in real-time is a bug or intended. When you hold down the Z button and move with the arrow keys on larger maps, it is supposed to scroll the minimap.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Thommy

Oh no it's thommy again xD
I habe a Problem with the location namens.

I put in a Script for a custom title screen from this

https://www.neoseeker.com/forums/22121/t667163-ssbms-custom-title-screen/

Website and now i get an error everytime i enter a map where the Name should be shown. I already Figuren out that it Has to Do something with the

$scene = Scene_Title.new line in Main wich isn't included anymore after i replaced it with the script.

Any idea to help an Idiot in Scripting? xD

KK20

Either use a different method/script for making a map a title screen, or post what the error is.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Thommy

Oh sorry i forgot.

When i enter a map where the Name is supposes to Show i get those:

Script 'Blizzard -> 1' line 1684: NoMethodError occured.

Undefined method '[]' for nil:NilClass

I hope this helps

KK20

August 13, 2021, 11:44:15 am #992 Last Edit: August 13, 2021, 11:49:52 am by KK20
The variable responsible for storing the map names was never initialized. That's handled when Scene_Title is called, but since you're skipping that, it never calls it.

You need to add this somewhere before your game starts, like in Main
$map_names = load_data('Data/MapInfos.rxdata')
$map_names.each_key {|key| $map_names[key] = $map_names[key].name}

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Thommy

That fixed it. Thank you very much =)

Wraith89

Going back to the particular script for Blue Magic learn skill for Tons, I noticed that I would get a NoMethodError for 'damage' if the Blue Magic User uses the skill but has no MP to cast it at that time (for example if enemy deals MP damage to the caster).

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Blue Magic via Skill by Blizzard
# Version: 1.5
# Type: Skill Learning Skill
# Date: 14.11.2006
# Date v1.5: 17.2.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#   This actor will learn one of the target's skills. Making this skill target
#   all allies/enemies, ONLY ONE SKILL WILL BE LEARNED FROM A RANDOM TARGET!
#   Make the skill do no damage to the target and use the hit rate to determine
#   the success chance of the skill.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
BLUE_MAGIC_IDS = [92] # add any Skill IDs and separate them with commas
BLUE_MAGIC_UNLEARNABLE_SKILLS = [1,2,3,4,5,6,7,8,9,10] #Unlearnable blue magic skills
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
 
  alias make_skill_action_result_blue_later make_skill_action_result
  def make_skill_action_result(battler = nil, plus_id = nil)
    if battler == nil
      make_skill_action_result_blue_later
      battler, targets = @active_battler, @target_battlers
    elsif plus_id == nil
      make_skill_action_result_blue_later(battler)
      targets = battler.target
    else
      make_skill_action_result_blue_later(battler, plus_id)
      targets = battler.target
    end
    if $game_system.BLUE_MAGIC_SKILL &&
        BLUE_MAGIC_IDS.include?(battler.current_action.skill_id)
      targets.each {|target| target.damage = nil}
      target = targets[rand(targets.size)]
      #if rand(100) < $data_skills[battler.current_action.skill_id].hit
        #if target.is_a?(Game_Enemy)
          #ids = []
          #target.actions.each {|act| ids.push(act.skill_id) if act.kind == 1}
        #elsif target.is_a?(Game_Actor)
          #ids = target.skills.clone
        #end
      if rand(100) < $data_skills[battler.current_action.skill_id].hit
         ids = []
         if target.is_a?(Game_Enemy)
         target.actions.each {|act| ids.push(act.skill_id) if act.kind == 1 &&!BLUE_MAGIC_UNLEARNABLE_SKILLS.include?(act.skill_id) }
       elsif target.is_a?(Game_Actor)
         target.skills.each {|skl| ids.push(skl) if !BLUE_MAGIC_UNLEARNABLE_SKILLS.include?(skl) }
        end
        if ids.size > 0
          skill = $data_skills[ids[rand(ids.size)]]
          if battler.skills.include?(skill.id)
            target.damage = "#{skill.name} known!"
          else
            battler.learn_skill(skill.id)
            target.damage = "#{skill.name} learned"
          end
        else
          target.damage = 'None available'
        end
      else
        target.damage = 'Miss'
      end
    end
  end
   
end

Here's a slightly modified version made by KK20 where one can define which skills are unlearnable by caster. The error is on 'target.damage = 'None available'' line when playtesting. This can be replicated by turning on SP damage, having caster slower than the enemy, taking SP damage, and trying to cast blue magic learn skill. Is there a way to fix this? Thank you.

KK20

    if $game_system.BLUE_MAGIC_SKILL &&
        BLUE_MAGIC_IDS.include?(battler.current_action.skill_id) &&
        targets.any?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Wraith89

June 22, 2022, 09:23:50 pm #996 Last Edit: June 22, 2022, 09:39:45 pm by Wraith89
Wow it was such a simple fix. Thank you as always!

Also I wasn't sure how to edit the Blue Magic by Status skill to have a configuration to ignore certain skills as the Blue Magic as skills one.

class Game_Battler
 
  alias skill_effect_bluestatus_later skill_effect
  def skill_effect(user, skill)
    if $game_system.BLUE_MAGIC_STATUS && self.is_a?(Game_Actor)
      @states.each {|id|
          data = BlizzCFG.blue_states(id)
          if data.size > 1 && rand(100) < data[0] &&
              data[1, data.size-1].include?(user.class)
            learn_skill(skill.id)
            break
          end}
    end
    return skill_effect_bluestatus_later(user, skill)
  end
 
end

I assume it was editable here but it didn't seem to carry over the configs from the skill version sadly so any attacks that connect gets learnt. How would I do this one?

KK20

It should just be
if $game_system.BLUE_MAGIC_STATUS && self.is_a?(Game_Actor) && !BLUE_MAGIC_UNLEARNABLE_SKILLS.include?(skill.id)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

Do I need to fix anything on my end in the original script?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Quote from: Blizzard on June 26, 2022, 05:16:47 pmDo I need to fix anything on my end in the original script?
I think only the targets.any? fix. If the user is unable to use the skill in make_skill_action_result, the alias still returns an empty list of targets, I think.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!