Thread: Better way to handle quest and there stages

Results 1 to 9 of 9
  1. #1 Better way to handle quest and there stages 
    Registered Member Purple Helix's Avatar
    Join Date
    Jun 2013
    Posts
    93
    Thanks given
    6
    Thanks received
    23
    Rep Power
    33
    I didn't take the time to count how many quests are in the quest journal but I doubt anyone has 50 quest on there server so adjust the constant to your liking.

    This will eliminate having to create and save a variable for each quest.

    Code:
    package com.model.actor.player;
    
    /**
     * 
     * @author Purple Helix
     *
     */
    public class PlayerQuests {
    	
    	/**
    	 * Array span of quests.
    	 */
    	private Integer[] quest = new Integer[MAX_QUESTS];
    	
    	/**
    	 * Gets quests.
    	 * @return
    	 */
    	public Integer[] getQuest() {
    		for (int i = 0; i < quest.length; i++) {
    			if (quest[i] == null) {
    				quest[i] = 0;
    			}
    		}
    		return quest;
    	}
    	
    	/**
    	 * Sets the quest stage.
    	 * @param quest
    	 * @param stage
    	 */
    	public void setQuestStage(Integer quest, Integer stage) {
    		this.quest[quest] = stage;
    	}
    	
    	public static final int BLACK_KNIGHTS_FORTRESS = 0;
    	
    	public static final int MAX_QUESTS = 50;
    
    }

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,108
    Thanks given
    2,402
    Thanks received
    2,825
    Rep Power
    4604
    You can't surely be serious. I get that its a snippet but it's near useless. You haven't actually done much of anything. You should beef it up and create a more advanced way of handling quest stages.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Banned

    Join Date
    Apr 2012
    Posts
    3,259
    Thanks given
    2,554
    Thanks received
    832
    Rep Power
    0
    Are you kidding me..
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Registered Member Purple Helix's Avatar
    Join Date
    Jun 2013
    Posts
    93
    Thanks given
    6
    Thanks received
    23
    Rep Power
    33
    Quote Originally Posted by Jason View Post
    You can't surely be serious. I get that its a snippet but it's near useless. You haven't actually done much of anything. You should beef it up and create a more advanced way of handling quest stages.
    Well throw me an idea and I will update it, surly this has to be better then stuffing

    public int
    blkKnightFortress = 0,
    cooksAssistant = 0,
    witchesPotion = 0;

    then saving them all right?

    This isn't a quest system just and idea I had.

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #5  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,108
    Thanks given
    2,402
    Thanks received
    2,825
    Rep Power
    4604
    Quote Originally Posted by Purple Helix View Post
    Well throw me an idea and I will update it, surly this has to be better then stuffing

    public int
    blkKnightFortress = 0,
    cooksAssistant = 0,
    witchesPotion = 0;

    then saving them all right?

    This isn't a quest system just and idea I had.
    Yeah but anyone on these forums with half a brain and conjure up a few variables in a new class. Since you're up for the challenge, create a quest system thats dynamic and organized.
    Reply With Quote  
     

  8. #6  
    Renown Programmer

    Join Date
    Dec 2010
    Posts
    2,883
    Thanks given
    509
    Thanks received
    1,907
    Rep Power
    5000
    why are you using boxed primitives

    why did you even post this
    never talk to me or my wife's son ever again
    Reply With Quote  
     

  9. #7  
    Banned Market Banned Market Banned


    Join Date
    Jan 2011
    Age
    23
    Posts
    3,115
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    what even is this? you're supposed to use abstraction
    Reply With Quote  
     

  10. #8  
    Java Developer

    Celty's Avatar
    Join Date
    Aug 2013
    Age
    27
    Posts
    355
    Thanks given
    94
    Thanks received
    91
    Rep Power
    173
    Quote Originally Posted by lare96 View Post
    what even is this? you're supposed to use abstraction
    From looking at it and reading the posts in the thread this is basically a way to save quest as apposed to creating single integer per quest.

    as for "you're supposed to use abstraction"

    This obviously isn't a quest system, but if you where to make one a interface or a abstract class would be appropriate.
    Reply With Quote  
     

  11. #9  
    Banned
    Join Date
    Aug 2013
    Posts
    71
    Thanks given
    264
    Thanks received
    6
    Rep Power
    0
    This is better then what comes with PI so why make so much commotion over something honestly. You wonder why people never give back to our community as much as they would like to cause of idiots like you guy's.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Replies: 19
    Last Post: 08-18-2012, 09:54 PM
  2. [667/***] Better way to handle staff
    By asteria-X in forum Tutorials
    Replies: 24
    Last Post: 07-19-2012, 03:18 AM
  3. 562 Better way to handle overloads
    By Makar in forum Snippets
    Replies: 17
    Last Post: 11-01-2011, 10:16 PM
  4. Better way to download gta san andreas
    By FutureDesigner1 in forum PC
    Replies: 1
    Last Post: 05-26-2008, 08:37 PM
  5. Replies: 1
    Last Post: 01-10-2008, 05:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •