• Anmelden
  • »Jin Katsuro« ist der Autor dieses Themas

Motto: Ich bin Kwappa. Ich spring für meinen Bruder ein, der zurzeit für längere Zeit abwesend sein wird. Ich werde ihn also sozusagen hier vertreten. Richtet also eure Fragen bitte an den lieben, kleinen Kwappa ;-)

  • Nachricht senden

1

Donnerstag, 8. April 2010, 01:04

Suche Zoom-Skript

Hi Leute,

Ich suche händeringend ein Zoom Skript für den RPG Maker XP. Das soll bewirken, dass mein Spielcharakter, wenn er hinten steht kleiner wird, und wenn er halt nach vorne läuft, immer größer wird.
Wäre nett, wenn mir jemand hilft. :D
Bild

2

Donnerstag, 8. April 2010, 03:56

Ich habe hier ein Script, welches dies tut, allerdings brauchst du noch einige weitere dazu.
Das Ganze ist umständlich, es funktioniert aber^^"

Zuerst nimmst du die angehängte Datei.
Das ist ein Ordner und in ihm sind 2 Dateien. Diesen Ordner schiebst du einfach in deinen Projektorner, sodass er bei der .exe, dem Grafik- Audio- und Dataordnern mit steht.(es ist das SDK und ne Library auf welche die Scripte zugreifen)

Danach fügst du die Scripte in den Scriptexplorer über Main in der Reihenfolge ein, wie ich sie hier poste und fertig xD

Spoiler: RSC Require
#==============================================================================
# ** RSC Require
#------------------------------------------------------------------------------
# Version 1.4.0
# * Yeyinde, 2007
#------------------------------------------------------------------------------
# Usage: require('My_RSCFile') or rsc_require('My_RSCFile')
#==============================================================================

#-----------------------------------------------------------------------------
# * Aliasing
#-----------------------------------------------------------------------------
if @rsc_original_require.nil?
alias rsc_original_require require
@rsc_original_require = true
end
#-----------------------------------------------------------------------------
# * require
# file : the file to load, rsc files will be handled in it's own method
#-----------------------------------------------------------------------------
def require(file)
begin
rsc_original_require file
rescue LoadError
rsc_require file
end
end
#-----------------------------------------------------------------------------
# * rsc_require
# file : the RSC file which will be loaded. The .rsc extension may
# be ommited
#-----------------------------------------------------------------------------
def rsc_require(file)
# Create error object
load_error = LoadError.new("No such file to load -- #{file}")
# Tack on the extension if the argument does not already include it.
file += '.rsc' unless file.split('.')[-1] == 'rsc'
# Iterate over all require directories
$:.each do |dir|
# Make the rout-to-file
filename = dir + '/' + file
# If load was successful
if load_rsc(filename)
# Load was successful
return true
end
end
# Raise the error if there was no file to load
raise load_error
end
#-----------------------------------------------------------------------------
# * load_rsc
# file_name : the file to be evaluated
#-----------------------------------------------------------------------------
def load_rsc(file_name)
file_name = file_name[2..file_name.length] if file_name[0..1] == './'
# If the file exists and so does the encypted archive
if File.exists?(file_name) && File.exists?('Game.rgssad')
raise RSCSecurityError.new("Potential security breach:
#{File.basename(file_name)} is a real file")
end
# Start a begin-rescue block
begin
# Load the data from the file
script_data = load_data(file_name)
# Iterate over each data entry in the array
script_data.each_with_index do |data|
# Store the script name
script_name = data[0][0]
# Store the script data after inflating it
script = Zlib::Inflate.inflate(data[0][1])
# Start a begin-rescue block
begin
# Evaluate the script data
eval(script)
# If there is an error with the script
rescue Exception => error
# Remove the (eval): from the start of the message
error.message.gsub!('(eval):', '')
# Get the line number
line = error.message.sub(/:[\w \W]+/) {$1}
# Get the error details
message = error.message.sub(/\d+:in `load_rsc'/) {''}
# Print the error and details
print "File '#{file_name}' script '#{script_name}' line #{line}: #{error.type} occured.

#{message}"

# Exit with value 1 (standard error)
exit 1
end
end
# Load was a success
return true
# No file to load
rescue Errno::ENOENT
# Load was a failure
return false
end
end
#==============================================================================
# ** RSCSecurityError
#==============================================================================
class RSCSecurityError < StandardError; end


# Insert Game.exe's base folder into require array
$: << '.' unless $:.include?('.')
# Remove all nil objects
$:.compact!
zum Lesen den Text mit der Maus markieren


Spoiler: The RMXP SDK 2.3
#==============================================================================
# ** RMXP Standard Development Kit (SDK) - RSC Require
#------------------------------------------------------------------------------
# Build Date - 2005-11-22
# Version 1.0 - Near Fantastica - 2005-11-22
# Version 1.1 - SephirothSpawn - 2005-12-18 - (Near Fantastica)
# Version 1.2 - Near Fantastica - 2005-12-18 - (Wachunga)
# Version 1.3 - Wachunga - 2005-12-19 - (Near Fantastica)
# Version 1.4 - Prexus - 2006-03-02 - (SephirothSpawn)
# Version 1.5 - Jimme Reashu - 2006-03-25 - (Near Fantastica)
# Version 2.0 - SephirothSpawn / Trickster /
# Der Drake / Sandgolem - 2007-02-22 - (SDK Team)
# Version 2.1 - tibuda /alexanderpas / Mr. Mo - 2007-02-25 - (SephirothSpawn)
# Version 2.2 - SephirothSpawn / Trickster /
# tibuda - 2007-04-04 - (SDK Team)
# Version 2.3 - Rataime / SephirothSpawn /
# Trickster / vgvgf - 2007-07-22 - (SDK Team)
#==============================================================================

Include_SDK_Parts = [2, 3, 4, 5]

require 'RSC Hidden Files/The RMXP Standard Development Kit 2.3'
zum Lesen den Text mit der Maus markieren


Spoiler: Method &amp; Class Library 2.1
#==============================================================================
# ** Method and Class Library - RSC Setup
#------------------------------------------------------------------------------
# Build Date - 9-17-2006
# Version 1.0 - Trickster - 9-17-2006
# Version 1.1 - Trickster - 10-03-2006
# Version 1.2 - Trickster - Selwyn - 11-01-2006
# Version 1.3 - Trickster - 11-10-2006
# Version 1.4 - Trickster - 12-1-2006
# Version 1.5 - Trickster - Yeyinde - Lobosque - 1-1-2007
# Version 2.0 - MACL Authors - 4-26-2007
# Version 2.1 - MACL Authors - 7-22-2007
#==============================================================================

#==============================================================================
# ** General Method & Class Library Settings
#==============================================================================

module MACL
#-------------------------------------------------------------------------
# * Pose Names for Charactersets
#-------------------------------------------------------------------------
Poses = ['down', 'left', 'right', 'up']
#-------------------------------------------------------------------------
# * Number of Frames Per Pose for charactersets
#-------------------------------------------------------------------------
Frames = 4
#--------------------------------------------------------------------------
# * Real Elements
#--------------------------------------------------------------------------
Real_Elements = 1, 2, 3, 4, 5, 6, 7, 8
#-------------------------------------------------------------------------
# * Version Number (Do not Touch)
#-------------------------------------------------------------------------
Version = 2.1
#-------------------------------------------------------------------------
# * Loaded Libraries (Do not Touch)
#-------------------------------------------------------------------------
Loaded = []
end

#==============================================================================
# ** Action Test Setup
#==============================================================================

class Game_BattleAction
#-------------------------------------------------------------------------
# * Attack Using
# - Set this to the basic ids that perform an attack effect
#-------------------------------------------------------------------------
ATTACK_USING = [0]
#-------------------------------------------------------------------------
# * Skill Using
# - Set this to the kinds that perform an skill effect
#-------------------------------------------------------------------------
SKILL_USING = [1]
#-------------------------------------------------------------------------
# * Defend Using
# - Set this to the basic ids that perform an defend effect
#-------------------------------------------------------------------------
DEFEND_USING = [1]
#-------------------------------------------------------------------------
# * Item Using
# - Set this to the kinds that perform a item using effect
#-------------------------------------------------------------------------
ITEM_USING = [2]
#-------------------------------------------------------------------------
# * Escape Using
# - Set this to the basic ids that perform an escape effect
#-------------------------------------------------------------------------
ESCAPE_USING = [2]
#-------------------------------------------------------------------------
# * Wait Using
# - Set this to the basic ids that perform a wait effect
#-------------------------------------------------------------------------
WAIT_USING = [3]
end

#==============================================================================
# ** Animated Autotile Settings
#==============================================================================

RPG::Cache::Animated_Autotiles_Frames = 16

#==============================================================================
# ** Bitmap Settings
#==============================================================================

class Bitmap
#--------------------------------------------------------------------------
# * Bitmap.draw_equip settings
#
# Icon Type Settings When Item Not Equipped
# - Draw_Equipment_Icon_Settings = { type_id => icon_name, ... }
#
# Default Type Icons
# - Draw_Equipment_Icon_Settings.default = icon_name
#--------------------------------------------------------------------------
Draw_Equipment_Icon_Settings = { 0 => '001-Weapon01', 1 => '009-Shield01',
2 => '010-Head01', 3 => '014-Body02', 4 => '016-Accessory01'
}
Draw_Equipment_Icon_Settings.default = '001-Weapon01'
#--------------------------------------------------------------------------
# * Bitmap.draw_blur settings
#
# Master Default Settings
# - Default_Blur_Settings = { setting_key => setting, ... }
#
# Class Default Settings
# - @@default_blur_settings = { setting_key => setting, ... }
#
# Settings
# 'offset' - Pixels to be offseted when bluring
# 'spacing' - Number of times to offset blur
# 'opacity' - Max Opacity of blur
#--------------------------------------------------------------------------
Default_Blur_Settings = {'offset' => 2, 'spacing' => 1, 'opacity' => 255}
@@default_blur_settings = {'offset' => 2, 'spacing' => 1, 'opacity' => 255}
#--------------------------------------------------------------------------
# * Bitmap.draw_anim_sprite settings
#
# Master Default Settings
# - Default_Anim_Sprite_Settings = { setting_key => setting, ... }
#
# Class Default Settings
# - @@default_anim_sprite_settings = { setting_key => setting, ... }
#
# Settings
# 'f' - Frame count reset
# 'w' - Number of frames wide in sprite set
# 'h' - Height of frames wide in sprite set
#--------------------------------------------------------------------------
Default_Anim_Sprite_Settings = {'f' => 8, 'w' => 4, 'h' => 4}
@@default_anim_sprite_settings = {'f' => 8, 'w' => 4, 'h' => 4}
end

#==============================================================================
# ** RPG::State
#==============================================================================

class RPG::State
#--------------------------------------------------------------------------
# * Normal Icon (Filename for normal (no states))
#--------------------------------------------------------------------------
Normal_Icon = '050-Skill07'
#--------------------------------------------------------------------------
# * Icon Names
#
# Icon_Name = { state_id => 'filename', ... }
#
# Use Nil to default back to state name
#--------------------------------------------------------------------------
Icon_Name = {
1 => '046-Skill03',
2 => 'Stop',
3 => 'Venom',
4 => 'Darkness',
5 => 'Mute',
6 => 'Confused',
7 => 'Sleep',
8 => 'Paralysis',
9 => '047-Skill04',
10 => '047-Skill04',
11 => 'Slow',
12 => '047-Skill04',
13 => '045-Skill06',
14 => '045-Skill06',
15 => '045-Skill06',
16 => '045-Skill06'
}
Icon_Name.default = nil
end

#------------------------------------------------------------------------------
# ** Reqire MACL 2.1
#------------------------------------------------------------------------------

require 'RSC Hidden Files/The Method and Class Library 2.1'

#------------------------------------------------------------------------------
# ** SDK Log
#------------------------------------------------------------------------------

if Object.const_defined?(:SDK)
SDK.log('Method & Class Library', 'MACL Authors', 2.1, '??????????')
end
zum Lesen den Text mit der Maus markieren


Spoiler: Perspective Sprites

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
#==============================================================================
# ** Perspective Sprites
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2007-01-05
# SDK : Version 2.0+, Parts I & II
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 ---------------------------------------------------- (2007-01-05)
#------------------------------------------------------------------------------
# * Requirements :
#
#   Method & Class Library (2.1+)
#------------------------------------------------------------------------------
# * Description :
#
#   This script was designed to manipulate event sprites to appear with
#   perspective. You can define perspective points on the map and scaling for
#   each perspective point. You may also define perspective regions, so when
#   an event is : at a specific point ; within a defined rectangle ; within a
#   defined circle, they will have altered perspective points and scaling.
#
#   How it works:
#
#   The events will zoom the distance they are from the defined perspective
#   point divided by the scale. If the focus point is 400 pixels away and
#   the scale is 800, the zoom will be 400 / 800. So the sprite will be
#   half of it's original size.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To define focus points, scales and regions, refer to Customization.
#   To get the current zoom of an event, refer to Syntax.
#------------------------------------------------------------------------------
# * Customization :
#
#   Focus Points
#    - Focus_Points = { map_id => [real_x, real_y], ... }
#
#   Scaling
#    - Scaling      = { map_id => n, ... }
#
#   Regions alter the focus points & scaling for characters in these regions
#
#   Direct Region (Specific Point)
#    - Drct_Regions = {
#        map_id => { [x, y] => [real_x, real_y, scaling], ...},
#        ...
#      }
#   Regions (Rectangular)
#    - Rect_Regions = { 
#        map_id => { [x, y, w, h] => [real_x, real_y, scaling], ... },
#        ...
#      }
#
#   Regions (Circular)
#    - Circ_Regions = {
#        map_id => { [x, y, r] => [real_x, real_y, scaling], ... },
#        ... 
#      }
#------------------------------------------------------------------------------
# * Syntax :
#
#   Getting Curren Zoom of character (Returns Float)
#    - <game_character>.zoom?
#==============================================================================
 
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Perspective Sprites', 'SephirothSpawn', 1, '2007-01-05')
SDK.check_requirements(2.0, [2], {'Method & Class Library' => 2.1})
 
#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Perspective Sprites')
 
#==============================================================================
# ** Perspective
#==============================================================================
 
module Perspective
  #--------------------------------------------------------------------------
  # * Options
  #
  #  ~ Focus Points
  #     - Focus_Points = { map_id => [real_x, real_y], ... }
  #
  #  ~ Scaling
  #     - Scaling      = { map_id => n, ... }
  #
  #  Regions alter the focus points & scaling for characters in these regions
  #
  #  ~ Direct Region (Specific Point)
  #     - Drct_Regions = {
  #         map_id => { [x, y] => [real_x, real_y, scaling], ...},
  #         ...
  #       }
  #  ~ Regions (Rectangular)
  #     - Rect_Regions = { 
  #         map_id => { [x, y, w, h] => [real_x, real_y, scaling], ... },
  #         ...
  #       }
  #
  #  ~ Regions (Circular)
  #     - Circ_Regions = {
  #         map_id => { [x, y, r] => [real_x, real_y, scaling], ... },
  #         ... 
  #       }
  #
  #--------------------------------------------------------------------------
  Focus_Points = {
    2 => [320, - 480]
  }
  Scaling      = {
    2 => 640
  }
  Drct_Regions = {
    # Example
    # 1 => { [3, 3] => [0, 0, 200] }
  }
  Rect_Regions = {
    # Example
    # 1 => { [4, 4, 5, 5] => [1000, -200, 500] }
  }
  Circ_Regions = {
  }
  #--------------------------------------------------------------------------
  # * Get Focus Point
  #--------------------------------------------------------------------------
  def self.focus_point?(map_id)
    return Focus_Points.has_key?(map_id) ? Focus_Points[map_id] : nil
  end
  #--------------------------------------------------------------------------
  # * Get Scaling
  #--------------------------------------------------------------------------
  def self.scaling?(map_id)
    return Scaling.has_key?(map_id) ? Scaling[map_id] : 1
  end
  #--------------------------------------------------------------------------
  # * Direct Regions
  #--------------------------------------------------------------------------
  def self.drct_regions?(map_id)
    return Drct_Regions.has_key?(map_id) ? Drct_Regions[map_id] : {}
  end
  #--------------------------------------------------------------------------
  # * Rect Regions
  #--------------------------------------------------------------------------
  def self.rect_regions?(map_id)
    return Rect_Regions.has_key?(map_id) ? Rect_Regions[map_id] : {}
  end
  #--------------------------------------------------------------------------
  # * Circ Regions
  #--------------------------------------------------------------------------
  def self.circ_regions?(map_id)
    return Circ_Regions.has_key?(map_id) ? Circ_Regions[map_id] : {}
  end
  #--------------------------------------------------------------------------
  # * Focus & Scale at Point
  #--------------------------------------------------------------------------
  def self.focus_and_scale?(map_id, x, y)
    # Sets Key
    key = [map_id, x, y]
    # If Search Contains Key
    if @searches.has_key?(key)
      # Returns Saved Data
      return @searches[key]
    end
    # Checks Direct Locations
    self.drct_regions?(map_id).each do |xy, xys|
      return xys if x == xy[0] && y == xy[0]
    end
    # Checks Rect Regions
    self.rect_regions?(map_id).each do |xywh, xys|
      x_, y_ = xywh[0],      xywh[1]
      w, h = xywh[2], xywh[3]
      return xys if VR.in_rect_range?(x, y, x_, y_, w, h)
    end
    # Checks Circular Regions
    self.circ_regions?(map_id).each do |xyr, xys|
      return xys if VR.in_range?(x, y, xyr[0], xyr[1], xyr[2])
    end
    # Save & Return Map Scaling
    f, s = self.focus_point?(map_id), self.scaling?(map_id)
    return (f.nil? ? [nil, nil, 1] : [f[0], f[1], s])
  end
  #--------------------------------------------------------------------------
  # * Get Searches (DO NOT ALTER)
  #--------------------------------------------------------------------------
  # Create Search Data
  @searches = {}
  # Load Map Data
  load_data('Data/MapInfos.rxdata').keys.each do |map_id|
    # Get Map Data
    map = load_data(sprintf('Data/Map%03d.rxdata', map_id))
    # Pass Through Map Dimensions
    for x in 0...map.width
      for y in 0...map.height
        # Save Map Scale
        @searches[[map_id, x, y]] = self.focus_and_scale?(map_id, x, y)
      end
    end
  end
end
 
#==============================================================================
# ** Game_Map
#==============================================================================
 
class Game_Map
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :p_focus_point
  attr_reader :p_scaling
  attr_reader :p_drct_regs
  attr_reader :p_rect_regs
  attr_reader :p_circ_regs
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_spritepersp_gmap_suld,    :setup_load
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup_load
    # Original Setup Map Data
    seph_spritepersp_gmap_suld
    # Sets Perspective Properties
    @p_focus_point = Perspective.focus_point?(@map_id)
    @p_scaling     = Perspective.scaling?(@map_id)
    @p_drct_regs   = Perspective.drct_regions?(@map_id)
    @p_rect_regs   = Perspective.rect_regions?(@map_id)
    @p_circ_regs   = Perspective.circ_regions?(@map_id)
  end
  #--------------------------------------------------------------------------
  # * Focus and Scale?
  #--------------------------------------------------------------------------
  def focus_and_scale?(x, y)
    return Perspective.focus_and_scale?(@map_id, x, y)
  end
end
 
#==============================================================================
# ** Game_Character
#==============================================================================
 
class Game_Character
  #--------------------------------------------------------------------------
  # * Perspective Zoom?
  #--------------------------------------------------------------------------
  def perspective_zoom?
    # Gets Focus Points
    f_x, f_y, scale = $game_map.focus_and_scale?(@x, @y)
    # Calculates X & Y Difference
    x_diff = (@real_x / 4 - f_x).abs
    y_diff = (@real_y / 4 - f_y).abs
    # Calculates Distance From Focus
    distance = Math.sqrt(x_diff ** 2 + y_diff ** 2)
    # Returns Zoom
    return distance / scale.to_f
  end
end
 
#==============================================================================
# ** Sprite_Character
#==============================================================================
 
class Sprite_Character
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_spritepersp_schr_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Original Update
    seph_spritepersp_schr_update
    # Unless No Focus Point
    unless $game_map.p_focus_point.nil?
      # If Visible
      if self.visible
        # Sets Zoom
        zoom = @character.perspective_zoom?
        self.zoom_x = zoom
        self.zoom_y = zoom
      end
    end
  end
end
 
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
zum Lesen den Text mit der Maus markieren
»Яογal Sίη°« hat folgende Datei angehängt:

Neo-Bahamut

Himmelsgleicher

Motto: Wer anderen eine Bratwurst brät, der hat ein Bratwurstbratgerät.

  • Nachricht senden

3

Donnerstag, 8. April 2010, 10:58

Und hier ein Skript, was ein kleines bisschen kürzer ist xD"

Ruby Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Sprite_Character #von Neo-Bahamut >:3
  # Alle Charaktere (true) oder nur der Spieler (false) ?
  Zoom_AllChars = false
 
  # Zoom-Stufe am oberen Bildschirmrand (in Prozent)
  Zoom_Top = 75
  # Zoom-Stufe am unteren Bildschirmrand
  Zoom_Down = 130
 
  # -------------------------
 
  alias_method :nb_aliasmethod_smallzoomaddon_spritecharacter_update, :update
  def update
	nb_aliasmethod_smallzoomaddon_spritecharacter_update
	update_nb_zoom
  end
 
  def update_nb_zoom
	return if !(Zoom_AllChars or self.character.is_a?(Game_Player))
	y = self.y
	dif = Zoom_Down - Zoom_Top
	per = y / 480.0
	zoom = (Zoom_Top + (dif*per)) / 100.0
	self.zoom_x = self.zoom_y = zoom
  end
end
Spoiler: Wurstinator
zum Lesen den Text mit der Maus markieren

Spoiler: Lazer-Wurst
zum Lesen den Text mit der Maus markieren

Spoiler: Hallowurst
zum Lesen den Text mit der Maus markieren

Social Bookmarks