Jump to content

Photo

Screen State Carryover?


  • Please log in to reply
39 replies to this topic

#1 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 15 May 2011 - 06:28 PM

Lets say after I finish a block puzzle, I want an item to fall form the ceiling, AND make a switch go down in another room. How do I do this?

#2 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 15 May 2011 - 07:44 PM

Making an item fall from the ceiling without scripting requires killing the enemies in the room. Block secrets are temporary and cannot be used for carryovers.

You'll have to put an enemy at the end of the puzzle and use enemies->secret, enemies->item, and screen state carryover to the screen you want.

#3 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 15 May 2011 - 07:48 PM

Ahh, this won't work because he won't have the sword until after.
Could I make a switch appear, and then make Link step on it, making that permanent and undoing the switch in the other room?

#4 Isdrakthül

Isdrakthül

    Apprentice

  • Members

Posted 15 May 2011 - 08:23 PM

I could probably write a script that kills an onscreen enemy when all of the block triggers are activated if you want to do it that way.

#5 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 15 May 2011 - 08:30 PM

That sounds absolutely perfect!
Thank you!!

#6 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 15 May 2011 - 09:07 PM

You could use the kill all enemies item ala 2.10, right?

#7 Isdrakthül

Isdrakthül

    Apprentice

  • Members

Posted 15 May 2011 - 10:38 PM

I wrote the script but don't have time to test it right now. See if this works.

CODE

const int PlaceholderNum = 9;

int i;

bool isBlockInt(int TInt){
    if(TInt==1 || TInt==2) return(true);
    else if(TInt>=47 && TInt<=65) return(true);
    else return(false);
}

bool isBlock(int x, int y){
    if(isBlockInt(Screen->ComboF[ComboAt(x, y)]) || isBlockInt(Screen->ComboI[ComboAt(x, y)])) return(true);
    else return(false);
}

bool BlockOn(){
    for(i=1; i<=32; i++){
        ffc TFFC = Screen->LoadFFC(i);
        if(TFFC->Script==PlaceholderNum && !isBlock(TFFC->X, TFFC->Y)) return(false);
    }
    return(true);
}
        

ffc script Placeholder{
    void run(){
    while(true){
        Waitframe();
    }
    }
}

ffc script BTrigger{
    void run(){
    while(true){
        if(isBlock(this->X, this->Y) && BlockOn()){
            for(i=1; i<=Screen->NumNPCs(); i++){
                npc deadman = Screen->LoadNPC(i);
                deadman->HP = 0;
            }
            Quit();
        }
        Waitframe();
    }
    }
}

const int PlaceholderNum is the number of the script slot to which the Placeholder script is assigned.

To use this, have exactly one enemy (probably a Trigger enemy) on the screen. Put your triggers where you want them, then add one that is inaccessible to the blocks. Put an FFC with the BTrigger script on the first accessible trigger, then put Placeholder script FFCs on all of the other accessible triggers.

Edited by Isdrakthül, 16 May 2011 - 08:24 PM.


#8 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 16 May 2011 - 10:40 AM

Wait, i'm lost How do I set it? I don't understand.

#9 Isdrakthül

Isdrakthül

    Apprentice

  • Members

Posted 16 May 2011 - 05:28 PM

When you assign a script to a slot, the slot has a number. Placeholdernum should be set to that number for the Placeholder FFC script.

When making the screen, add one block trigger more than you need in a place that the blocks can't reach.

Select one of the block triggers that the blocks can reach. Put an FFC exactly on top of it and assign the BTrigger script to the FFC.

Now do the same for all of the other triggers that can be reached by the blocks, but assign the Placeholder script to the FFCs instead of the BTrigger.

Now put some sort of enemy somewhere on the screen. This will be killed when the blocks are pushed onto the triggers with FFCs on them. Do not use any other enemies.

Now set the appropriate flags. In this case, use enemies->secret and enemies->item along with a Screen State Carryover to the screen you want, as MoscowModder said.

#10 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 16 May 2011 - 05:49 PM

When i tried to compile, it gives me:

LINE 33: SYNTAX ERROR: UNEXPECTED SCRIPT, EXPECTING IDENTIFIER, ON TOKEN SCRIPT
FATAL ERROR P00: CAN'T OPEN OR PARSE INPUT FILE!

--PRESS A KEY--

What's wrong?

#11 Isdrakthül

Isdrakthül

    Apprentice

  • Members

Posted 16 May 2011 - 06:06 PM

I missed a bracket. The post containing the script has been edited.

#12 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 16 May 2011 - 06:09 PM

Now it gives me this:

IPB Image

#13 Isdrakthül

Isdrakthül

    Apprentice

  • Members

Posted 16 May 2011 - 06:40 PM

I made a few typos. They have been fixed.

#14 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 16 May 2011 - 07:12 PM

It compiled and such, but nothing happens when I push the blocks onto the spots. The enemy doesn't get killed, and the Screen Carryover doesn't happen. But, the screen carryover DOES work when I kill the enemy manually icon_razz.gif

Edited by Lynker, 16 May 2011 - 07:14 PM.


#15 Isdrakthül

Isdrakthül

    Apprentice

  • Members

Posted 16 May 2011 - 07:19 PM

Odd. Try it now.

I hope that the problem isn't what I think it is.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users