Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Mightylink on October 28, 2008, 04:17:17 am

Title: Possible to Run Shortcuts Via Script?
Post by: Mightylink on October 28, 2008, 04:17:17 am
Is it possible to run another file from a script, I think I may got a better video play solution, .bik offers to play videos without a window, at any position or even full screen via a command.

so could this be put into a script and if yes how so?

"Movies\binkplay.exe" testvideo.bik /w-1.-1 /h-1.-1

As a stand alone app it looks very promising, it blends in with the game screen seamlessly and can be custamized to fit in either windowed or full screen games.

I think this is why the format is so popular with many pc games cause it runs cut scenes without modifying the game engine and it doesnt need codacs as everything needed to play the video is in the exe.
Title: Re: Possible to Run Shortcuts Via Script?
Post by: Fantasist on October 28, 2008, 07:30:23 am
Yup, bik is pretty impressive. I dunno how to start an exe with arguments, but the code for starting a new exe is:

Thread.new{system(PATH)}

where path is the location of the exe you want to open. For example if you placed the exe in your Graphics/Others folder, PATH will be:
"Graphics/Others/binkplay.exe"

I dunno how to pass arguments though.
Title: Re: Possible to Run Shortcuts Via Script?
Post by: shdwlink1993 on October 28, 2008, 08:40:32 am
This should work:

Thread.new{system ('"Movies\binkplay.exe" testvideo.bik /w-1.-1 /h-1.-1')}
Title: Re: Possible to Run Shortcuts Via Script?
Post by: Mightylink on October 28, 2008, 07:51:40 pm
thanks i'll see what i can come up with it

i been trying to learn scripting but so far every tutorial ive followed has ended up in errors v_v

like this for e.g. http://rmrk.net/index.php/topic,22008.msg276939.html#msg276939

class Window_MyWindow < Window_Base
  def initialize
    super(0, 0, 128, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = Color.new(255, 0, 0)
    self.contents.draw_text(0, 0, 128, 32, "TEXT!!!")
    bitmap = RPG::Cache.icon("001-Weapon01")
    self.contents.blt(0, 64, bitmap, Rect.new(0, 0, 24, 24))
  end
end


and when i try to run it with an event

$scene = Window_MyWindow.new


I always end up with the following error v_v

(http://i123.photobucket.com/albums/o296/MightyLink/mywindowerror.png)

Am I so dumb not to be able to copy code from a tutorial?
Title: Re: Possible to Run Shortcuts Via Script?
Post by: shdwlink1993 on October 28, 2008, 10:05:10 pm
No, the problem you're having right now is you're trying to make a Window do stuff that a Scene does. Scenes are containers that usually have a combination of input instructions and window displays, as well as a few other things. Windows are just things to show some text and some graphics. That's why you're getting the crash.
Title: Re: Possible to Run Shortcuts Via Script?
Post by: Mightylink on October 29, 2008, 02:21:15 am
haha thanks, i got it

$window = Window_MyWindow.new


I came up with this, my very first script thanks to you guys :P

class Movie_Test
    def initialize
          Thread.new{system ('"Movies\binkplay.exe" Movies\testvideo.bik /w640 /h480 /c /u124 /j /i102')}
    end
  end


created an event, used: $Movie_Test = Movie_Test.new, worked like a charm :D

Spoiler: ShowHide
(http://i123.photobucket.com/albums/o296/MightyLink/testvideo.jpg)


ignore the video, it was just a test, the fact is that it worked

so i changed /w640 /h480 to /w-1 /h-1 to make it full screen and it came back and bit me on the ass, the bugger crashes v_v

any thoughts?

this is so unbelivibly fustrating >.<

but at least i found better tutorials: http://www.rmxpunlimited.net/index.php/rmxp/rmxp-tutorials/rgss-scripting-tutorials/72-rgss-scripting-tutorials/279-dubealexs-rgss-and-ruby-tutorials.html

im going to take my time and go through it all, it looks to be the best tutorial i found so far, it actually explains what everything means :P