• Anmelden

lucien

Schaffender

  • »lucien« ist der Autor dieses Themas

Motto: California potato power! Ketchup rains all over the world.

  • Nachricht senden

1

Dienstag, 11. Juli 2006, 16:45

Credits stehen im Skript.

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
// #==============================================================================
# ■ Sprite_Shadow (Sprite_Ombre )
# Based on Genzai Kawakami's shadows, dynamisme&features by Rataime, extra features Boushy
#==============================================================================
 
CATERPILLAR_COMPATIBLE = true
SHADOW_WARN = true
 
class Game_Party
 attr_reader :characters
end
 
class Sprite_Shadow < RPG::Sprite
 
 attr_accessor :character
 
 def initialize(viewport, character = nil,id=0)
   super(viewport)
   params=$shadow_spriteset.shadows[id]
   @source=params[0]
   @anglemin=0
   @anglemin=params[1] if params.size>1
   @anglemax=0
   @anglemax=params[2] if params.size>2
   @self_opacity=100
   @self_opacity=params[4] if params.size>4
   @distancemax=350
   @distancemax=params[3] if params.size>3
   @character = character
   update
 end
 
 def update
 
   if !in_range?(@character, @source, @distancemax)
     self.opacity=0
     return
   end
   super
 
   if @tile_id != @character.tile_id or
      @character_name != @character.character_name or
      @character_hue != @character.character_hue
     @tile_id = @character.tile_id
     @character_name = @character.character_name
     @character_hue = @character.character_hue
     if @tile_id >= 384
       self.bitmap = RPG::Cache.tile($game_map.tileset_name,
         @tile_id, @character.character_hue)
       self.src_rect.set(0, 0, 32, 32)
       self.ox = 16
       self.oy = 32
     else
       self.bitmap = RPG::Cache.character(@character.character_name,
         @character.character_hue)
       @cw = bitmap.width / 4
       @ch = bitmap.height / 4
       self.ox = @cw / 2
       self.oy = @ch
     end
   end
   self.visible = (not @character.transparent)
   if @tile_id == 0
     sx = @character.pattern * @cw
     sy = (@character.direction - 2) / 2 * @ch
     if self.angle>90 or angle<-90
       if @character.direction== 6
              sy = ( 4- 2) / 2 * @ch
       end
       if @character.direction== 4
              sy = ( 6- 2) / 2 * @ch
       end
       if @character.direction== 2
              sy = ( 8- 2) / 2 * @ch
       end
       if @character.direction== 8
              sy = ( 2- 2) / 2 * @ch
       end
     end
     self.src_rect.set(sx, sy, @cw, @ch)
   end
   self.x = @character.screen_x
   self.y = @character.screen_y-5
   self.z = @character.screen_z(@ch)-1
   self.blend_type = @character.blend_type
   self.bush_depth = @character.bush_depth
   if @character.animation_id != 0
     animation = $data_animations[@character.animation_id]
     animation(animation, true)
     @character.animation_id = 0
   end
   @deltax=@source.screen_x-self.x
   @deltay= @source.screen_y-self.y
   self.color = Color.new(0, 0, 0)
   @distance = ((@deltax ** 2) + (@deltay ** 2))
   self.opacity = @self_opacity*13000/((@distance*370/@distancemax)+6000)
   self.angle = 57.3*Math.atan2(@deltax, @deltay )
   @angle_trigo=self.angle+90
   if @angle_trigo<0
       @angle_trigo=360+@angle_trigo
    end
   if @anglemin !=0 or @anglemax !=0
      if (@angle_trigo<@anglemin or @angle_trigo>@anglemax) and @anglemin<@anglemax
        self.opacity=0
        return
      end
      if (@angle_trigo<@anglemin and @angle_trigo>@anglemax) and @anglemin>@anglemax
        self.opacity=0
        return
      end    
    end
 end
 
 def in_range?(element, object, range)# From Near's Anti Lag Script, edited
   x = (element.screen_x - object.screen_x) * (element.screen_x - object.screen_x)
   y = (element.screen_y - object.screen_y) * (element.screen_y - object.screen_y)
   r = x + y
   if r <= (range * range)
      return true
   else
     return false
   end
 end
 
end
 
#===================================================
# &#9660; CLASS Sprite_Character edit
#===================================================
 
class Sprite_Character < RPG::Sprite
 alias shadow_initialize initialize
 
 def initialize(viewport, character = nil)
   @character = character
   super(viewport)
   @ombrelist=[]
   if character.is_a?(Game_Event) and $shadow_spriteset.shadows!=[]
     params = XPML_read("Shadow",@character.id,4)
     if params!=nil
       for i in 0...$shadow_spriteset.shadows.size
         @ombrelist.push(Sprite_Shadow.new(viewport, @character,i))
       end
     end
   end
   if character.is_a?(Game_Player) and $shadow_spriteset.shadows!=[]
     for i in 0...$shadow_spriteset.shadows.size
       @ombrelist.push(Sprite_Shadow.new(viewport, $game_player,i))
     end
     #===================================================
     # &#9679; Compatibility with fukuyama's caterpillar script
     #===================================================
     if CATERPILLAR_COMPATIBLE and $game_party.characters!=nil
       for member in $game_party.characters
         for i in 0...$shadow_spriteset.shadows.size
           @ombrelist.push(Sprite_Shadow.new(viewport, member,i))
         end
       end
     end
     #===================================================
     # &#9679; End of the compatibility
     #===================================================
   end
   shadow_initialize(viewport, @character)
 end
 
 alias shadow_update update
 
 def update
   shadow_update
   if @ombrelist!=[]
     for i in 0...@ombrelist.size
       @ombrelist[i].update
     end
   end
 end  
 
end
 
#===================================================
# &#9660; CLASS Game_Event edit
#===================================================
class Game_Event
 attr_accessor :id
end
 
#===================================================
# &#9660; CLASS Spriteset_Map edit
#===================================================
class Spriteset_Map
 attr_accessor :shadows
 alias shadow_initialize initialize
 
 def initialize
   $shadow_spriteset=self
   @shadows=[]
   warn=false
   for k in $game_map.events.keys.sort
     warn=true if ($game_map.events[k].list!=nil and $game_map.events[k].list[0].code == 108 and ($game_map.events[k].list[0].parameters == ["s"] or $game_map.events[k].list[0].parameters == ["o"]))
     params = XPML_read("Shadow Source",k,4)
     $shadow_spriteset.shadows.push([$game_map.events[k]]+params) if params!=nil
   end
   p "Warning : At least one event on this map uses the obsolete way to add shadows" if warn == true and SHADOW_WARN
   shadow_initialize
 end  
end
 
 
 
#===================================================
# &#9660; XPML Definition, by Rataime, using ideas from Near Fantastica
#
#   Returns nil if the markup wasn't present at all,
#   returns [] if there wasn't any parameters, else
#   returns a parameters list with "int" converted as int
#   eg :
#   begin first
#   begin second
#   param1 1
#   param2 two
#   begin third
#   anything 3
#
#   p XPML_read("first", event_id) -> []
#   p XPML_read("second", event_id) -> [1,"two"]
#   p XPML_read("third", event_id) -> [3]
#   p XPML_read("forth", event_id) -> nil
#===================================================
 
 def XPML_read(markup,event_id,max_param_number=0)
   parameter_list = nil
   event=$game_map.events[event_id]
   return if event.list==nil
     for i in 0...event.list.size
       if event.list[i].code == 108 and event.list[i].parameters[0].downcase == "begin "+markup.downcase
         parameter_list = [] if parameter_list == nil
         for j in i+1...event.list.size
           if event.list[j].code == 108
             parts = event.list[j].parameters[0].split
             if parts.size!=1 and parts[0].downcase!="begin"
               if parts[1].to_i!=0 or parts[1]=="0"
                 parameter_list.push(parts[1].to_i)
               else
                 parameter_list.push(parts[1])
               end
             else
               return parameter_list
             end
           else
             return parameter_list
           end
           return parameter_list if max_param_number!=0 and j==i+max_param_number
         end
       end
     end
   return parameter_list
 end





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
// #==============================================================================
# &#9632; Sprite_Sun
# # Based on Sprite_Shadow, modified by Rataime
#==============================================================================
 
CATERPILLAR_COMPATIBLE = true
SUN_WARN =true
 
class Game_Party
 attr_reader :characters
end
 
class Sprite_Sun < RPG::Sprite
 attr_accessor :character          
 
 def initialize(viewport, character = nil,id=0)
   super(viewport)
   @character = character
   params=$sun_spriteset.sun[id]
   self_angle=45
   self_angle=params[0] if params.size>0
   self_opacity=128
   self_opacity=params[1] if params.size>1
   @self_angle=self_angle
   @self_opacity=self_opacity
   update
 end
 
 def update
   super
   if @tile_id != @character.tile_id or
      @character_name != @character.character_name or
      @character_hue != @character.character_hue
     @tile_id = @character.tile_id
     @character_name = @character.character_name
     @character_hue = @character.character_hue
     if @tile_id >= 384
       self.bitmap = RPG::Cache.tile($game_map.tileset_name,
         @tile_id, @character.character_hue)
       self.src_rect.set(0, 0, 32, 32)
       self.ox = 16
       self.oy = 32
     else
       self.bitmap = RPG::Cache.character(@character.character_name,
         @character.character_hue)
       @cw = bitmap.width / 4
       @ch = bitmap.height / 4
       self.ox = @cw / 2
       self.oy = @ch
     end
   end
 
   self.visible = (not @character.transparent)
 
   if @tile_id == 0
    sx = @character.pattern * @cw
    @direct=@character.direction
 
     if self.angle>90 or angle<-90
 
       if @direct== 6
              sy = ( 4- 2) / 2 * @ch
     end
     if @direct== 4
              sy = ( 6- 2) / 2 * @ch
       end
       if @direct != 4 and @direct !=6
       sy = (@character.direction - 2) / 2 * @ch
         end
       else
    sy = (@character.direction - 2) / 2 * @ch
    end
      self.src_rect.set(sx, sy, @cw, @ch)
   end
   self.x = @character.screen_x
   self.y = @character.screen_y-5
   self.z = @character.screen_z(@ch)-1
   self.opacity = @self_opacity
   self.blend_type = @character.blend_type
   self.bush_depth = @character.bush_depth
   if @character.animation_id != 0
     animation = $data_animations[@character.animation_id]
     animation(animation, true)
     @character.animation_id = 0
   end
   self.angle = @self_angle.to_i-90
   self.color = Color.new(0, 0, 0)
 end
end
 
#===================================================
# &#9660; CLASS Sprite_Character edit
#===================================================
 
class Sprite_Character < RPG::Sprite
 alias sun_initialize initialize
 
 def initialize(viewport, character = nil)
   @character = character
   super(viewport)
   @sunlist=[]
   if character.is_a?(Game_Event) and $sun_spriteset.sun!=[]
     params = XPML_read("Shadow",@character.id,2)
     if params!=nil
       for i in 0...$sun_spriteset.sun.size
         @sunlist.push(Sprite_Sun.new(viewport, @character,i))
       end
     end
   end
  if character.is_a?(Game_Player) and $sun_spriteset.sun!=[]
     for i in 0...$sun_spriteset.sun.size
       @sunlist.push(Sprite_Sun.new(viewport, $game_player,i))
     end
     #===================================================
     # &#9679; Compatibility with fukuyama's caterpillar script
     #===================================================
     if CATERPILLAR_COMPATIBLE and $game_party.characters!=nil
       for member in $game_party.characters
         for i in 0...$sun_spriteset.sun.size
           @sunlist.push(Sprite_Sun.new(viewport, member,i))
         end
       end
     end
     #===================================================
     # &#9679; End of the compatibility
     #===================================================
   end
   sun_initialize(viewport, @character)
 end
 
 alias sun_update update
 
 def update
   sun_update
   if @sunlist!=[]
     for i in 0...@sunlist.size
       @sunlist[i].update
     end
   end
 end  
 
end
 
#===================================================
# &#9660; CLASS Game_Event edit
#===================================================
class Game_Event
 attr_accessor :id
end
 
#===================================================
# &#9660; CLASS Spriteset_Map edit
#===================================================
class Spriteset_Map
 attr_accessor :sun
 alias sun_initialize initialize
 
 def initialize
   @sun=[]
   $sun_spriteset=self
   warn=false
   for k in $game_map.events.keys.sort
     warn=true if ($game_map.events[k].list!=nil and $game_map.events[k].list[0].code == 108 and ($game_map.events[k].list[0].parameters == ["sun"] or $game_map.events[k].list[0].parameters == ["o"]))
     params = XPML_read("Sun",k,2)
     $sun_spriteset.sun.push(params) if params!=nil
   end
   p "Warning : At least one event on this map uses the obsolete way to add a sun effect" if warn == true and SUN_WARN
   sun_initialize
 end  
end
 
 
 
#===================================================
# &#9660; XPML Definition, by Rataime, using ideas from Near Fantastica
#
#   Returns nil if the markup wasn't present at all,
#   returns [] if there wasn't any parameters, else
#   returns a parameters list with "int" converted as int
#   eg :
#   begin first
#   begin second
#   param1 1
#   param2 two
#   begin third
#   anything 3
#
#   p XPML_read("first", event_id) -> []
#   p XPML_read("second", event_id) -> [1,"two"]
#   p XPML_read("third", event_id) -> [3]
#   p XPML_read("forth", event_id) -> nil
#===================================================
 
 def XPML_read(markup,event_id,max_param_number=0)
   parameter_list = nil
   event=$game_map.events[event_id]
   return if event.list==nil
     for i in 0...event.list.size
       if event.list[i].code == 108 and event.list[i].parameters[0].downcase == "begin "+markup.downcase
         parameter_list = [] if parameter_list == nil
         for j in i+1...event.list.size
           if event.list[j].code == 108
             parts = event.list[j].parameters[0].split
             if parts.size!=1 and parts[0].downcase!="begin"
               if parts[1].to_i!=0 or parts[1]=="0"
                 parameter_list.push(parts[1].to_i)
               else
                 parameter_list.push(parts[1])
               end
             else
               return parameter_list
             end
           else
             return parameter_list
           end
           return parameter_list if max_param_number!=0 and j==i+max_param_number
         end
       end
     end
   return parameter_list
 end




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
// #================================
# &#9632; Light Effects
#================================
# &#12288;By: Near Fantastica
#   Date: 28.06.05
#   Version: 3
#================================
 
class Spriteset_Map
 #--------------------------------------------------------------
 alias les_spriteset_map_initalize initialize
 alias les_spriteset_map_dispose dispose
 alias les_spriteset_map_update update
 #--------------------------------------------------------------
 def initialize
   @light_effects = []
   setup_lights
   les_spriteset_map_initalize
   update
 end
 #--------------------------------------------------------------
 def dispose
   les_spriteset_map_dispose
   for effect in @light_effects
     effect.light.dispose
   end
   @light_effects = []
 end
 #--------------------------------------------------------------
 def update
   les_spriteset_map_update
   update_light_effects
 end
 #--------------------------------------------------------------
 def setup_lights
   for event in $game_map.events.values
     next if event.list == nil
     for i in 0...event.list.size
       if event.list[i].code == 108 and event.list[i].parameters == ["Light Effects"]
         type = event.list[i+1].parameters.to_s
         case type.upcase!
         when "GROUND"
           light_effects = Light_Effect.new(event,type)
           light_effects.light.zoom_x = 200 / 100.0
           light_effects.light.zoom_y = 200 / 100.0
           light_effects.light.opacity = 50
           @light_effects.push(light_effects)
         when "FIRE"
           light_effects = Light_Effect.new(event,type)
           light_effects.light.zoom_x = 300 / 100.0
           light_effects.light.zoom_y = 300 / 100.0
           light_effects.light.opacity = 100
           @light_effects.push(light_effects)
         when "LAMPPOST"
           light_effects = Light_Effect.new(event,"LEFT LAMP POST")
           light_effects.light.opacity = 100
           @light_effects.push(light_effects)
           light_effects = Light_Effect.new(event,"RIGHT LAMP POST")
           light_effects.light.opacity = 100
           @light_effects.push(light_effects)
         when "LEFTLANTERN"
           light_effects = Light_Effect.new(event,type)
           light_effects.light.opacity = 150
           @light_effects.push(light_effects)
         when "RIGHTLANTERN"
           light_effects = Light_Effect.new(event,type)
           light_effects.light.opacity = 150
           @light_effects.push(light_effects)
         end
       end
     end
   end
   for effect in @light_effects
     case effect.type
     when "GROUND"
       effect.light.x = (effect.event.real_x - 200 - $game_map.display_x) / 4
       effect.light.y = (effect.event.real_y - 200 - $game_map.display_y) / 4
     when "FIRE"
       effect.light.x = (effect.event.real_x - 300 - $game_map.display_x) / 4
       effect.light.y = (effect.event.real_y - 300 - $game_map.display_y) / 4
     when "LEFT LAMP POST"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 5
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
     when "RIGHT LAMP POST"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 25
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
     when "LEFTLANTERN"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 20
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
     when "RIGHTLANTERN"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 10
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
     end
   end
 end
 #--------------------------------------------------------------
 def update_light_effects
   for effect in @light_effects
     next if not in_range?(effect.event)
     case effect.type
     when "GROUND"
       effect.light.x = (effect.event.real_x - 200 - $game_map.display_x) / 4
       effect.light.y = (effect.event.real_y - 200 - $game_map.display_y) / 4
     when "FIRE"
       effect.light.x = (effect.event.real_x - 300 - $game_map.display_x) / 4
       effect.light.y = (effect.event.real_y - 300 - $game_map.display_y) / 4
     when "LEFT LAMP POST"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 5
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
     when "RIGHT LAMP POST"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 25
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
     when "LEFTLANTERN"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 20
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
     when "RIGHTLANTERN"
       effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 10
       effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
     end
   end
 end
 #--------------------------------------------------------------
 def in_range?(object)
   screne_x = $game_map.display_x
   screne_x -= 256
   screne_y = $game_map.display_y
   screne_y -= 256
   screne_width = $game_map.display_x
   screne_width += 2816
   screne_height = $game_map.display_y
   screne_height += 2176
   return false if object.real_x <= screne_x
   return false if object.real_x >= screne_width
   return false if object.real_y <= screne_y
   return false if object.real_y >= screne_height
   return true
 end
end
 
#================================
# &#9632; Light Effects Class
#================================
 
class Light_Effect
 #--------------------------------------------------------------
 attr_accessor :light
 attr_accessor :event
 attr_accessor :type
 #--------------------------------------------------------------
 def initialize(event, type)
   @light = Sprite.new
   @light.bitmap = RPG::Cache.picture("LE.PNG")
   @light.visible = true
   @light.z = 1000
   @event = event
   @type = type
 end
end




Here's how to use it :

- To create a source, the first command of this event must be a comment with "begin shadow source" inside (without ")
- To add shadows to an event, the first command of this event must be a comment with "begin shadow" inside (without ")
- To limit the source to an angle, add a second and third comment with only the min and max value of this angle, based on the trigonometric circle in degrees, this way :
"anglemin 0" (without ")
"anglemax 270" (without ")
- To limit the distance, specify the maximum distance in a forth comment. The value is calculted in pixels, then this figure shoud be close to 300-500, eg :
"distancemax 270" (without ")

Example :
Comment "begin shadow"
Comment "0"
Comment "0"
Comment "250"
Comment "110"

To create a sun, create an event which first event is a comment with "begin sun" inside. Optional : The second parameter is its angle (see above) and its opacity (dark<30, median around 120, light >200)

Note : When the shadows fall on opposite facing walls, they will be displayed. To prevent that, make the walls priority 1. That makes the shadow stay under them.

Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

2

Dienstag, 11. Juli 2006, 16:52

Hab nicht ganz verstanden wie ich die Sonne, also Lichtquelle erstellen kann,..., könntest du mir das bitte auf deutsch übersetzen?? In Luxemburg lernt man Englisch erst, umgerechnet in Deustcheschule, 9 Jahr,... .
Bild

lucien

Schaffender

  • »lucien« ist der Autor dieses Themas

Motto: California potato power! Ketchup rains all over the world.

  • Nachricht senden

3

Dienstag, 11. Juli 2006, 16:55

machst einfach ein event irgendwo auf der karte und schreibst ein comment: begin sun
noch ein comment: Zahl zwischen 1 und 360
noch ein comment: Zahl zwischen 0 und 255

Bei den Schatten reicht dann einfach comment: begin shadow
Hast du das Script für Lichteffekte, dann erübrigen sich die andern Zahlen bei begin shadow.

Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

4

Dienstag, 11. Juli 2006, 17:20

Bei kir kommt stehen; Spryde Shadow Syntax Error,...
Könntet du plz ein bzGame machn bitte??ganz schnell??!!
Bild

lucien

Schaffender

  • »lucien« ist der Autor dieses Themas

Motto: California potato power! Ketchup rains all over the world.

  • Nachricht senden

5

Dienstag, 11. Juli 2006, 17:25

Bevor ichs mache noch 2 Fragen:

Habs etwas schlecht gepostet, aber hast du gesehen, dass es 2 scripts sind?

Falls ja. dann hat es vielleicht etwas mit dem light effects skript zu tun? Ich glaub aber das braucht man nicht dazu.
Ich hab die beiden scripts aus meinem Spiel kopiert...
Sollte eigentlich wirklich gehen...
was für ein error kommt genau?

Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

6

Dienstag, 11. Juli 2006, 18:54

Spryte_Shadow Syntax Error und da steht dann noch 204,..., ich hab das ganze script(also die beiden scripte) in einem script geklebt,...
Bild

Emi

Schlitzohr

Motto: router rip!

  • Nachricht senden

7

Dienstag, 11. Juli 2006, 19:04

Du darfst die Skripte nicht zusammen in ein Script tun^^ das ist alles =)

mfg Emixp

8

Dienstag, 11. Juli 2006, 19:15

So ich poste sie nochmal.

@Kiro benutze lieber die Board codes wie

[button="BENUTZ MICH"][/button] und

Quellcode

1
Ich bin ein Code benutze mich^^


Den Boardcode siehste wenn du mich zitierst, schaus dir mal an ^^.
Oder geh unter deiner Beitragerstellung auf BoardCode dann siehst du alle.

Code empfehle ich besonders, weil durch normales kopieren von Skripten die Syntaxstrukturen zerstört werden können.

[button="Shadow"]

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
#==============================================================================
# &#9632; Sprite_Shadow (Sprite_Ombre )
# Based on Genzai Kawakami's shadows, dynamisme&features by Rataime, extra features Boushy
#==============================================================================
 
CATERPILLAR_COMPATIBLE = true
 
class Game_Party
 attr_reader :characters
end
 
class Sprite_Shadow < RPG::Sprite
 
 attr_accessor :character
 
 def initialize(viewport, character = nil,source = nil,anglemin=0,anglemax=0,distancemax=0)
   super(viewport)
   @anglemin=anglemin.to_f
   @anglemax=anglemax.to_f
   @distancemax=distancemax.to_f
   @character = character
   @source = source
   update
 end
 
 def update
   super
 
   if @tile_id != @character.tile_id or
      @character_name != @character.character_name or
      @character_hue != @character.character_hue
     @tile_id = @character.tile_id
     @character_name = @character.character_name
     @character_hue = @character.character_hue
     if @tile_id >= 384
       self.bitmap = RPG::Cache.tile($game_map.tileset_name,
         @tile_id, @character.character_hue)
       self.src_rect.set(0, 0, 32, 32)
       self.ox = 16
       self.oy = 32
     else
       self.bitmap = RPG::Cache.character(@character.character_name,
         @character.character_hue)
       @cw = bitmap.width / 4
       @ch = bitmap.height / 4
       self.ox = @cw / 2
       self.oy = @ch
     end
   end
   self.visible = (not @character.transparent)
   if @tile_id == 0
     sx = @character.pattern * @cw
     sy = (@character.direction - 2) / 2 * @ch
     if self.angle>90 or angle<-90
       if @character.direction== 6
              sy = ( 4- 2) / 2 * @ch
       end
       if @character.direction== 4
              sy = ( 6- 2) / 2 * @ch
       end
       if @character.direction== 2
              sy = ( 8- 2) / 2 * @ch
       end
       if @character.direction== 8
              sy = ( 2- 2) / 2 * @ch
       end
     end
     self.src_rect.set(sx, sy, @cw, @ch)
   end
   self.x = @character.screen_x
   self.y = @character.screen_y-5
   self.z = @character.screen_z(@ch)-1
   self.opacity = @character.opacity
   self.blend_type = @character.blend_type
   self.bush_depth = @character.bush_depth
   if @character.animation_id != 0
     animation = $data_animations[@character.animation_id]
     animation(animation, true)
     @character.animation_id = 0
   end
   @deltax=@source.x-self.x
   @deltay= @source.y-self.y
   self.angle = 57.3*Math.atan2(@deltax, @deltay )
   @angle_trigo=self.angle+90
   if @angle_trigo<0
     @angle_trigo=360+@angle_trigo
   end
   self.color = Color.new(0, 0, 0)
   @distance = ((@deltax ** 2) + (@deltay ** 2))
   if$game_map.shadows==-1
     self.opacity = 0
   else
     self.opacity = 1200000/(@distance+6000)    
   end
   @distance = @distance ** 0.5
   if @distancemax !=0 and @distance>=@distancemax
     self.opacity=0
   end
   if @anglemin !=0 or @anglemax !=0
      if (@angle_trigo<@anglemin or @angle_trigo>@anglemax) and @anglemin<@anglemax
        self.opacity=0
      end
      if (@angle_trigo<@anglemin and @angle_trigo>@anglemax) and @anglemin>@anglemax
        self.opacity=0
      end    
   end
 end
end
 
#===================================================
# &#9660; CLASS Sprite_Character edit
#===================================================
 
class Sprite_Character < RPG::Sprite
 alias shadow_initialize initialize
 
 def initialize(viewport, character = nil)
   @character = character
   super(viewport)
   @ombrelist=[]
   if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["s"])
     if (character.list[1]!=nil and character.list[1].code == 108)
       @anglemin=character.list[1].parameters[0]
     end
     if (character.list[2]!=nil and character.list[2].code == 108)
       @anglemax=character.list[2].parameters[0]
     end
     if (character.list[3]!=nil and character.list[3].code == 108)
       @distancemax=character.list[3].parameters[0]
     end  
    for i in $game_map.events.keys.sort
     if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["o"])
       @ombrelist[i+1] = Sprite_Shadow.new(viewport, $game_map.events[i],self,@anglemin,@anglemax,@distancemax)
     end
    end
    @ombrelist[1] = Sprite_Shadow.new(viewport, $game_player,self,@anglemin,@anglemax,@distancemax)
#===================================================
# &#9679; Compatibility with fukuyama's caterpillar script
#===================================================
if CATERPILLAR_COMPATIBLE and $game_party.characters!=nil
 
 for member in $game_party.characters
   @ombrelist.push(Sprite_Shadow.new(viewport, member,self,@anglemin,@anglemax,@distancemax))
 end
 
end
#===================================================
# &#9679; End of the compatibility
#===================================================
   end
   shadow_initialize(viewport, @character)
 end
 
 alias shadow_update update
 
 def update
   shadow_update
   if @ombrelist!=[]
     for i in 1..@ombrelist.size
       if @ombrelist[i]!=nil
         @ombrelist[i].update
       end
     end
   end
 end  
 
end
 
#===================================================
# &#9660; CLASS Scene_Save edit
#===================================================
class Scene_Save < Scene_File
 
 alias shadows_write_save_data write_save_data
 
 def write_save_data(file)
   $game_map.shadows = nil
   shadows_write_save_data(file)
 end
end
 
#===================================================
# &#9660; CLASS Game_Map edit
#===================================================
class Game_Map
 attr_accessor :shadows
end
[/button]


[button="Sun"]

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
#==============================================================================
# &#9632; Sprite_Sun
# # Based on Sprite_Shadow, modified by Rataime
#==============================================================================
 
CATERPILLAR_COMPATIBLE = true
 
class Game_Party
 attr_reader :characters
end
 
class Sprite_Sun < RPG::Sprite
 attr_accessor :character          
 
 def initialize(viewport, character = nil, self_angle = 45,self_opacity = 128)
   super(viewport)
   @character = character
   @self_angle=self_angle
   @self_opacity=self_opacity
   update
 end
 
 def update
   super
   if @tile_id != @character.tile_id or
      @character_name != @character.character_name or
      @character_hue != @character.character_hue
     @tile_id = @character.tile_id
     @character_name = @character.character_name
     @character_hue = @character.character_hue
     if @tile_id >= 384
       self.bitmap = RPG::Cache.tile($game_map.tileset_name,
         @tile_id, @character.character_hue)
       self.src_rect.set(0, 0, 32, 32)
       self.ox = 16
       self.oy = 32
     else
       self.bitmap = RPG::Cache.character(@character.character_name,
         @character.character_hue)
       @cw = bitmap.width / 4
       @ch = bitmap.height / 4
       self.ox = @cw / 2
       self.oy = @ch
     end
   end
 
   self.visible = (not @character.transparent)
 
   if @tile_id == 0
    sx = @character.pattern * @cw
    @direct=@character.direction
 
     if self.angle>90 or angle<-90
 
       if @direct== 6
              sy = ( 4- 2) / 2 * @ch
     end
     if @direct== 4
              sy = ( 6- 2) / 2 * @ch
       end
       if @direct != 4 and @direct !=6
       sy = (@character.direction - 2) / 2 * @ch
         end
       else
    sy = (@character.direction - 2) / 2 * @ch
    end
      self.src_rect.set(sx, sy, @cw, @ch)
   end
   self.x = @character.screen_x
   self.y = @character.screen_y-5
   self.z = @character.screen_z(@ch)-1
   self.opacity = @character.opacity
   self.blend_type = @character.blend_type
   self.bush_depth = @character.bush_depth
   if @character.animation_id != 0
     animation = $data_animations[@character.animation_id]
     animation(animation, true)
     @character.animation_id = 0
   end
   self.angle = @self_angle-90
   self.color = Color.new(0, 0, 0)
   $game_map.sun==-1 ? self.opacity = 0: self.opacity = @self_opacity
 end
end
 
#===================================================
# &#9660; CLASS Sprite_Character edit
#===================================================
 
class Sprite_Character < RPG::Sprite
 alias sun_initialize initialize
 
 def initialize(viewport, character = nil)
   @character = character
   super(viewport)
   @sunlist=[]
   if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["sun"])
     if (character.list[1]!=nil and character.list[1].code == 108)
       @self_angle=character.list[1].parameters[0]
     else
       @self_angle=45
     end
     if (character.list[2]!=nil and character.list[2].code == 108)
       @self_opacity=character.list[2].parameters[0]
     else
       @self_opacity=128
     end
    for i in $game_map.events.keys.sort
     if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["o"])
       @sunlist[i+1] = Sprite_Sun.new(viewport, $game_map.events[i],@self_angle,@self_opacity)
     end
    end
    @sunlist[1] = Sprite_Sun.new(viewport, $game_player,@self_angle,@self_opacity)
 
 
#===================================================
# &#9679; Compatibility with fukuyama's caterpillar script
#===================================================
if CATERPILLAR_COMPATIBLE and $game_party.characters!=nil
 
 for member in $game_party.characters
   @sunlist.push(Sprite_Sun.new(viewport, member,@self_angle,@self_opacity))
 end
 
end
#===================================================
# &#9679; End of the compatibility
#===================================================
 
 
   end
   sun_initialize(viewport, @character)
 end
 
 alias sun_update update
 
 def update
   sun_update
   if @sunlist!=[]
     for i in 1..@sunlist.size
       if @sunlist[i]!=nil
         @sunlist[i].update
       end
     end
   end
 end  
 
end
 
#===================================================
# &#9660; CLASS Scene_Save edit
#===================================================
class Scene_Save < Scene_File
 
 alias sun_write_save_data write_save_data
 
 def write_save_data(file)
   $game_map.sun = nil
   sun_write_save_data(file)
 end
end
 
#===================================================
# &#9660; CLASS Game_Map edit
#===================================================
class Game_Map
 attr_accessor :sun
end
[/button]


Zitat

ERKLÄRUNG:

Sonne:
<> macht ein leeres Event auf die map und fügt nur einen Kommentar mit dem wort sun darin ein.

Schatten:
<> macht in einem NPC einen Kommentar mit dem Buchstaben o darin.
<> Zudem muss die Lichtquelle einen Kommentar mit nem s darin haben.
<> Zudem könnt ihr noch die Reichweite eingeben. Das sieht dann so aus:
Zitat:

Kommentar: s
Kommentar: 260 #Das iss die Transparenz
Kommentar: 90 #Das iss der Winkel
Kommentar: 300 #Das iss die Reichweite in Pixel


~MFG Kain~

Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

9

Dienstag, 11. Juli 2006, 22:08

Es geht noch immer nicht! Bitte, kann jemand ein beisspiels Game machen!
Bild

10

Dienstag, 11. Juli 2006, 22:25

siehe Anhang

~MFG Kain~


Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

11

Mittwoch, 12. Juli 2006, 08:48

Genial! Vielen Dank! Jetzt hab ich nur noch die Frage; Könnte es möglich sein das das Script für Wassersüiegelungen und das für Dynamische Schatten sich nicht vertragen??
Vielen Dank Kain, was hab ich für Noob fehler gmacht^^.
Bild

lucien

Schaffender

  • »lucien« ist der Autor dieses Themas

Motto: California potato power! Ketchup rains all over the world.

  • Nachricht senden

12

Mittwoch, 12. Juli 2006, 08:51

Meines Wissens sollten sie sich schon vertragen. Wurden sie nicht sogar von derselben Person/Gruppe erstellt?
Naja, ich benutz das Spiegelscript halt nicht, kann es nicht 100pro sagen.

13

Mittwoch, 12. Juli 2006, 10:19

ich hab ma ne frage zu dem beispielGame.... wie kann man die position der sonne (also die richtung des Schattens) ändern???


@Kain
hast du die scripte nochmal geändert??? weil die die du gepostet hast (im Spoiler) kam immer ne warnung wenn ich auf ne karte kam mit sonnen- oder lichteffekten [SIZE="80"](siehe €dit:)[/SIZE]..... jetz nicht mehr :) ....dafür kann man jetzt aber nichtmehr die richtung des Schattens ändern :( ...oder ich weiß nur nicht wie ^^

€dit:
sry kain nich im spoiler warnse anders sondern im post von kiro... das is irgendwie nen andres script oder????
Story 100% Mapping 2% Sripting 0% <--- kann ich ned ... wenns jemand kann, ich freu mich über eure Hilfe^^ Bitte mal Hier klicken... echt genial Bild

Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

14

Mittwoch, 12. Juli 2006, 10:21

Das dritte Commen gibt den Grad der SOnne, wo sie "strahlt" an. ICh edit mal rein falls beide scripte laufen.
Edit: Also: Das beide scrippte gleichzeitig laufen, geht nur beim Helden, bei NPC's ist es entweder nur Schatten oder Spiegelung, das liegt,glaub ich daran, dass der COmment befehl r der o immer als erster befehl da sein muss.Und da ja wohl schlchthin beide gleichzeitig da sein können,...
Bild

15

Mittwoch, 12. Juli 2006, 10:31

versuch mal beim NPC 2 eeventseiten zu machn (parralel process) in die eine machste das o für shadow und in die andre das r

(ich benutz die spiegelung ned)
Story 100% Mapping 2% Sripting 0% <--- kann ich ned ... wenns jemand kann, ich freu mich über eure Hilfe^^ Bitte mal Hier klicken... echt genial Bild

Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

16

Mittwoch, 12. Juli 2006, 10:48

Funktioniert leider nicht, also hab ich nen switch gemacht, aber dann hat man ein hyperaltives Kanienchen das durch die gegend hoppelt^^. 145 Jhuu, nur noch 5!
Bild

17

Mittwoch, 12. Juli 2006, 11:21

ich kann nichma nen 2. comment machn ohne dasn error kommt....:s
hast du das script ausm bespielgame oder das von kiro???
Story 100% Mapping 2% Sripting 0% <--- kann ich ned ... wenns jemand kann, ich freu mich über eure Hilfe^^ Bitte mal Hier klicken... echt genial Bild

Ragnai

Seher

Motto: The only way to escape personal corruption of praise is to go on working -Einstein

  • Nachricht senden

18

Mittwoch, 12. Juli 2006, 11:37

Vom beispielsgame, und in mein Projekt gemacht, im Projekt hab ich dann die Hyperaktiven Kanienchen^^-
Bild

19

Mittwoch, 12. Juli 2006, 12:24

hmmm bei dem script von kiro ging das mit dem winkel des schattens .... jetz irgendwie nich mehr.... weder bei dem von kiro noch ausm beispielgame :(

kann mir jamand sagen warum das script von kiro nich mehr funzt??????

@Ragnarok.lu
haste das probiert mit der richtung des schattens... wenn ja dann schreib ma genau was du im event stehen hast

thx
Story 100% Mapping 2% Sripting 0% <--- kann ich ned ... wenns jemand kann, ich freu mich über eure Hilfe^^ Bitte mal Hier klicken... echt genial Bild

lucien

Schaffender

  • »lucien« ist der Autor dieses Themas

Motto: California potato power! Ketchup rains all over the world.

  • Nachricht senden

20

Mittwoch, 12. Juli 2006, 12:27

Also bei mir funktioniert alles bestens...
Und ich hab einfach nur aus meinem Game hier reinkopiert...

Social Bookmarks