Possible to Run Shortcuts Via Script?

Started by Mightylink, October 28, 2008, 04:17:17 am

Previous topic - Next topic

Mightylink

October 28, 2008, 04:17:17 am Last Edit: October 28, 2008, 04:24:31 am by Mightylink
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.

Fantasist

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.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




shdwlink1993

This should work:

Thread.new{system ('"Movies\binkplay.exe" testvideo.bik /w-1.-1 /h-1.-1')}
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Mightylink

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



Am I so dumb not to be able to copy code from a tutorial?

shdwlink1993

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.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Mightylink

October 29, 2008, 02:21:15 am #5 Last Edit: October 29, 2008, 03:28:00 am by Mightylink
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


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