幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1573|回复: 2

『请教』用API强行在原窗口播放.avi

[复制链接]

5

主题

25

帖子

38

积分

②入门

积分
38
发表于 2005-12-3 19:23:24 | 显示全部楼层 |阅读模式
我用66RPG提供的脚本在MAIN前加入以下语句

#==============================================================================
# ■ Scene_Movie
#------------------------------------------------------------------------------
#  处理视频播放画面的类。
#==============================================================================

class Scene_Movie
def initialize(movie,length,exit_to_game=true)
   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
   @movie_name = Dir.getwd()+"\\Movie\\"+movie
   @counter = length
   @exit_to_game = exit_to_game
end
def main
   game_name = "\0" * 256
   @readini.call('Game','Title','',FinalFantsyVIIAC,255,".\\Game.ini")
   Final Fantsy VII AC.delete!("\0")
   Graphics.transition
   @wnd = Win32API.new('user32','FindWindowEx','%w(l,l,p,p)','L')
   @temp = @wnd.call(0,0,nil,FinalFantsyVIIAC).to_s
   @movie = Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V')
   @movie.call("open \""+@PT3+"\" alias FILE style 1073741824 parent " + @temp.to_s,0,0,0)
   @message = Win32API.new('user32','SendMessage','%w(l,l,l,l)','V')
   @detector = Win32API.new('user32','GetSystemMetrics','%w(l)','L')
   @width = @detector.call(0)
   if @width == 640
     fullscreen
     Graphics.update
     sleep(1)
     Graphics.update
     sleep(1)
     Graphics.update
     sleep(1)
   end
   @movie.call("play FILE",0,0,0)
   loop do
     sleep(1)
     @message.call(@temp.to_i,11,0,0)
     Graphics.update
     @message.call(@temp.to_i,11,1,0)
     Input.update
     if Input.trigger?(Input::B)
       break
     end
     @counter = @counter - 1
     if @counter <= 0
       break
     end
   end
   @movie.call("close FILE",0,0,0)
   if @exit_to_game
     $scene = Scene_Map.new
   else
     $scene = Scene_Title.new
   end
   Graphics.freeze
   if @width == 640
     fullscreen
   end
  end
end
def fullscreen()
  $full.call(18,0,0,0)
  $full.call(13,0,0,0)
  $full.call(18,0,2,0)
  $full.call(13,0,2,0)
end
$full = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')


另外,66RPG上说的“在地图上新建事件,在事件插入脚本,"$scene = Scene_Movie.new("你文件名称",30)"即可.30是代表你文件的时间长度~~”,里面的30是指30秒还是30分钟?



但是过了标题菜单后就出现了“语句错误”的提示,请问我是哪里写错了呢?
我是新手,菜鸟中的菜鸟,还请这里的各位高人帮助一下
回复

使用道具 举报

5

主题

25

帖子

38

积分

②入门

积分
38
 楼主| 发表于 2005-12-4 21:57:58 | 显示全部楼层
中文系统指的是什么?WINDOWS的系统吗?
但是我是把游戏直接放在硬盘上的,没有加上什么中文名的文件夹啊
真的不能用这个脚本了么?
回复 支持 反对

使用道具 举报

5

主题

25

帖子

38

积分

②入门

积分
38
 楼主| 发表于 2005-12-5 10:48:25 | 显示全部楼层
昨晚摸索摸索着就成功了……
非常感谢柳大提供这个脚本啊!!!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-25 14:49 , Processed in 0.009903 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表