[XP] Transition Pack v1.11

Started by Fantasist, July 24, 2008, 12:45:52 pm

Previous topic - Next topic

Calintz

February 14, 2009, 08:14:46 pm #40 Last Edit: February 14, 2009, 08:37:19 pm by Calintz16438
I think I'm gonna have to test this right now...

EDIT
I will download the file that shdwlink uploaded, but could you please fix the link in your 1st post Fantasist!?  :^_^':

**What syntax allows the user to change the transition style from the script command in the event editor??
**This does not work for me!! =(

Blizzard

Does the demo still have my "transpose" transition?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

July 05, 2009, 03:20:19 pm #42 Last Edit: July 06, 2009, 06:18:09 pm by Fantasist
@Cal: I oughta be hanged :cry:
@Blizz: I just checked, it's still there.

Updated the link in 1st post (and the post itself).

EDIT: Updated again, with new demo. Scripters out there, I need some help. Please read the first post if you're willing to help:

Quote
effect_parameters (optional, experimental): If you specified effect_type, you can additionally pass parameters for that particular effect. For details about each effect, check it's documentation in the script. Note that this feature is not fully functional. I want this feature and I will not consider this script complete without it. I am having trouble getting it right so if you can help, I'll be thankful.
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




Ryex

what would happen if you had then store the parameters in an array like
$scene = Transition.new(Scene_Map.new, 1, [20, 12])
then when calling the effect method
insted of this

# Call method with or without arguments depend
# on value of args.
args ? method(args) : method

do this?

case args.size
when 0 #? I forgot what happens when you use size on a empty array so
 method
when 1
 method(args[0])
when 2
 method(args[0], args[1])
when 3
 method(args[0], args[1], args[2])
# ect.
end


I don't know what you mean by you can't get it to work right but this should to the best of my knowledge call methods with the right parameters.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

Actually, if I use arrays, there's no need even for that. All I need is to pass one array of arguments and check the array size inside the method (just like Blizz aliased Bitmap#initialize in ultimate font override). But then, that defines a rule for passing parameters for all the methods that will be made over time by me or other scripters. I'm trying to make it so that we can pass the arguments in a natural way.
Of course, this is just an idea and I don't know much about the subject. If it's more trouble than it's worth or if it's a performance hog, then I'll just modify the methods to handle array arguments.
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




Ryex

July 08, 2009, 01:52:16 pm #45 Last Edit: July 08, 2009, 02:24:48 pm by Ryexander
personally I would  just use array and get it working the way you want to. then when you find out more about how to do it you can get it to pass them correctly.

EDIT I GOT IT WORKING THE WAY YOU WANT!


def call_effect(type, args)
    # Get method to call depending on transition
    # type specified.
    a = args.nil?
    unless a
      case type
      when 0 then zoom_in(*args)
      when 1 then zoom_out(*args)
      when 2 then shred_h(*args)
      when 3 then shred_v(*args)
      when 4 then fade(*args)
      when 5 then explode
      when 6 then explode_cp
      when 7 then transpose(*args)
      end
    else
      case type
      when 0 then zoom_in
      when 1 then zoom_out
      when 2 then shred_h
      when 3 then shred_v
      when 4 then fade
      when 5 then explode
      when 6 then explode_cp
      when 7 then transpose
      end
    end
    # Call method with or without arguments depend
    # on value of args.
  end


yes the
a = args.nil?
    unless a
is necessary other wise you get a type error
and you need to do
*args when putting it in to call something
*args is all the arguments separated
args is an array with all the arguments
that method works I've tested it
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

July 09, 2009, 10:50:07 am #46 Last Edit: July 09, 2009, 10:56:58 am by Fantasist
I think that is what I did, but instead of using the case statement for all the methods, I stored the method in a variable:


    # Get method to call depending on transition
    # type specified.
    method = case type
    when 0 then zoom_in
    when 1 then zoom_out
    when 2 then shred_h
    when 3 then shred_v
    when 4 then fade
    when 5 then explode
    when 6 then explode_cp
    when 7 then transpose
    end
    # Call method with or without arguments depend
    # on value of args.
    args ? method(*args) : method


That's what I did in the demo I posted. It works when calling transitions without arguments, but if you DO use arguments, it gives an arguments. For example, when I called Zoom In with the "frames" argument:
$scene = Transition.new(Scene_Map.new, 1, 15)


it gives an argument error at the line:
args ? method(*args) : method


saying "15 is not a symbol". Now what's that supposed to mean?

Also, what exactly have you tested? When I tested it, calling effects normally doesn't cause a problem but calling them with type and arguments causes an error.

PS: New effect "Shutter" added (not in demo).
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




Ryex

July 09, 2009, 01:01:17 pm #47 Last Edit: July 09, 2009, 01:02:58 pm by Ryexander
Quote from: Fantasist on July 09, 2009, 10:50:07 am
I think that is what I did, but instead of using the case statement for all the methods, I stored the method in a variable:


   # Get method to call depending on transition
   # type specified.
   method = case type
   when 0 then zoom_in
   when 1 then zoom_out
   when 2 then shred_h
   when 3 then shred_v
   when 4 then fade
   when 5 then explode
   when 6 then explode_cp
   when 7 then transpose
   end
   # Call method with or without arguments depend
   # on value of args.
   args ? method(*args) : method


That's what I did in the demo I posted. It works when calling transitions without arguments, but if you DO use arguments, it gives an arguments. For example, when I called Zoom In with the "frames" argument:
$scene = Transition.new(Scene_Map.new, 1, 15)


it gives an argument error at the line:
args ? method(*args) : method


saying "15 is not a symbol". Now what's that supposed to mean?

Also, what exactly have you tested? When I tested it, calling effects normally doesn't cause a problem but calling them with type and arguments causes an error.

PS: New effect "Shutter" added (not in demo).

Fant that IS the problem! when you tried to store the effect method in 'method' it didn't work. all you were getting is what the method RETURNS which in every case is nil (or for some reason it was returning the arguments of the zoom_in method)! and is ran the method so you were seeing the effect, yes but it was not being run at the time you thought it was. but some p 'hello' commands befor the line
args ? method(args) : method

(also note that the line in the demo is method(args) NOT method(*args))
and you will see that the effect is displayed BEFORE the print command
also you can't use args directly in a if statement you will get a type error (I don't know exactly what this means).
if args.nil?
will get a type error if you use extra arguments
a = args.nil?
if a
for some strange reason will not
also when doing
args ? method(*args) : method

you are testing args for TRUE by default and when it was nil (because you didn't use and extra arguments) it returns false and you didn't notice it doing anything (because method is NOT a effect method) and when args is not nil you get a type error before you get to the error at method(*args) whis WOULD return an error.


the code I posted WORKS you and call ANY of the effects with extra arguments you modify the default values  I TESTED it at least TRY it before telling me it is not going to work, what you doing is NEVER going to work, who CARES if the method is longes by 10 lines it WORKS ans INTENDED!

just TRY it ok?

PS: the zoom_in and zoom_out effects are backwards in the demo zoom_in zooms out and vice versa.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

July 09, 2009, 01:18:54 pm #48 Last Edit: July 09, 2009, 01:24:48 pm by Fantasist
QuoteFant that IS the problem! when you tried to store the effect method in 'method' it didn't work. all you were getting is what the method RETURNS which in every case is nil (or for some reason it was returning the arguments of the zoom_in method)! and is ran the method so you were seeing the effect, yes but it was not being run at the time you thought it was. but some p 'hello' commands befor the line


Checked that already and strangely enough, the methods are running when they should.

Quote(also note that the line in the demo is method(args) NOT method(*args))
and you will see that the effect is displayed BEFORE the print command
also you can't use args directly in a if statement you will get a type error (I don't know exactly what this means).
if args.nil?
will get a type error if you use extra arguments
a = args.nil?
if a
for some strange reason will not


I've tested both args and *args and I'm sure that's not the problem here. I used * args only twice. While getting the arguments from Transition.new, and when passing them to the effect method. args holds the array, *args holds the contents of the array, that's how I understand it and it seems to work fine so far.
And the effect executed AFTER the print, I checked.
About using args directly, I doubt that's much of a problem, but I noticed something else. This is what I currently use:

no_args = args.nil? || args == []
no_args ? method : method(*args)


It made no difference (regarding using args directly in an if clause). But here, I'm also checking for an empty array as I got it once.

Quote
the code I posted WORKS you and call ANY of the effects with extra arguments you modify the default values  I TESTED it at least TRY it before telling me it is not going to work, what you doing is NEVER going to work, who CARES if the method is longes by 10 lines it WORKS ans INTENDED!

just TRY it ok?

PS: the zoom_in and zoom_out effects are backwards in the demo zoom_in zooms out and vice versa.


You know, why didn't I try this earlier? Sorry about it, really. I'll try it and get back to you. btw, thanks for the help Ryex :)


EDIT: You're right, it works! Let's see what I'll do next...
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




Ryex

well do do need *args otherwise you passing an array and ONE argument with *args you passing the contents of the array as an arguments
and not the methods were NOT executing when they should the were exacuting in the case statement I did a LOT of tests to make sure of that.
the code I posted works try it and find out.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

QuoteEDIT: You're right, it works! Let's see what I'll do next...

:)
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




Ryex

July 09, 2009, 01:32:53 pm #51 Last Edit: July 09, 2009, 02:58:03 pm by Ryexander
 :)
now you can consider it finished and get it into the database by applying the template! :D
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

July 09, 2009, 01:38:58 pm #52 Last Edit: July 12, 2009, 11:21:53 am by Fantasist
Yeah... I think I will, after adding a couple more effects (I have some more nice ideas :D). Thanks for the help Ryex, consider yourself in the credits.

EDIT: Finally! This is no longer WIP, v1.0 is released, yay :D
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




winkio

Schwing  ;)

Awesome script, Fantasist

Fantasist

Ah, DB'd by our ever vigilant mods, thanks winkio :)
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




Holyrapid


Fantasist

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




Kirye

Alright, i'm pretty noob at this, but hopefully it's something small that i'm just not seeing.

I've been trying to use the transition effects to come in when an important battle starts (Ala Chaos Project). But so far, everytime I do it, it goes back to the map screen in full color, then has the original battle transition.

I tried using this:
$scene = Transition.new(Scene_Map.new, 
7, Color.new(-255, -255, -255) 50)


But it keeps having a Syntax Error.

I also tried to throw in a Change Screen Color Tone to black before the transition, but it doesn't really work the way i'd hope.

I hope I made some sense.

Spoiler: ShowHide

Aqua

Using Scene_Map.new makes it go back to the map; you need it to go to the battle.

You missed a , after the Color.new(), and the color arguments only range from 0-255

Kirye

July 21, 2009, 10:46:44 pm #59 Last Edit: July 21, 2009, 10:50:15 pm by Kirye
I kinda made it work for me, but as for going into Scene_Battle, it always gets an error on my part.

And yeah, I saw the mistake on the Color.New part. ><

If I use Scene_Battle, it crashes after the transition. But if I remove the Wait 1 frame, then it goes into the battle and doesn't have the transition effect.

Spoiler: ShowHide