User Tag List

Results 1 to 9 of 9

Thread: Simple question for script command I cant find

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gel
    Join Date
    Feb 2015
    Posts
    7
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    369
    Level
    7
    vBActivity - Bars
    Lv. Percent
    1.27%
    @SUCCESSOR that sounds about perfect! also, i think i found a simple way to do what im looking at as well. have a variable that keeps track of links form number, and set R to run a function depending on the current form that removes and adds items to link, grabbing the data from an array stating which items are obtained, and then changes his form number. stick pickup scripts onto all your items that changes their value in the array to 'obtained', then checks his form number. if it is incorrect, it removes the item, and if its right, he equips it to his open slot. when you cycle around to the correct form, the R script should pull the items data from the array and put it back on the right button?

  2. #2
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,566
    Level
    30
    vBActivity - Bars
    Lv. Percent
    52.42%
    Quote Originally Posted by Spacepoet View Post
    @SUCCESSOR that sounds about perfect! also, i think i found a simple way to do what im looking at as well. have a variable that keeps track of links form number, and set R to run a function depending on the current form that removes and adds items to link, grabbing the data from an array stating which items are obtained, and then changes his form number. stick pickup scripts onto all your items that changes their value in the array to 'obtained', then checks his form number. if it is incorrect, it removes the item, and if its right, he equips it to his open slot. when you cycle around to the correct form, the R script should pull the items data from the array and put it back on the right button?
    The variable and pickup scripts would be superfluous. Though since you pickup items in sets I guess it wouldn't be that many, but still superfluous. The array example I showed you uses the first index of the array exactly as you are intending to use a variable. It is a global array so any script can check what set is active by doing itemSets[0] or more readibly: itemSets[ITEM_SET_POSITION]. Your script can easily tell if the player picked up an item set by looking for changes in Link->Items[]. Since it only has to check for items that are in part of a set and not all the items in the game there is no problem in running that check every frame.

    An example look:

    //NUM_ITEMS_IN_SETS = 2;
    itemSets[1,5.1,23.1,15.1,31.1,52,3,...]


    We can see here that the current set in use is Set1 so Link has Bow(15) and the Whistle(31) equipped and we can also see that he has the items of Set0, Sword(5) and Boomerang(23) but not the items of Set3 Hookshot(52) and Bombs(3). If we use the convention that A comes first then B we know that the Bow should be assigned to A and the Whistle should be assigned to B.

    itemSets[0,5.1,23.1,15,31,52,3,...]

    Now Set0 is active and Link has the Sword and BRang and no other sets to use.


    (all these names and items are examples of course. What you name your constants and arrays is obviously up to you.)

    To mark as obtained:

    Code:
    for(int i = 1,i<100,i++)//start at 1 because the 0 index is used to mark the current item set; the 100 is irrelevant it just has to be bigger than the amount of items
    {	if(!itemSets[i]) break;//we reached an index with a zero value so we end the loop.
    	if(Link->Item[floor(itemSets[i])] && !(itemSets[i] - floor(itemSets[i]) ) )//if Link has the item but it hasn't been marked as obtain in the array
    		itemSets[i] = itemSets[i] + .1; //mark it as obtained in the array
    }

    (once again: just how I would go about it)

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