Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - CountVlad

1
Script Troubleshooting / [XP] Help Adapting a Script
October 17, 2010, 07:24:59 am
Hi,

I have a script that does automatic movement for Birds and Pigeons. Basically the way it works is you name an event either Bird of Pigeon and it changes the movement accordingly (and the graphic for the pigeon). The Bird flys in a straight line in a random direction until it gets to the edge. Then it gets transfered to a random edge in a random position and repeats.
I've already adapted it slightly so instead of putting 'Bird' as the event name I can use 'NPC'. I've also changed it so that the event will only move left or right.

However, I want to adapt the script so that the event will transfer to either the left or right edge when it goes off the map and only horizontally between the coordinates Y15 and Y17 (X doesn't matter if it only transfers to the left or right edge).
That way the event will walk along the street and then walk along it again from either left or right when it gets to the end.

Anyway, the script (with adaptations):

#--------------------------------------------------------------------------
# * SDK Log
#--------------------------------------------------------------------------
SDK.log('Birds', 'tibuda', 1.0, '')

#--------------------------------------------------------------------------
# * SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2])

#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Birds')
#==============================================================================
class Game_Event
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
  #--------------------------------------------------------------------------
  if SDK.enabled?('AntiLag')
    alias_method :tibuda_birds_antilag_gm_event_in_screen?, :in_screen?
    def in_screen?
      if self.name == 'Pigeon' || self.name == 'NPC'
        return true
      else
        return tibuda_birds_antilag_gm_event_in_screen?
      end
    end
  end
end

class Game_Character
  #--------------------------------------------------------------------------
  alias_method :tibuda_birds_gm_char_up_movement, :update_movement
  def update_movement
    if self.is_a?(Game_Event) && self.name == 'Pigeon'
      move_type_pigeon
    elsif self.is_a?(Game_Event) && self.name == 'NPC'
      move_type_bird
    else
      tibuda_birds_gm_char_up_movement
    end
  end
  #--------------------------------------------------------------------------
  def move_type_bird
    return if moving?
    @bird_dir = @direction unless @bird_dir.is_a?(Numeric)
    @move_frequency = 6
    @through = false
    @always_on_top = false
    if !moving? &&
       ((self.x == 0 && [1,4,7].include?(@bird_dir)) ||
        (self.y == 0 && [7,8,9].include?(@bird_dir)) ||
        (self.x == $game_map.width-1 && [3,6,9].include?(@bird_dir)) ||
        (self.y == $game_map.height-1 && [1,2,3].include?(@bird_dir)))
      @bird_dir = rand(8) + 1
      @bird_dir += 1 if @bird_dir == 5
      case @bird_dir
      when 1
        pos = rand($game_map.width + $game_map.height - 1)
        if pos <= $game_map.width
          self.moveto(pos, 0)
        else
          self.moveto($game_map.width-1, pos - $game_map.width + 1)
        end
      when 2
        self.moveto(rand($game_map.width), 0)
      when 3
        pos = rand($game_map.width + $game_map.height - 1)
        if pos <= $game_map.width
          self.moveto(pos, 0)
        else
          self.moveto(0, pos - $game_map.width + 1)
        end
      when 4
        self.moveto($game_map.width - 1, rand($game_map.height))
      when 6
        self.moveto(0, rand($game_map.height))
      when 7
        pos = rand($game_map.width + $game_map.height - 1)
        if pos <= $game_map.width
          self.moveto(pos, $game_map.height-1)
        else
          self.moveto($game_map.width-1, pos - $game_map.width + 1)
        end
      when 8
        self.moveto(rand($game_map.width), $game_map.height-1)
      when 9
        pos = rand($game_map.width + $game_map.height - 1)
        if pos <= $game_map.width
          self.moveto(pos, $game_map.height - 1)
        else
          self.moveto(0, pos - $game_map.width + 1)
        end
      end
    end
    case @bird_dir
    when 1
      move_left
    when 2
      move_left
    when 3
      move_right
    when 4
      move_left
    when 6
      move_right
    when 7
      move_left
    when 8
      move_right
    when 9
      move_right
    end
  end
  #--------------------------------------------------------------------------
  def move_type_pigeon
    range = ((self.x - $game_player.x)**2 + (self.y - $game_player.y)**2)**0.5
    limit = @move_frequency == 3 ? 2 : 5
    if range > limit && $game_map.passable?(self.x, self.y, 0)
      @character_name = '166-Small08'
      @move_frequency = @page.move_frequency
      @through = @page.through
      @always_on_top = @page.always_on_top
      tibuda_birds_gm_char_up_movement
    else
      @character_name = '165-Small07'
      if @move_frequency == 3
        turn_away_from_player
        @bird_dir = nil
      end
      move_type_bird
    end
  end
  #--------------------------------------------------------------------------
end

end
#--------------------------------------------------------------------------
# End SDK Enabled Test
#--------------------------------------------------------------------------
2
I remembered to check the manual this time. lol.
Anyway, what I'm trying to do is set up a system where you can talk to a person using the custom triggers of BlizzABS but you can also attack them (like in Oblivion or Morrowind where you can attack civilians if you really want to). The problem is that I want a variable to change when you first attack them (a bounty) and then to increase again if you kill them. Is there any way, using a parrallel processing event on the map, to detect if a certain group is hostile towards you and put it in a conditional branch?

e.g. (not real coding, sorry. Just might be easier to understand)

In the common event put something like:

if switch "civilian attacked" is OFF
    if "civilian group" is hostile
         Increase variable "bounty" +100
         Turn switch "civilian attacked" ON
    end
end


In the civilian event:

Page 1 - Dialogue that they use normally.
Page 2 - Run only if switch "civilian attacked" is on. Increases variable "bounty" if the event is 'killed'.

I hope that all makes sense.
Does anyone know if this is possible?

EDIT: Never mind, I managed to work something out using events.
3
I was wondering if anyone knows how to allow the user to change the BlizzABS controls in game, or if it's even possible?
Most games now allow you to change the controls, so it's a nice feature that's been requested and one I'd like to include in my game.
4
Hi,

I've been trying to improve the resolution of menu graphics by telling the windows that make up the menu screens (e.g. save screen, pause menu, inventory, etc.) to be transparent and then using...

    @sprite = Sprite.new
   @sprite.bitmap = RPG::Cache.windowskin("name of background image stored in windowskin folder")


... in one of the Window scripts to display an image in the background. I found out that I had to put this particular bit of script actually in the Window script instead of the Scene script because otherwise it would be referring to something that doesn't exist within that script.
This, however, causes problems because some Window scripts are used by more than one Scene, which means that if (for example) I have a background tailored to the inventory then if I try to change hotkeys (using BlizzABS), the Inventory background image will be displayed because both scripts use "Window_Item".

Ok, now for the question. Is there a way of putting the above script (along with disposing it when you close the scene) directly into a Scene script and getting it to display a picture in the background?

Screenies:

Spoiler: ShowHide




EDIT: Never mind, I worked out a way around the problem.
5
A while back I found a script by Falcon, which allowed you to modify the prices of items in a shop before you entered it.
Here's the thread: http://forum.chaos-project.com/index.php/topic,1807.0.html

I was wondering if there is any easy way to make a new script based on that one that will change the sell price for when you sell an item to a merchant? It would need to be a completely seperate script that could be called independently from the original tax system.

If it's possible, could someone explain to me how to do it? Even better, would someone be able to make it for me? I'm still a novice at scripting.

Thanks! :)
6


Overview

Novostrana is a Fantasy RPG currently under development by RPG Magic.

In Novostrana you will meet many unique characters, travel through the vast wilderness, forests and marshes and fight many enemies. You will also be able to trade, perform alchemy, work with companions and participate in many more activities.

Novostrana will be free to download and play. No strings attached!

Feature List

  • Over 80 unique areas to explore.

  • Side Quests with many risks and rewards.

  • Every person in the game has their own unique story to tell.

  • Real-time on-map battles (Blizz-ABS).

  • Dynamic weather, lighting and time of day.

  • Characters will do different things and be in different places in the game world depending on many factors, including time of day and weather.

  • Dynamic Character Development where you choose how to upgrade your character.

  • Your character actually wears the armour that you equip!

  • Create items through Crafting.

  • And much, much more!
Pictures

Pictures: ShowHide
























For more pictures, go to: http://www.moddb.com/games/novostrana/images

Novostrana v0.30

Version 0.30 has now been released!
To download it, click here.

A patch has also been released that fixes a couple of serious bugs: http://www.rpg-magic.org/games/novostrana/downloads/nov_032_patch.exe

It features a whole raft of improvements from the previous version:
Changelog: ShowHide
-------------------
-----CHANGELOG-----
-------------------

-------------------
----VERSION 0.30---
-------------------
1. Added Health and Vitality potions to the game.
2. Changed HUD to display Health and Vitality bars more accurately.
3. Changed 'Skill Points' to 'Vitality Points' and 'SP' to 'VP'.
4. Running and Jumping will now lower VP.
5. VP will recharge over time and recharge faster when sneaking.
6. Implemented new book viewing system.
7. Added new books and documents.
8. Redesigned the title screen background.
10. Added Running and Jumping as Skills.
11. Shadows have been removed.
12. ABS Pre-Menu disabled.
13. Hotkeys disabled.
14. Shop Loyalty system replaced with a Settlement Prosperity system.
15. Some controls have been remapped.
16. Some dialogue bugs corrected.
17. A new start has been implemented.
18. Mr Baldadrir is now called Vilfred.
19. Vilfred is now a Village Headman.
20. Mapped the 'M' Key to open the music selection menu and removed the option from the Journal.
21. Added new 'Statistics' option to the Journal.
22. The way bandits work has been changed.
23. Evil dialogue options and actions have been removed.
24. Fame has been added to the game, but due to the low number of quests it has   not been implemented yet.
25. An inventory weight limit system has been included.
26. You can now buy a bag to increase the weight limit.
27. Created new enemy groups.
28. Adjusted all weapons to have a greater reach to make combat easier.
29. Adjusted prices of all Weapons and Armours.
30. Changed some menu vocabulary.
31. Improved enemy AI.
32. Added interiors to all buildings in Willenke Village.
33. More buildings and interiors added to Willenke Village.
34. Updated title screen quit script to show a dialogue with forum details before quitting.
35. Added shortcut key to Journal.
36. Added a wait system so you can make time pass by.
37. Added lock-picking system.
38. Added door interaction system.
39. Max HP and VP calculation has been tweaked.
40. A Work Bench system has been implemented.
41. More NPCs have been added to Willenke Village.
42. All NPCs in Willenke now have Scheduals.
43. Doors will be locked when houses are not occupied or the residents are asleep.
44. Contextual dialogue added to NPCs in Willenke.
45. Added new icons.
46. More music added to Jukebox.
47. Proper track names are now displayed in the Jukebox.
48. A wooden background has been added to the Character Creation screen.
49. More Devil's Flowers added to Hirgil Marsh.
50. Random NPCs added to Willenke Inn.
51. Added a few more items to the game.
52. Updated a few items.
53. Character Creation has been overhauled.
54. Classes added to the game.
55. Your HP and VP will now be restored on Level-Up and the bars will be full when you start the game.
56. Random chest items lists set up.
57. More enemies and enemy types have been added to the game world.
58. Fixed several bugs in the Axe of Evil quest.
59. The game will now check how many people are in your party before it adds a new member.
60. Fixed a bug where the number of distributable level points was being  incorrectly calculated.
61. Some character graphics have been recoloured and some new ones added.
62. Fixed a bug where clouds would be shown when inside after sleeping.
63. Added more sound effects to some parts of the game.
64. Mining Equipment and a Mining system has been added to the game.
65. Added a new Level Up! HUD symbol.
66. You can now see what you are wearing!
67. The Game Over screen has been changed to look a bit better.
68. Enemy processing has been improved.
69. Added more Quests to the game.
70. A new game manual has been included.

-------------------

-------------------
----VERSION 0.20---
-------------------
1. First Installer version of Novostrana.
2. Levelling and Stats have been completely overhauled.
3. A saved game auto-updater has been included.
4. All areas that were previously locked out are now accessible.
5. More areas have been added.
6. More quests have been added.
7. More NPCs have been added.
8. Can now check for updates.
9. New start and backstory implemented.
10. The game will now ask if you want to start the game in full screen mode.
11. A new credits script has been included with an up-to-date credits list.
12. Installed Blizz-ABS.
13. All Weapons and Armours have been rebalanced.
14. Fixed several issues with levelling-up.
15. Added new crafting system.
16. Added Dynamic Shop system.
17. Large pieces of dialogue have been split up a bit.
18. Tilesets should now work properly.
19. Fast Travel System added.
20. Banking System added.
21. Added new item limits system.
22. Documents system improved to show instructions text.
23. Item storage system added.
24. Night lighting has been rebalanced.
25. Shadows have been completely re-done.
26. Shadows can now be turned off.
27. A new game manual has been added.
28. An improved time system has been included, but not implemented yet.
29. Two "note" items have been converted to be viewed in the document viewer.
30. Items have been checked to make sure they can be used properly and whether they should be consumed or not.
31. A shop loyalty system has been implemented.
32. A few other things which I have forgotten!
-------------------


More Info

If you would like more information about this project, please visit:

Our Profile on ModDB

The Novostrana Minisite
7
Resource Requests / Blizz-ABS RTP Sprites?
January 15, 2010, 07:08:00 am
Does anyone know of any Blizz-ABS character animation sprites that have been done for the stock/default RTP in RPG Maker XP?
I've been searching for a while now and I can't find anything. (I did a search on this forum as well, just to be sure).