Reply to Thread
Results 1 to 3 of 3

Thread: Query box for barracks and generals!

  1. #1
    Recruit
    Join Date
    Mar 2014
    Posts
    5
    World
    Ares

    Post Query box for barracks and generals!




    We have seen all those rants by people wanting bigger barracks increments, a button to unload generals or a box to type troop number in along with the slider.

    Well I have come up with an idea that may be the solution to all these fun breaking issues. Simply a query box!

    We all know that shortcut letters are used for units, among players in chat or in adventure guides [,m,s,c,b,l/lb,a/xb,k]

    So how about having a query box in the barracks and general interface?

    The player simply types the query for the army they want created/loaded e.g 50r 20m 30c 150e and the game reads this query and translates it.

    Up to this point my suggestion is well illustrated.
    ------------------------------------------------------------------------------------------------

    This is a pseudo code for the process, It's nothing but I know the developers are busy with the event and hope they accept it as a modest gift

    Code:
    string[] shortcuts //Contains shortcut letters
    UnitType[] types //Unit types in same order as shortcuts
    // Shortcuts and types can be added to a dictionary.
    
    OnOkPress()
    {
      string input //To be read from query
      string[] inputBits = Regex.Match(input, "[0-9]{1,4}[a-zA-Z]+")
    
      if(inputBits.count == 0)
        ShowMessage("Invalid input: " + input) and break
    
      DataClass[] data
    
      foreach string s in inputBits
      {
          data.add(new DataClass(s))
      }
    
      QueryToServer(data) // For barracks
      LoadToGUI(data) // General loading
    }
    
    DataClass
    {
      UnitType uType
      int uCount
      DataClass(string id)
      {
        Try{
        string t = Regex.Match(id, "[a-zA-Z]+").ToLower()
        uType = types[shortcuts.IndexOf(t)] //Will cause error when t is not in types
    
        uCount = ParseToInt(Regex.Match(id, "[0-9]{1,4}"))
        }
        Catch{ShowMessage("Invalid input segment: " + id) and break}
        // Checking against resources/general limits can be done here based on other data as well
      }
    }
    Have a nice day everyone
    Attached Images

  2. #2
    Recruit
    Join Date
    Dec 2013
    Location
    Oklahoma
    Posts
    32
    World
    Ares
    I would rather like to see a second slider bar to multiply how many times 25 troops you want to make granted you have the proper resources & in Pro House as well

  3. #3
    Recruit
    Join Date
    Dec 2013
    Posts
    36
    World
    Ares
    great idea

Reply to 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