Timisci Posted January 18, 2007 Share Posted January 18, 2007 Spiego meglio il titolo:ho creato, tramite animazione, il movimento d'attacco del PG...ma ora il mio problema è chequando il PG si trova coperto, ad es. da un albero, l'animazione si vede lo stesso.La mia domanda è:come faccio a fare in modo che l'animazione sull'eroe (nel caso dell'esempio) non si veda? Progetto in corso: "Hero Walking: Toward Another Life" Video Old Intro su Youtube Visite: 11.896! http://img212.imageshack.us/img212/1060/logheryb0.jpg *Posizioni raggiunte nei contest* http://www.rpg2s.net/awards/bestuser1.jpghttp://www.rpg2s.net/awards/beststaff1.jpg http://www.rpg2s.net/awards/bestmaker3.jpghttp://www.rpg2s.net/awards/bestcritical1.jpghttp://www.rpg2s.net/awards/mostcharismatic2.jpg http://www.rpg2s.net/awards/mosthelpful1.jpghttp://www.rpg2s.net/awards/mostpolite1.jpghttp://www.rpg2s.net/awards/mostpresent1.jpg http://img204.imageshack.us/img204/8039/sccontest3octpl3.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif http://img230.imageshack.us/img230/1273/sccontest1batio5.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img143.imageshack.us/img143/3755/destroyae4.png http://img141.imageshack.us/img141/3081/comics3od3.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif SE VUOI AVERE RENS PER RISORSE, TUTORIAL, DEMO, ECC... LEGGI QUI Link to comment Share on other sites More sharing options...
0 Broly88 Posted January 19, 2007 Share Posted January 19, 2007 (edited) Ma hai realizzato il tutto via evento o via RGSS? Comunque sia potresti provare a chiamare il metodo di Game_Map che dice se il tuo pg si trova in un tile che lo copre, come dicevi tu dietro un albero ad esempio, e vedi cosa ti ritorna. A questo punto se torna true non mostri l'animazione altrimenti la mostri. Prova, non so, l'ho buttata li a casaccio ^^ Edited January 19, 2007 by Broly88 Il mondo è il cancro... Io la cura... Il mio sport preferito:Gli altri --> (T_T#)O==(^_^Q) <-- IO I miei alias:http://www.naruto-kun.com/images/narutotest/shikamaru.jpg-----------------------------------------------------http://www.naruto-kun.com/images/narutotest/rocklee.jpg-----------------------------------------------------http://www.ff-fan.com/chartest/banners/auron.jpg Broly88'shttp://pokejungle.net/other/pokepet/trainers/e4k2.png http://pokejungle.net/other/pokepet/Charizard.gifFlame Dancer the level 99 Charizard! http://img259.imageshack.us/img259/7446/rockleeoj1.gif http://img233.imageshack.us/img233/7449/sorajm1.gif Link to comment Share on other sites More sharing options...
0 Luis` Posted January 19, 2007 Share Posted January 19, 2007 Se usi ilo 2000 no, non puoi, le BA si trovano sul livello più alto e non possono essere coperte da niente. I'm Not There BlogMy Photostream!Trofei Personali:http://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifRisultati Game Contest: http://www.rpg2s.net/gif/GC_bestof3.gif 3° posto Best Of Rpg2s e Best of Rm2k/2k3http://www.rpg2s.net/gif/GC_premio1.gif 1° posto categoria Atmosferahttp://www.rpg2s.net/gif/GC_grafica3.gif 3° posto categoria Miglior Grafica Rm2k/2k3http://www.rpg2s.net/gif/GC_trama3.gif 3° posto categoria Miglior Tramahttp://www.rpg2s.net/gif/GC_programmazione3.gif 3° posto categoria Miglior Programmazione ad Eventi Rm2k/2k3http://www.rpg2s.net/gif/GC_mapping3.gif 3° posto categoria Miglior Mappinghttp://www.rpg2s.net/gif/GC_gameplay3.gif 3° posto categoria Miglior Gameplayhttp://www.rpg2s.net/gif/GC_effettispeciali2.gif 2° posto categoria Migliori effetti speciali in assoluto ed effetti speciali Rm2k/2k3Vincitore del premio speciale NAPOLI http://whisperinglethe.interfree.it/stuff/napoli.gif Frocio numero 5 del circolo ghei:http://img179.imageshack.us/img179/3074/vgmiud3.gif Link to comment Share on other sites More sharing options...
0 Timisci Posted January 19, 2007 Author Share Posted January 19, 2007 Ma hai realizzato il tutto via evento o via RGSS?Ho fatto una semplice animazione (da database) che richiamo tramite evento in processo parallelo. potresti provare a chiamare il metodo di Game_Map ....A sapere dove mettere le mani...ci proverei XD Se usi il 2000 no, non puoi.....Uso l'xp (e poi la sezione è dedicata all'xp). Aspetto qualche altro parere.Se poi sapete un altro metodo per fare l'animazione d'attacco (anche tramite script) ben venga ^^ Progetto in corso: "Hero Walking: Toward Another Life" Video Old Intro su Youtube Visite: 11.896! http://img212.imageshack.us/img212/1060/logheryb0.jpg *Posizioni raggiunte nei contest* http://www.rpg2s.net/awards/bestuser1.jpghttp://www.rpg2s.net/awards/beststaff1.jpg http://www.rpg2s.net/awards/bestmaker3.jpghttp://www.rpg2s.net/awards/bestcritical1.jpghttp://www.rpg2s.net/awards/mostcharismatic2.jpg http://www.rpg2s.net/awards/mosthelpful1.jpghttp://www.rpg2s.net/awards/mostpolite1.jpghttp://www.rpg2s.net/awards/mostpresent1.jpg http://img204.imageshack.us/img204/8039/sccontest3octpl3.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif http://img230.imageshack.us/img230/1273/sccontest1batio5.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img143.imageshack.us/img143/3755/destroyae4.png http://img141.imageshack.us/img141/3081/comics3od3.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif SE VUOI AVERE RENS PER RISORSE, TUTORIAL, DEMO, ECC... LEGGI QUI Link to comment Share on other sites More sharing options...
0 DarkSchneider Posted January 19, 2007 Share Posted January 19, 2007 fatto module RPG class Sprite < ::Sprite def animation_set_sprites(sprites, cell_data, position) for i in 0..15 sprite = sprites[i] pattern = cell_data[i, 0] if sprite == nil or pattern == nil or pattern == -1 sprite.visible = false if sprite != nil next end sprite.visible = true sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) if position == 3 if self.viewport != nil sprite.x = self.viewport.rect.width / 2 sprite.y = self.viewport.rect.height - 160 else sprite.x = 320 sprite.y = 240 end else sprite.x = self.x - self.ox + self.src_rect.width / 2 sprite.y = self.y - self.oy + self.src_rect.height / 2 sprite.y -= self.src_rect.height / 4 if position == 0 sprite.y += self.src_rect.height / 4 if position == 2 end sprite.x += cell_data[i, 1] sprite.y += cell_data[i, 2] #modifica sprite.z = @zeta #fine modifica sprite.ox = 96 sprite.oy = 96 sprite.zoom_x = cell_data[i, 3] / 100.0 sprite.zoom_y = cell_data[i, 3] / 100.0 sprite.angle = cell_data[i, 4] sprite.mirror = (cell_data[i, 5] == 1) sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = cell_data[i, 7] end end #modifica def animation(animation, hit, event) #fine modifica dispose_animation @_animation = animation return if @_animation == nil @_animation_hit = hit @_animation_duration = @_animation.frame_max animation_name = @_animation.animation_name animation_hue = @_animation.animation_hue bitmap = RPG::Cache.animation(animation_name, animation_hue) if @@_reference_count.include?(bitmap) @@_reference_count[bitmap] += 1 else @@_reference_count[bitmap] = 1 end @_animation_sprites = [] if @_animation.position != 3 or not @@_animations.include?(animation) for i in 0..15 sprite = ::Sprite.new(self.viewport) sprite.bitmap = bitmap sprite.visible = false @_animation_sprites.push(sprite) end unless @@_animations.include?(animation) @@_animations.push(animation) end end # modifica if event.is_a?(Game_Player) if $game_map.passable?($game_player.x, $game_player.y, 0, event) @zeta = event.screen_z end else @zeta = 2000 end #fine modifica update_animation end end end class Sprite_Character < RPG::Sprite 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) @cw = bitmap.width / 4 @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] #modifica animation(animation, true, @character) #fine modifica @character.animation_id = 0 end end end adesso tutte le animazioni sul pg verranno visualizzate sotto i tile con priorità maggiore di 0. Per farlo funzionare devi settare la priorità dei tiles maggiore di zero e devi mettere cerchio sulla passabilità senno non funziona p.s. ho scritto dove ho fatto le modifiche nello script nel caso tu debba fare ulteriori modifiche The Lotus Eater Link to comment Share on other sites More sharing options...
0 Timisci Posted January 19, 2007 Author Share Posted January 19, 2007 Grande DarkSchneider!! (come al solito del resto ^^)Grazie. Progetto in corso: "Hero Walking: Toward Another Life" Video Old Intro su Youtube Visite: 11.896! http://img212.imageshack.us/img212/1060/logheryb0.jpg *Posizioni raggiunte nei contest* http://www.rpg2s.net/awards/bestuser1.jpghttp://www.rpg2s.net/awards/beststaff1.jpg http://www.rpg2s.net/awards/bestmaker3.jpghttp://www.rpg2s.net/awards/bestcritical1.jpghttp://www.rpg2s.net/awards/mostcharismatic2.jpg http://www.rpg2s.net/awards/mosthelpful1.jpghttp://www.rpg2s.net/awards/mostpolite1.jpghttp://www.rpg2s.net/awards/mostpresent1.jpg http://img204.imageshack.us/img204/8039/sccontest3octpl3.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif http://img230.imageshack.us/img230/1273/sccontest1batio5.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img143.imageshack.us/img143/3755/destroyae4.png http://img141.imageshack.us/img141/3081/comics3od3.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif SE VUOI AVERE RENS PER RISORSE, TUTORIAL, DEMO, ECC... LEGGI QUI Link to comment Share on other sites More sharing options...
0 Broly88 Posted January 19, 2007 Share Posted January 19, 2007 Beh a livello di concetto era quello che dicevo io. A livello teorico e meglio quello di Dark. A livello pratico è incommensurabilmente meglio quello di Dark. ^^ Il mondo è il cancro... Io la cura... Il mio sport preferito:Gli altri --> (T_T#)O==(^_^Q) <-- IO I miei alias:http://www.naruto-kun.com/images/narutotest/shikamaru.jpg-----------------------------------------------------http://www.naruto-kun.com/images/narutotest/rocklee.jpg-----------------------------------------------------http://www.ff-fan.com/chartest/banners/auron.jpg Broly88'shttp://pokejungle.net/other/pokepet/trainers/e4k2.png http://pokejungle.net/other/pokepet/Charizard.gifFlame Dancer the level 99 Charizard! http://img259.imageshack.us/img259/7446/rockleeoj1.gif http://img233.imageshack.us/img233/7449/sorajm1.gif Link to comment Share on other sites More sharing options...
Question
Timisci
Spiego meglio il titolo:
ho creato, tramite animazione, il movimento d'attacco del PG...ma ora il mio problema è che
quando il PG si trova coperto, ad es. da un albero, l'animazione si vede lo stesso.
La mia domanda è:
come faccio a fare in modo che l'animazione sull'eroe (nel caso dell'esempio) non si veda?
Progetto in corso:
"Hero Walking: Toward Another Life"
Video Old Intro su Youtube
Visite: 11.896!
http://img212.imageshack.us/img212/1060/logheryb0.jpg
*Posizioni raggiunte nei contest*
http://www.rpg2s.net/awards/bestuser1.jpghttp://www.rpg2s.net/awards/beststaff1.jpg
http://www.rpg2s.net/awards/bestmaker3.jpghttp://www.rpg2s.net/awards/bestcritical1.jpghttp://www.rpg2s.net/awards/mostcharismatic2.jpg
http://www.rpg2s.net/awards/mosthelpful1.jpghttp://www.rpg2s.net/awards/mostpolite1.jpghttp://www.rpg2s.net/awards/mostpresent1.jpg
http://img204.imageshack.us/img204/8039/sccontest3octpl3.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif http://img230.imageshack.us/img230/1273/sccontest1batio5.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img103.imageshack.us/img103/1496/sccontest2octou1.gif http://img143.imageshack.us/img143/3755/destroyae4.png
http://img141.imageshack.us/img141/3081/comics3od3.gif http://img118.imageshack.us/img118/181/sccontest1octdt9.gif
SE VUOI AVERE RENS PER RISORSE, TUTORIAL, DEMO, ECC... LEGGI QUI
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now