User Tag List

Results 1 to 2 of 2

Thread: Utility Script #3 Spawn Item

  1. #1
    Octorok
    Join Date
    Jan 2007
    Age
    38
    Posts
    143
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,173
    Level
    11
    vBActivity - Bars
    Lv. Percent
    74.27%

    Utility Script #3 Spawn Item

    A very simple, yet still useful utility script.

    Script #3 Spawn Item
    Spawns an item at the FFC's position when activated.
    It can be flagged to spawn the item only if Link doesn't already have it.

    Code:
    //Various Scripts, by HeroOfFire
    
    //NOTE: When I say activation of a script, I mean setting its CSet to 0.
    //This is how I tell a script its been activated, triggered, etc.
    
    import "std.zh"
    
    //FFC Script SpawnItem
    //Script that creates an item at the FFC's postion when activated
    //Can be used to create common items infinetly or rare items once
    //Not good to use with dungeon items (Map, Compass, Keys)
    //D0 = FFC Number (starts at 1)
    //D1 = Number of the item to be spawned
    //D2 = If 1, check Link's inventory to see if he already has the item (good for one-time spawning)
    ffc script SpawnItem {
    
     void run(float thisFFC, int itemSpawn, int checkInventory) {
        ffc this1 = Screen->LoadFFC(thisFFC);
        while (true)
        {
            if (this1->CSet == 0)
            {
                if (checkInventory == 1)
                {
                    if (Link->Item[itemSpawn] == false)
                    {
                        item iSpawn = Screen->CreateItem(itemSpawn);
                        iSpawn->X = this1->X;
                        iSpawn->Y = this1->Y;
                    }
                }
                else
                {
                    item iSpawn = Screen->CreateItem(itemSpawn);
                    iSpawn->X = this1->X;
                    iSpawn->Y = this1->Y;
                }
                this1->Data = 0;
                Quit();
            }
            Waitframe();
        }
     }
    }
    Quick Overview:
    This script has 3 parameters.
    The first is the FFC number.
    The second is the item ID (via the I constants in std.zh).
    The third is a flag. If 1, check Link's inventory for the item about to be spawned and spawn it only if Link doesn't have it.

    Basic Uses:
    Spawn an item when you trigger a secret (possibly through killing all enemies).
    Spawn an item by activating this script through another script (like my FFCInterface).

    Cool Things:
    Infinite spawning potential: You can spawn the item every time you enter the room and activate the FFC.
    Moving Item Spawn: Why can't the FFC be moving around?
    2+ items per screen: You can spawn mutliple items by using this script.

    Awsome Idea:
    Try this. FFC1 = FFCInterface. FFC2 = SpawnItem. FFC3 = ProgressChecker.
    FFC2 is placed over a solid block and looks like a treasure chest.
    FFC3 is set to waiting for activation and will change the solid block under FFC2 into an open treasure chest.
    FFC1 looks like a button and activates both FFC2 and FFC3 when you step on it.
    Volia! A treasure chest triggered by FFCs and no secret combos (meaning you can have multiple per screen).

    Flaw:
    Dungeon items are a bit strange. You can't really check for keys (can you?), and there is no point in infinetly spawning maps, compasses, keys, or boss keys. Triforce items are also a bad idea to mutli-spawn.

    Possible Updates:
    Maybe I'll add a few if statements to check for problems, but otherwise, this script works well.
    Programmings my game because I program games.
    "Wait. You lost me at the part about the 'almost certain death'." - A quote I would love to make in an MMORPG.
    Disclaimer: Din's Fire does not make the user immune to the effects of lava. Do not use Din's Fire in mid-jump over a pool of lava. Death and severe burns will follow.

    ZCG Current Version:
    Version 0.05
    For Mac Build 1076 Windows Build 1082

  2. #2
    Gel
    Join Date
    Apr 2008
    Age
    30
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    639
    Level
    8
    vBActivity - Bars
    Lv. Percent
    97.65%

    Re: Utility Script #3 Spawn Item

    Here's an Idea-

    more arrows-bombs mid-boss battle.

    1. if (Whatever you need=0)
    change ffc cset to 0

    OR (to make it more challengeing)

    if (ammo)=0
    direct warp to screen with this script
    have ffc cset START at 0, producing item immediately
    either have more direct warps back OR some sort of script that

    wait a few frames
    when there is no item on the screen,
    direct warp.

    ect.

    Great job!
    :eyebrow:

    (Or so he says...)

Thread Information

Users Browsing this Thread

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

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