User Tag List

Results 1 to 9 of 9

Thread: Script Help Request (again)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Keese ywkls's Avatar
    Join Date
    Feb 2016
    Posts
    62
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    481
    Level
    7
    vBActivity - Bars
    Lv. Percent
    90.71%
    Alright, try this. No guarantees it will work, because it is untested. Place the ffc (that looks like a chest) on top of a solid combo that looks like the open chest and set the flag to Run Script at Screen Init.

    CODE: Show

    ffc script Locked_Treasure_Chest{
    void run(int item_ID,int Key_Counter){
    if(Screen->State[ST_CHEST]){
    this->Data = 0;
    Quit();
    }
    while(!Activated(this,Key_Counter))
    Waitframe();

    this->Data = GH_INVISIBLE_COMBO;
    CreateItemAt(item_ID,Link->X,Link->Y);
    Game->Counter[Key_Counter]--;
    Link->Action = LA_HOLD2LAND;
    Link->HeldItem = item_ID;
    Screen->State[ST_CHEST]=true;
    ` KeepAUnpressed();
    this->Data = 0;
    }
    }

    bool Activated(ffc this, int Key_Counter){
    if(Game->Counter[Key_Counter]==0)return false;
    if(Link->Dir!=DIR_UP)return false;
    if(Link->X<this->-8)return false;
    if(Link->X>this->X+8)return false;
    if(Link->Y<this->Y+8)return false;
    if(Link->Y>this->Y+16)return false;
    if(!Link->PressA)return false;
    return true;
    }

    void KeepAUnpressed(){
    while(Link->InputA){
    Link->InputA = false;
    Link->PressA = false;
    Waitframe();
    }
    }


    The basics for this script were created by Saffith, I just modified it. The key item would have to increase the custom counter and that would be what you'd have to display onscreen, probably separate from the normal key counter. To initialize the counter, just add a section like this to either a global init script or the global active script above the while loop.

    CODE: Show

    int MaxKeys =100;//This needs to be outside of all loops.

    Game->MCounter[CR_SCRIPT1] = MaxKeys;//This part would be inside the init script or in the active script before the while loop.



    Let me know if that works!
    Last edited by ywkls; 05-08-2016 at 11:38 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social