Jump to content

Photo

Faster Conveyor Belts


  • Please log in to reply
26 replies to this topic

#16 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 12 November 2016 - 10:54 AM

I want to use the FFC script because I don't know what to take out and where exactly to paste it. If you want to do it, let me know.

 

Or else just tell me on how I set up the D arguments.



#17 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 November 2016 - 11:19 AM

I want to use the FFC script because I don't know what to take out and where exactly to paste it. If you want to do it, let me know.

 

Or else just tell me on how I set up the D arguments.

 

 

 

D0 is the speed ticker. The higher the number, the lower the extra speed will be. Try setting it to 30 for now.

D1 is the step rate for solidity checking. Try it at 1, and adjust as needed.


Edited by ZoriaRPG, 12 November 2016 - 11:20 AM.


#18 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 12 November 2016 - 12:13 PM

Doesn't work. Link doesn't get pushed away.



#19 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 13 November 2016 - 06:38 PM

Doesn't work. Link doesn't get pushed away.

 

Try this:

 

//FFC Version

ffc script FasterConveyors{
    void run(int speed, int step){
        int timer = speed;
        while(true){
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVLEFT ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_LEFT, step, false) ) {
                    Link->X+8--;
                    timer = speed;
                }
            }
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVRIGHT ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_RIGHT, step, false) ) {
                    Link->X+8++;
                    timer = speed;
                }
            }
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVUP ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_UP, step, false)  ) {
                    Link->Y+8--;
                    timer = speed;
                }
            }
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVDOWN ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_DOWN, step, false) ) {
                    Link->Y+8++;
                    timer = speed;
                }
            }
            //else timer = speed;
            Waitframe();
        }
    }
}


#20 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 14 November 2016 - 04:58 AM

Pass 1: Parsing
line 9: syntax error, unexpected DECREMENT, expecting SEMICOLON or OR, on token --
Fatal Error P00: Can't open or parse input file!

Once again, fatal error. Scripting is not my thing at all, you know. So does the programm language. A guide for "sparky dummies" should be needed and... uh... oops... Sorry...

 

Well this is the error above.



#21 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 15 November 2016 - 12:41 AM

Pass 1: Parsing
line 9: syntax error, unexpected DECREMENT, expecting SEMICOLON or OR, on token --
Fatal Error P00: Can't open or parse input file!

Once again, fatal error. Scripting is not my thing at all, you know. So does the programm language. A guide for "sparky dummies" should be needed and... uh... oops... Sorry...

 

Well this is the error above.

 

 

The explanation is simple, although it took me a moment to even notice it. I did a find/replace on 'Link->X' and 'Link->Y', changing them to 'Link->X+8' and 'Link->Y+8' respectively. This was to ensure that ComboT[ComboAt(...)] was reading the combo type at Link's centre.

 

What I hailed to notice, is that this also replaced the instructions to change his position from 'Link->X++' to 'Link->X+8++', and so forth.

 

Link->X+8++ is effectively illogical to the parser.

 

This should compile now, although if it fails to work, I'm at a present loss for why.

ffc script FasterConveyors{
    void run(int speed, int step){
        int timer = speed;
        while(true){
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVLEFT ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_LEFT, step, false) ) {
                    Link->X--;
                    timer = speed;
                }
            }
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVRIGHT ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_RIGHT, step, false) ) {
                    Link->X++;
                    timer = speed;
                }
            }
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVUP ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_UP, step, false)  ) {
                    Link->Y--;
                    timer = speed;
                }
            }
            if ( Screen->ComboT[ ComboAt(Link->X+8, Link->Y+8) ] == CT_CVDOWN ) {
                if ( !timer ) timer = speed;
                if ( timer > 1 ) timer--;
                if ( timer <= 1 && CanWalk(Link->X+8, Link->Y+8, DIR_DOWN, step, false) ) {
                    Link->Y++;
                    timer = speed;
                }
            }
            //else timer = speed;
            Waitframe();
        }
    }
}

Make certain that you assign the ffc to a slot when compiling, and place the ffc on the screen, setting the script in the ffc editor, and changing the ffc's combo from 0 (the default) to combo ID 1. An ffc set to combo ID 0 will not run its script.


Edited by ZoriaRPG, 15 November 2016 - 12:41 AM.


#22 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 15 November 2016 - 10:56 AM

Compiled successfully.

 

Now I did the following:

 

  • Placed the FFC on the Conveyor Combo
  • FFC assigned to the FasterConveyor Slot
  • Set its combo ID to 1

Result:

  • Link doesn't get pushed away. (If I set the conveyor combo to (None))
  • Link gets pushed away but in the same matter like a regular conveyor. (If I set the conveyor combo to one of the conveyor combo types.

Same here if I set the FFC's combo ID to the conveyor combo.



#23 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 15 November 2016 - 11:21 AM

I use conveyor and a low value in D0 then it push Link very fast, i even tryed value 1 in D0 and wow it push fast.


Edited by judasrising, 15 November 2016 - 11:22 AM.

  • Sparkster likes this

#24 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 15 November 2016 - 12:08 PM

I use conveyor and a low value in D0 then it push Link very fast, i even tryed value 1 in D0 and wow it push fast.

 

Hey thank you for the tip. I set D0 to 1 and D1 to 0, the conveyor combo to one of the conveyor combo types, and it has worked. Thank you judasrising. I had D0 set to 30.

 

EDIT: How can I give you the demo?


Edited by Sparkster, 15 November 2016 - 12:14 PM.

  • judasrising likes this

#25 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 15 November 2016 - 12:40 PM

I wasn't sure what values would work best. 30 is two extra pixels per frame. 10 is six extra pixels per frame.

 

Thinking about it, here are some values to try:

 

15 -> 1/4 tile of extra movement.

8 or 9 -> Roughly 1/2 tile of extra movement per frame.

 

You can play with them as needed. CanWalk() should be safe in all four directions with step at '1', but you may need to increase the step value to '2' or even '4' with very high speeds, to prevent pushing Link into solid combos.

 

You may wish to test this, and if it wrks, replace the ffc with this version:

 

Faster Conveyors v0.1.5

 

One of the reasons that I originally set it up as an if/else-if/else, was to ensure that the timer resets as soon as Link moves off of a conveyor, or changes to a conveyor of another. This is to prevent speed fluctuation bugs.

 

Give that a test.

 

This also includes two extra ffcs:

 

FasterConveyorsInhFlagged : This only increases conveyors if they have the inherent flag specified by constant FFC_FLAG_I_FAST_CONVEY. The default inherent flag is Script 3. When this script is running, any conveyors that have this inherent flag will speed up.

 

FasterConveyorsManFlagged : Similar to the above, save that it works with any conveyor that has a manually placed flag of the type specified by the constant FFC_FLAG_FAST_CONVEY. The default is Script 2.  When this script runs, any conveyor on which you place this flag will speed up.

 

You can freely mix and match these two ffcs, and you can place both on the screen at one time. The effects can be cumulative (e.g., a conveyor with both the placed flag, and the inherent flag can potentially combine effects.) so you may wish to take care with placement.


Edited by ZoriaRPG, 15 November 2016 - 12:41 PM.


#26 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 15 November 2016 - 02:56 PM

I wasn't sure what values would work best. 30 is two extra pixels per frame. 10 is six extra pixels per frame.

 

Thinking about it, here are some values to try:

 

15 -> 1/4 tile of extra movement.

8 or 9 -> Roughly 1/2 tile of extra movement per frame.

 

You can play with them as needed. CanWalk() should be safe in all four directions with step at '1', but you may need to increase the step value to '2' or even '4' with very high speeds, to prevent pushing Link into solid combos.

 

You may wish to test this, and if it wrks, replace the ffc with this version:

 

Faster Conveyors v0.1.5

 

One of the reasons that I originally set it up as an if/else-if/else, was to ensure that the timer resets as soon as Link moves off of a conveyor, or changes to a conveyor of another. This is to prevent speed fluctuation bugs.

 

Give that a test.

 

This also includes two extra ffcs:

 

FasterConveyorsInhFlagged : This only increases conveyors if they have the inherent flag specified by constant FFC_FLAG_I_FAST_CONVEY. The default inherent flag is Script 3. When this script is running, any conveyors that have this inherent flag will speed up.

 

FasterConveyorsManFlagged : Similar to the above, save that it works with any conveyor that has a manually placed flag of the type specified by the constant FFC_FLAG_FAST_CONVEY. The default is Script 2.  When this script runs, any conveyor on which you place this flag will speed up.

 

You can freely mix and match these two ffcs, and you can place both on the screen at one time. The effects can be cumulative (e.g., a conveyor with both the placed flag, and the inherent flag can potentially combine effects.) so you may wish to take care with placement.

I did some tests and it seems to work fine i also have a testquest with all that ,but i noticed some differens between the global and the FFC variants, 

i send the file from skype and i explain further.



#27 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 16 November 2016 - 05:17 AM

Nice Idea, Zoria. That new version compiled successfully, too. And as you may know it already, I'm using the FFC version of this script.

 

It is also working. Both normal and fast conveyors are working.

 

Header is only std.zh.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users