[TUTO] Addition of a new building

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [TUTO] Addition of a new building

      Here is the tutorial as promised which allows you to added a new building to your game.

      We are going to need to do some manipulation in the php file and the database

      To start we will add it in our database at several places

      Before doing by sql queries we will add them directly by phpMyAdmin

      We will have to add our building in 3 tables
      • uni1_planets
      • uni1_vars
      • uni1_vars_requriements (Not required if you do not want a condition to unlock the building)
      We start of course where there are all our tables we look for this table



      Once we got back to our table



      Then we go down the bottom of our page to get here



      We arrive then on this page



      We do not need all the fields alone as that which I have filled is enough



      Keep in mind the name of your building because it must be identical in the table vars

      Once saved we see it all at the bottom of our page in the structure



      Now that this is done we move to the other table which is the vars
    • To start we go to our table uni1_vars



      Then we look at the ElementID that we can recover
      • Me ElementID -> 7


      We will fill only it is part of it that interests us to add our building



      • ElementID is the building id that we will find in our php file for me = 7
      • name is the name we chose in the planets table for me = bank
      • the class corresponds to the chosen type 0 = building
      • onPlanetType is to know where you want with this building 1 = planets, 3 = moon, 1 and 3 planets and moon. me = 1
      • onePerPlanet matches to just have 1 so let the number be 0
      • factor corresponds to the multiple for each new level for the price of the latter. me = 1.50
      • maxLevel is of course the maximum level number that the building can have. me = 255
      • cost901, cost902, cost903 is the price in metal, crystal, deuterium of your building you can add if you want it of the black matter (cost921)


      Once the information is filled, we just have to save it



      To see the information of your building go to the last page



      So we have our building in our table planets as well as our table vars
      For the last table I show you how to add conditions to unlock the building my I do not for my building (uni1_vars_requriements)
    • We start by going to our table uni1_vars_requriements



      Then we will insert one or more lines as you want



      So we will come to this page that allows us to enter the values that want



      What is the 3 columns
      • elementID corresponds to your id that you chose in the table vars for me = 7
      • requireID matches the building id or search to unlock the sample building -> Metal Mine = ID 1, Crystal Mine ID = 2
      • requiereLevel is the minimum level required to unlock the building


      These are the prerequisites are set up

      We finished with the database so we go to the php file
    • To put it simply there is just 1 file to add is the lang file (you must add it in all your lang files) TECH.php

      PHP Source Code: TECH.php

      1. $LNG['tech'] = array(
      2. 0 => 'Buildings',
      3. 1 => 'Metal Mine',
      4. 2 => 'Crystal Mine',
      5. 3 => 'Deuterium Refinery',
      6. 4 => 'Solar Power plant',
      7. 6 => 'University',
      8. 12 => 'Deuterium Power Plant',
      9. 14 => 'Robot Factory',
      10. 15 => 'Nanite Factory',
      11. 21 => 'Shipyard',
      12. 22 => 'Metal Storage',
      13. 23 => 'Crystal Storage',
      14. 24 => 'Deuterium Storage',
      15. 31 => 'Research Lab',
      16. 33 => 'Terraformer',
      17. 34 => 'Alliance Depot',
      18. 44 => 'Missile Silo',
      19. 7 => 'Bank', //Addon
      Display All

      after we add the descriptions

      PHP Source Code: TECH.php

      1. $LNG['shortDescription'] = array(
      2. 1 => 'Used in the extraction of metal ore, metal mines are of primary importance to all emerging and established empires.',
      3. 2 => 'Crystals are the main resource used to build electronic circuits and form certain alloy compounds.',
      4. 3 => 'Deuterium is used as fuel for spaceships and is harvested in the deep sea. Deuterium is a rare substance and is thus relatively expensive.',
      5. 4 => 'Solar power plants absorb energy from solar radiation. All mines need energy to operate.',
      6. 6 => 'Shortens research time each level by 8%.',
      7. 12 => 'The fusion reactor uses deuterium to produce energy.',
      8. 14 => 'Robotic factories provide construction robots to aid in the construction of buildings. Each level increases the speed of the upgrade of buildings',
      9. 15 => 'This is the ultimate in robotics technology. Each level cuts the construction time for buildings, ships, and defenses',
      10. 21 => 'All types of ships and defensive facilities are built in the planetary shipyard',
      11. 22 => 'Provides storage for excess Metal.',
      12. 23 => 'Provides storage for excess Crystal.',
      13. 24 => 'Provides storage for excess Deuterium',
      14. 31 => 'A research lab is required in order to conduct research into new technologies.',
      15. 33 => 'The Terraformer increases the usable area on the planet.',
      16. 34 => 'The Alliance Depot offers the possibility to supply fuel to friendly fleets in orbit.',
      17. 41 => 'The moon has no atmosphere therefore a lunar base must be built before the settlement of other buildings.',
      18. 42 => 'The sensor array allows you to monitor fleet movements. The higher the stage, the greater is the range of the phalanx.',
      19. 43 => 'Jump gates are huge transmitters that are able to send large fleets without loss of time through the universe.',
      20. 44 => 'missile silos used for storage of rockets.',
      21. 7 => 'The bank allows you to put resources in the shelter',
      Display All

      PHP Source Code: TECH.php

      1. $LNG['longDescription'] = array(
      2. 1 => 'Used in the extraction of metal ore, metal mines are of primary importance to all emerging and established empires.',
      3. 2 => 'Crystals are the main resource used to build electronic circuits and form certain alloy compounds.',
      4. 3 => 'Deuterium is used as fuel for spaceships and is harvested in the deep sea. Deuterium is a rare substance and is thus relatively expensive.',
      5. 4 => 'Solar power plants absorb energy from solar radiation. All mines need energy to operate.',
      6. 6 => 'Shortens research time each level by 8%.',
      7. 12 => 'The fusion reactor uses deuterium to produce energy.',
      8. 14 => 'Robotic factories provide construction robots to aid in the construction of buildings. Each level increases the speed of the upgrade of buildings',
      9. 15 => 'This is the ultimate in robotics technology. Each level cuts the construction time for buildings, ships, and defenses',
      10. 21 => 'All types of ships and defensive facilities are built in the planetary shipyard',
      11. 22 => 'Provides storage for excess Metal.',
      12. 23 => 'Provides storage for excess Crystal.',
      13. 24 => 'Provides storage for excess Deuterium',
      14. 31 => 'A research lab is required in order to conduct research into new technologies.',
      15. 33 => 'The Terraformer increases the usable area on the planet.',
      16. 34 => 'The Alliance Depot offers the possibility to supply fuel to friendly fleets in orbit.',
      17. 41 => 'The moon has no atmosphere therefore a lunar base must be built before the settlement of other buildings.',
      18. 42 => 'The sensor array allows you to monitor fleet movements. The higher the stage, the greater is the range of the phalanx.',
      19. 43 => 'Jump gates are huge transmitters that are able to send large fleets without loss of time through the universe.',
      20. 44 => 'missile silos used for storage of rockets.',
      21. 7 => 'The bank allows you to put resources in the shelter',
      Display All
      That's it for the lang file

      The you are going to tell me I still do not see in my game, no panic it just sufi you connect to your admin panel and emptied the cache of your game



      go to your building page is down you will have your building that is visible



      To add an image to your building just put it in styles\theme\gow\gebaeude\7.gif

      Enjoy
    • yamilrh wrote:

      que objetivo cumple esto, en donde yo veo que este guardando los recursos o lo que hace este banco?
      the bank you're seeing does not do anything because it's just part of the tutorial to add a new building
    • I added a new building that consumes DM, my factor is 2, consumes DM to 100, and it consumes 102400DM when the building is upgraded to level 10.
      Is there any way to fix the amount of DM consumed when it reaches a certain value? like 102400.
      I want the DM consumed by this building to be 102400 after the level 10 , not a very very high value.
    • Hi I need help on this topic, go to this link: 2moons.de/upload/oldmods.php and download this file: endlessuni-space-titans-ship.zip and install it, it was installed well but when I try Seeing when accessing the hangar gives me error in one of the ships that I add, what do you think it could be? Cheers
    • Danke für das tolle Tutorial.
      Ich hab es sogar auf der ersten Versuch hinbekommen ein Gebäude zu plazieren :)

      Nur ein Frage bevor ich wieder den halben Nachmittag lang suche.
      Wo kann man die Bauzeit für die einzelnen Gebäude einstellen?
    • Roan wrote:

      Danke für das tolle Tutorial.
      Ich hab es sogar auf der ersten Versuch hinbekommen ein Gebäude zu plazieren :)

      Nur ein Frage bevor ich wieder den halben Nachmittag lang suche.
      Wo kann man die Bauzeit für die einzelnen Gebäude einstellen?
      Это зависит от стоимости.
      Функционал, который вы ищите - не существует.
    • yamilrh wrote:

      @Danter14 si yo quisiera agregar una nueva Mina que produzca "comida" en teoría debería funcionarme aplicando este método solamente o debería agregar algo mas en alguna parte del php.
      To add a production you will also have to add a formula which will therefore calculate your production for you, such as metal, crystal and deuterium mines