RPG-Maker Quartier http://forum.rpg2000.4players.de/phpBB3/ |
|
Variable Character Frames Script - Funktioniert nicht http://forum.rpg2000.4players.de/phpBB3/viewtopic.php?f=52&t=98644 |
Seite 1 von 1 |
Autor: | Bub [ Mi Nov 07, 2012 7:18 ] |
Betreff des Beitrags: | Variable Character Frames Script - Funktioniert nicht |
Hallo allerseits!Ich möchte ein Charset mit 6 Gehposen je Laufrichtung verwenden. Zum Testen nehme ich folgendes Charset: http://www10.pic-upload.de/08.11.12/hkx8twrl773s.png Das Script hab ich hier her: viewtopic.php?t=75466 Ich hab also den Code im Scripteditor unter Main eingefügt und das Charset namens walking_f[7] importiert. Beim Benutzen des Charsets wird es dennoch in 4 Posen je Richtung geteilt. Ich habs auch mehrere Male in neuen Projekten versucht, es will nicht klappen. Weiß jemand, was zu tun ist? Hier nochma der Code: Code: #============================================================================
# ** Variable Character Frames Script (v1.0) #============================================================================ # Idee und Ausführung: Der Drake, KD, Phantom, Ascare, RAMart. # Niemand verlangt ein extra Credit dafür, ihr könnt es einfach benutzen. # # Benutzung: Einfach zum Dateinamen des Charakters ein f[x] einfügen. # Wobei x für die Anzahl der Frames steht (inkl. Standpose). # # Beispiele: Hero_f[8].png, Wachef[12]ani2.png, f[6]frau.png # Standard ist 4 und brauch nicht extra genannt zu werden (z.B. für RTP-Charas). #============================================================================ class Game_Character #-------------------------------------------------------------------------- # * Initialize #-------------------------------------------------------------------------- alias_method :init, :initialize def initialize init getCharFrame end #-------------------------------------------------------------------------- # * Get Character Frame #-------------------------------------------------------------------------- def getCharFrame @CharFrame = 4 self.character_name.sub(/f\[(\d+)\]/) { @CharFrame = $1.to_i } return @CharFrame end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Branch with jumping, moving, and stopping if jumping? update_jump elsif moving? update_move else update_stop end # If animation count exceeds maximum value # * Maximum value is move speed * 1 taken from basic value 18 if @anime_count > 18 - @move_speed * 2 # If stop animation is OFF when stopping if not @step_anime and @stop_count > 0 # Return to original pattern @pattern = @original_pattern # If stop animation is ON when moving else # Update pattern if @CharFrame == 4 @pattern = (@pattern + 1) % 4 else @pattern = [((@pattern + 1) % @CharFrame), 1].max end end # Clear animation count @anime_count = 0 end # If waiting if @wait_count > 0 # Reduce wait count @wait_count -= 1 return end # If move route is forced if @move_route_forcing # Custom move move_type_custom return end # When waiting for event execution or locked if @starting or lock? # Not moving by self return end # If stop count exceeds a certain value (computed from move frequency) if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency) # Branch by move type case @move_type when 1 # Random move_type_random when 2 # Approach move_type_toward_player when 3 # Custom move_type_custom end end end #-------------------------------------------------------------------------- # * Update frame (move) #-------------------------------------------------------------------------- def update_move # Convert map coordinates from map move speed into move distance distance = 2 ** @move_speed # If logical coordinates are further down than real coordinates if @y * 128 > @real_y # Move down @real_y = [@real_y + distance, @y * 128].min end # If logical coordinates are more to the left than real coordinates if @x * 128 < @real_x # Move left @real_x = [@real_x - distance, @x * 128].max end # If logical coordinates are more to the right than real coordinates if @x * 128 > @real_x # Move right @real_x = [@real_x + distance, @x * 128].min end # If logical coordinates are further up than real coordinates if @y * 128 < @real_y # Move up @real_y = [@real_y - distance, @y * 128].max end # If move animation is ON if @walk_anime # Increase animation count by 1.5 @anime_count += 1.5*(@CharFrame/4) # If move animation is OFF, and stop animation is ON elsif @step_anime # Increase animation count by 1 @anime_count += 1*(@CharFrame/4) end end #-------------------------------------------------------------------------- # * Frame Update (stop) #-------------------------------------------------------------------------- def update_stop # If stop animation is ON if @step_anime # Increase animation count by 1 @anime_count += 1*(@CharFrame/4) # If stop animation is OFF, but current pattern is different from original elsif @pattern != @original_pattern # Increase animation count by 1.5 @anime_count += 1.5*(@CharFrame/4) end # When waiting for event execution, or not locked # * If lock deals with event execution coming to a halt unless @starting or lock? # Increase stop count by 1 @stop_count += 1 end end end class Sprite_Character < RPG::Sprite #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super # If tile ID, file name, or hue are different from current ones if @tile_id != @character.tile_id or @character_name != @character.character_name or @character_hue != @character.character_hue # Remember tile ID, file name, and hue @tile_id = @character.tile_id @character_name = @character.character_name @character_hue = @character.character_hue # If tile ID value is valid 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 # If tile ID value is invalid else self.bitmap = RPG::Cache.character(@character.character_name, @character.character_hue) @CharFrame = @character.getCharFrame @cw = bitmap.width / @CharFrame @ch = bitmap.height / 4 self.ox = @cw / 2 self.oy = @ch end end # Set visible situation self.visible = (not @character.transparent) # If graphic is character if @tile_id == 0 # Set rectangular transfer sx = @character.pattern * @cw sy = (@character.direction - 2) / 2 * @ch self.src_rect.set(sx, sy, @cw, @ch) end # Set sprite coordinates self.x = @character.screen_x self.y = @character.screen_y self.z = @character.screen_z(@ch) # Set opacity level, blend method, and bush depth self.opacity = @character.opacity self.blend_type = @character.blend_type self.bush_depth = @character.bush_depth # Animation if @character.animation_id != 0 animation = $data_animations[@character.animation_id] animation(animation, true) @character.animation_id = 0 end end end |
Autor: | TheWhiteShadow [ Fr Nov 09, 2012 17:11 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
Man fügt normal nichts unter Main ein, wenn es nicht nach dem Spiel starten soll. |
Autor: | Bub [ Fr Nov 09, 2012 18:56 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
Nicht? Möglicherweise hab ich mich missverständlich ausgedrückt. Ich bin dieser Anleitung gefolgt: "Um das Script zu verwenden: Script Editor öffnen, Rechtsklick auf Main, dann Insert wählen. Dort einen Namen eingeben (z.B. VCF) und im rechten Feld das Script einfach einfügen." |
Autor: | TheWhiteShadow [ Sa Nov 10, 2012 18:42 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
Wenn du bei der Seite main auf insert gegangen bist sollte die neue Seite ÜBER der Main-Seite stehen. Habs das Skipr getestet und es funktioniert einwandfrei. |
Autor: | Bub [ Do Nov 29, 2012 21:00 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
hmm... warum denn dann bei mir nich? hier nochmal meine vorgehensweise im detail: 1) ich erstelle ein neues projekt 2) ich klicke im scripteditor mit rechts auf main, wähle insert aus und füge das obige script im rechten feld ein. die neue scriptseite steht nun über der main-seite. 3) ich importiere die obige grafik namens "walkingf[7]" in den ornder Graphics/Characters. 4) ich erstelle ein event und weise ihm die grafik "walkingf[7]" zu. leider wird diese nachwievor in 4 frames je laufrichtung unterteilt. entdeckt jemand einen fehler, kennt noch jemand das problem und bestenfalls eine lösung? |
Autor: | TheWhiteShadow [ Sa Dez 01, 2012 0:46 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
Hast du TeamViewer7 oder Skype? Dann kann ich mir das mal angucken |
Autor: | Bub [ Mi Feb 20, 2013 0:12 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
erstmal sorry, dass ich nicht mehr geantwortet hab. hatte das makern für eine zeit lang aus den augen verloren. die frameerweiterung funktioniert jetzt. allerdings wird während sich der charakter bewegt nach jedem framedurchlauf die standpose angezeigt. geht das zu ändern, so dass die standpose nur im stand angezeigt wird? |
Autor: | TheWhiteShadow [ Mi Feb 20, 2013 20:00 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
Die Standpose sollte Teil der Laufanimation sein, sonst wird das schwierig. Geht zwar betimmt irgendwie, allerdings ist das aufwendig. |
Autor: | Bub [ Do Feb 21, 2013 5:18 ] |
Betreff des Beitrags: | Re: Variable Character Frames Script - Funktioniert nicht |
nee, hab mich geirrt. die standpose wird nicht angezeigt, wenn sich der chara in normaler geschwindigkeit bewegt. prima! thread kann meinetwegen zu. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |