Jump to content

Photo

"Item check"


  • Please log in to reply
4 replies to this topic

#1 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 25 September 2008 - 03:42 PM

How is it possible to let a script check if the player has certain items on a certain screen and makes the player warp if he is on that screen with the weapons he need? So I suppose this needs to be a FFC script, but I don't know what to do then. I assume it needs to start out like this:
CODE
ffc script itemcheck{
void run(){
if(checks items here, don't know how to do this)&&(checks if the player is on the screen, don't know how to do this){
warps player, no idea how;
}
}
}

Can anyone help me out to this, the items the player needs is a sword and a shield, but I guess I can alternate that later on.

Reward:
Credits on *cough* my *cough*(I wonder if anyone actually know what I mean by my fake cough there) still unannounced quest.

Thanks in advance.

#2 Joe123

Joe123

    Retired

  • Members

Posted 25 September 2008 - 03:46 PM

CODE
const int AutoWarpCombo = 0; //set this to an autowarp combo

ffc script Item_Check{
    void run(int check){
        while(!Link->Item[check]) Waitframe();
        this->Data = AutoWarpCombo;
    }
}


D0 is the item ID of the item to check for.
Set the value of the noted (has // before it) line to be the combo ID of a combo with the type 'autowarp A'.
Then, set the screen's Sidewarp A to be where you want to the warp to take you to.

If you want it to be a direct warp, check the 'Autowarps Are Direct' screen flag.

#3 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 26 September 2008 - 02:39 PM

Thank you! I suppose I can change:
CODE
while(!Link->Item[check]) Waitframe();

This line to:
CODE
while(!Link->Item[check])&&(!Link->Item[check2) Waitframe();

If I want to add another line? (Yes I know I need to add "check2" to the into the brackets after void run)

Also thanks for learning me some new scripting terms, requesting is probably one of the little opportunities to learn scripting, since resources like tutorials are in very small amounts.

#4 Joe123

Joe123

    Retired

  • Members

Posted 26 September 2008 - 06:34 PM

CODE
const int AutoWarpCombo = 0; //set this to an autowarp combo

ffc script Item_Check{
    void run(int check, int check2){
        while(!Link->Item[check] || !Link->Item[check2]) Waitframe();
        this->Data = AutoWarpCombo;
    }
}


#5 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 26 September 2008 - 06:51 PM

Ahh, so the formula is like that, I really need to get of my lazy but and look around some more, I'm from the past, I'm from Actionscripting...

Thanks!


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users