Jump to content

Photo

Script request


  • Please log in to reply
6 replies to this topic

#1 Sephiroth

Sephiroth

    The Legendary Sephiroth

  • Members
  • Location:Somewhere... Lemme know if you find me :)

Posted 28 September 2009 - 06:06 PM

Well, as you may have guessed.

IPB Image


As you may have guessed, blocks and switches.

Now, what I would possibly like to do.

See those red and blue blocks? I'd like to take this off the whole room state carry over setup, and set it up as either an FFC script, or a global script.

I'd like to continue using step buttons like you see on the screen as well, instead of using an orb you whack with a blunt object.

Hopefully I described things well.

I'd like to regain my secrets in this dungeon so I can insert additional puzzles and challenge into the dungeon itself.

Thank you for reading.

Edit: ... oh phooey, I dropped this in the wrong forum, could I get someone to please cart it over to script requests for me?

Edited by Sephiroth, 28 September 2009 - 06:07 PM.


#2 Sephiroth

Sephiroth

    The Legendary Sephiroth

  • Members
  • Location:Somewhere... Lemme know if you find me :)

Posted 30 September 2009 - 05:49 PM

Anybody?

While this script would be nice, I can always design without it. icon_frown.gif

#3 Joe123

Joe123

    Retired

  • Members

Posted 01 October 2009 - 10:01 AM

I have what you're after with the 'whack with blunt object' approach that works pretty much flawlessly, I suppose it wouldn't be hard for someone to modify it for step-buttons instead if I were to post it up.

#4 Sephiroth

Sephiroth

    The Legendary Sephiroth

  • Members
  • Location:Somewhere... Lemme know if you find me :)

Posted 01 October 2009 - 12:25 PM

I guess it wouldn't hurt to redesign some rooms to incorporate the 'whack with blunt object' approach. I would appreciate the script, Joe. ^_^

#5 Joe123

Joe123

    Retired

  • Members

Posted 04 October 2009 - 10:43 AM

CODE
//The Red/Blue block system, much like in the Oracles games
const int CMB_OFFORB        = 19072;         //Orb to switch blocks
const int CMB_BLUEBLOCK    = 19076;         //Blue block
const int CMB_REDBLOCK    = 19080;         //Red block
bool BlockState;
ffc script RedBlueBlock{
    void run(int blueoff, int redoff, int offorb){
    int orb[5]; //Arbitrary value of max orbs per screen
    int orbcount;
    bool switched;

    if(offorb==0) offorb = CMB_OFFORB;
    if(blueoff==0) blueoff = CMB_BLUEBLOCK;
    if(redoff==0) redoff = CMB_REDBLOCK;
    
        for(int i=0;i<176;i++){
            if((Screen->ComboD[i] == blueoff && BlockState) || (Screen->ComboD[i] == redoff && !BlockState)) Screen->ComboD[i] += 2;
            if(Screen->ComboD[i]  != offorb || orbcount == 5) continue;
            orb[orbcount] = i;
            orbcount++;
        }
        
        while(true){
            switched = false;
            while(!switched){
                Waitframe();
                for(int i=0;i<orbcount;i++){
                    for(int j=1;j<=Screen->NumLWeapons();j++){
                        lweapon check = Screen->LoadLWeapon(j);
                        if(check->ID == LW_BOMB || Abs(check->X-ComboX(orb[i])) >= 8 || Abs(check->Y-ComboY(orb[i])) >= 8) continue;
                        if(check->ID == LW_BRANG) check->DeadState = WDS_BOUNCE;
                        if(check->ID == LW_ARROW) check->DeadState = WDS_ARROW;
                        if(check->ID == LW_MAGIC) check->DeadState = WDS_DEAD;
                        switched = true;
                        Screen->ComboD[orb[i]]++;
                    }
                }
            }
            BlockState = !BlockState;
            Game->PlaySound(SFX_SECRET);
            for(int i=0;i<176;i++){
                if(Screen->ComboD[i] == blueoff || Screen->ComboD[i] == redoff+2
                || Screen->ComboD[i] == blueoff+2 || Screen->ComboD[i] == redoff) Screen->ComboD[i]++;
            }
            Waitframes(60);
        }
    }
}


Something like that.
I can't remember how you have to set it up exactly, I'll have a look in a bit.

EDIT:
Ok yeah, blocks are set up like this:
CODE
A|B|C|D

in the combopage, where A is the blue block while it's down. B is an animation of that block moving up, which then cycles to C. C is the blue block while it's up, and D is an animation of the blue block moving down, which cycles back to A.
CMB_BLUEBLOCK should have the value A's combo ID number.
The red blocks should be set up in the same way.

With the crystal, you have two combos. The first is the crystal while it's 'deactivated', then the second one is an animation of it 'activating', which then cycles back to the first combo when the animation finishes. CMB_OFFORB is the combo ID of the first of those two combos. They have to be consecutive otherwise the script won't work.

Other than that you pretty much just bung the script on the screen and go. Only ever place down the 'A' combo for each block, don't ever place any of the other ones in the sequence. The script will make the blocks rise when you enter the screen (make sure it has 'Run scripts at screen init' checked otherwise there won't be up as soon as you enter which looks bad).
D0 D1 and D2 are for different values of the three constants, so if you want different graphics for blocks on certain screens you can edit those, but if you leave them at 0 the constant values are used.

#6 AgentLym

AgentLym

    • Zelda and Pokémon Master •

  • Members
  • Location:Skyloft

Posted 06 October 2009 - 06:57 AM

Do we have to check the 'FFCs Carryover' screen flag and stuff? Or would we just stick the script into every screen? (and how would that still work, since it seems like the script would reset every-- wait a minute, nevermind! Just noticed the global bool. icon_razz.gif)

So, we just stick the script on every screen that uses it, right?

#7 Joe123

Joe123

    Retired

  • Members

Posted 06 October 2009 - 07:04 AM

Yes, just put it on every screen.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users