User Tag List

Results 1 to 2 of 2

Thread: Bags of money (ala Skyrim sorta!)

  1. #1
    Lynel Majora's Avatar
    Join Date
    Mar 2006
    Age
    32
    Posts
    1,197
    Mentioned
    24 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    4,389
    Level
    20
    vBActivity - Bars
    Lv. Percent
    94.33%

    Bags of money (ala Skyrim sorta!)

    Can anyone write me a quick little script? It'll be an on-pickup item script where link will be awarded a random number of rupees between two definable values. I have an item in my quest that looks like a little bag of money (i.e. like the item in Skyrim).

    Higher amounts should be rarer of course. For instance, getting anywhere from 5-20 rupees should happen like 80% of the time. getting 21-50 rupees should occur 10% of the time. Getting 50-99 rupees should occur 5% of the time, and getting an even 100 should occur 1% of the time. Getting 0-4 rupees should happen 4% of the time.

    Just a rough guideline. you may implement this however you wish but the bottom line: on item pickup, random amount of rupees is given, with higher values being rarer.

  2. #2
    Admiral Zim's Avatar
    Join Date
    Oct 2012
    Posts
    388
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    1,704
    Level
    13
    vBActivity - Bars
    Lv. Percent
    84.43%
    I tested this on my ZC and this code seems to do exactly what you asked for (approximately).
    D0 is minimum amount of rupees given by the rupee pickup and D1 is the maximum it will give.
    Code:
    item script RupeeScore
    {
    void run(int minrupees,int maxrupees)
    {
    int rupees=minrupees+Rand(maxrupees);if(rupees>maxrupees)rupees=maxrupees;
    int percentage=Choose(1,2,3);
    if(percentage==1||percentage==2)
    	{
    	int mindiv=Rand(4);if(mindiv==0)mindiv=1;int split=Ceiling(maxrupees/5)/mindiv;
    	Game->Counter[1]+=Ceiling(split);
    	}
    if(percentage==3)
    	{
    	percentage=Choose(1,2,3);
    	if(percentage==1)
    		{
    		int mindiv=Rand(4);if(mindiv==0)mindiv=1;int split=Ceiling(maxrupees/5)/mindiv;
    		if(split<minrupees)split=minrupees;
    		Game->Counter[1]+=Ceiling(split);
    		}		
    	if(percentage==2)
    		{
    		int mindiv=Rand(2);if(mindiv==0)mindiv=1;int split=Ceiling(maxrupees/2)/mindiv;
    		if(split<minrupees)split=minrupees;
    		Game->Counter[1]+=Ceiling(split);
    		}
    	if(percentage==3)	
    		{
    		percentage=Choose(1,2,3);
    		if(percentage==1)
    			{
    			int mindiv=Rand(5);if(mindiv==0)mindiv=1;int split=Ceiling(rupees/mindiv);
    			if(split<minrupees)split=minrupees;
    			Game->Counter[1]+=Ceiling(split);
    			}		
    		if(percentage==2)
    			{
    			int mindiv=Rand(10);if(mindiv==0)mindiv=1;int split=Ceiling(rupees/mindiv);
    			if(split<minrupees)split=minrupees;
    			Game->Counter[1]+=Ceiling(split);
    			}
    		if(percentage==3)	
    			{
    			int mindiv=Rand(10);int split=Ceiling(rupees/mindiv);
    			if(split<minrupees)split=minrupees;
    			if(rupees!=maxrupees){Game->Counter[1]+=Ceiling(split);}
    			if(rupees==maxrupees){Game->Counter[1]+=maxrupees;}
    			}
    		}
    	}
    }
    }
    Keese! Keese Keese!

    I could write in a thing to display the amount of rupees the script gives also if you'd prefer that.. Also the thought of making the counter go up by 1 until the amount it gives is reached might be desirable, although then you might run into some of those bugs similar to spending the same rupees twice dealios if the player gets other rupees by other methods before the counter hits it's mark and whatnot.
    It's fine the way it is though.
    Last edited by SUCCESSOR; 01-28-2013 at 01:47 AM. Reason: Senseless multiple posts

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