Building requirements

Learn here how to create and use plugins.

Moderator: KoalaGuy

User avatar
Matison55557
Inhabitant of a Universe
Reactions:
Posts: 4549
Joined: Mon Jul 04, 2016 18:49
Location: Poland
Plugins: Show
Version: Beta
Phone: Huawei P9 lite mini

Building requirements

Post by Matison55557 » Mon Mar 13, 2017 21:04

This is how to make your buildings require something first to build them.

Requirement of population

Code: Select all

"requirements":[
  {
    "type":"HABITANT_COUNT",
    "count": x
  }
]
where x is the population required.
Requirement of a building

Code: Select all

"requirements":[
  {
    "type":"BUILDING",
    "id":x
  }
]
where x is the unique ID of the building, in quote symbols ("")

Requirement of a certain wealth level population

Code: Select all

"requirements":[ 
  {
    "type":"HABITANT_COUNT", 
    "count":x, 
    "factor0":0, 
    "factor1":0, 
    "factor2":0 
  }
]
where x is the number of habitants.
factor0, 1, 2 are wealth levels.
a "factor0/1/2":1 means the chosen wealth level


Example of a building with requirement of the big town hall:

Code: Select all

[
  {
    "id":"$sth",
    "type":"park",
    "width":1,
    "height":1,
    "frames":[{"bmp":"sth.png"}],
    "requirements":[
      {
        "type":"BUILDING",
        "id":"$townhall01"
      }
    ]
  }
]
Last edited by Matison55557 on Fri Oct 13, 2017 17:08, edited 3 times in total.
454454: New residences!

   plugins
Suggest/request a plugin!

User avatar
Lobby
Developer
Reactions:
Posts: 2909
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone: S7 edge

Post by Lobby » Mon Mar 13, 2017 21:37

Never tested it, but in order to expect 1,000 poor inhabitants it should look like

Code: Select all

"requirements":[
  {
    "type":"HABITANT_COUNT",
    "count":1000,
    "factor0":1,
    "factor1":0,
    "factor2":0
  }
]

User avatar
Henderion The Mayor
Inhabitant of a Planet
Reactions:
Posts: 1502
Joined: Thu Aug 18, 2016 11:04
Location: Pevosi,Freetradezonia (Tanjong Sepat,Selangor,Malaysia)
Plugins: Show
Version: Beta
Phone: Samsung Galaxy J1

Reply

Post by Henderion The Mayor » Tue Mar 14, 2017 4:15

Thanks.

User avatar
Ahmad Nur Aizat
TheoTown Veteran
Reactions:
Posts: 6273
Joined: Tue Oct 25, 2016 15:20
Location: Johor Bahru
Plugins: Show
Version: Beta
Phone: Sony ST21i
Contact:

Post by Ahmad Nur Aizat » Tue Mar 14, 2017 12:15

Nope, still don't understand

User avatar
Matison55557
Inhabitant of a Universe
Reactions:
Posts: 4549
Joined: Mon Jul 04, 2016 18:49
Location: Poland
Plugins: Show
Version: Beta
Phone: Huawei P9 lite mini

Post by Matison55557 » Tue Mar 14, 2017 12:42

Ahmad Nur Aizat wrote:Nope, still don't understand
What do you not understand? I can explain it
454454: New residences!

   plugins
Suggest/request a plugin!

User avatar
Ahmad Nur Aizat
TheoTown Veteran
Reactions:
Posts: 6273
Joined: Tue Oct 25, 2016 15:20
Location: Johor Bahru
Plugins: Show
Version: Beta
Phone: Sony ST21i
Contact:

Post by Ahmad Nur Aizat » Tue Mar 14, 2017 12:58

Matison55557 wrote:
Ahmad Nur Aizat wrote:Nope, still don't understand
What do you not understand? I can explain it
Everything

User avatar
Matison55557
Inhabitant of a Universe
Reactions:
Posts: 4549
Joined: Mon Jul 04, 2016 18:49
Location: Poland
Plugins: Show
Version: Beta
Phone: Huawei P9 lite mini

Post by Matison55557 » Tue Mar 14, 2017 13:45

Ahmad Nur Aizat wrote:
Matison55557 wrote:
Ahmad Nur Aizat wrote:Nope, still don't understand
What do you not understand? I can explain it
Everything
If you make a plugin then you can use these codes to add special requirements that are needed to unlock the building.
454454: New residences!

   plugins
Suggest/request a plugin!

User avatar
Ahmad Nur Aizat
TheoTown Veteran
Reactions:
Posts: 6273
Joined: Tue Oct 25, 2016 15:20
Location: Johor Bahru
Plugins: Show
Version: Beta
Phone: Sony ST21i
Contact:

Post by Ahmad Nur Aizat » Tue Mar 14, 2017 14:35

Sooooo, somekind of the requirements featured in usual gamemodes? (No, not sandbox)

User avatar
Matison55557
Inhabitant of a Universe
Reactions:
Posts: 4549
Joined: Mon Jul 04, 2016 18:49
Location: Poland
Plugins: Show
Version: Beta
Phone: Huawei P9 lite mini

Post by Matison55557 » Tue Mar 14, 2017 14:39

Yes but not sure if they still work because the code is from old TT versions. Probably does though.
454454: New residences!

   plugins
Suggest/request a plugin!

User avatar
Ahmad Nur Aizat
TheoTown Veteran
Reactions:
Posts: 6273
Joined: Tue Oct 25, 2016 15:20
Location: Johor Bahru
Plugins: Show
Version: Beta
Phone: Sony ST21i
Contact:

Post by Ahmad Nur Aizat » Tue Mar 14, 2017 20:28

I see...

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1587
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone: Moto Z Force Droid

Re: Tutorial: Building requirements

Post by KINGTUT10101 » Tue Aug 08, 2017 20:56

Shouldn't this be in Tutorials and Documentation?

User avatar
MXD77
Inhabitant of a Megacity
Reactions:
Posts: 255
Joined: Mon May 15, 2017 0:05
Location: Gdańsk
Plugins: Show

Re: Tutorial: Building requirements

Post by MXD77 » Tue Aug 08, 2017 20:58

Helpful thanks :bc
Happy owner of cat and dog :D
Have a niceday :)
And greatings from Gdańsk ;)

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 424
Joined: Sat Sep 23, 2017 14:29

Re: Tutorial: Building requirements

Post by 22Alpha » Sun Oct 08, 2017 14:06

May I ask here, what is the building code for coal power plant?

and does the requirement code allow "or" condition? ie.

"In order to obtain the building, you are required to get plaza "OR" statue"
United we stand
Divided we fall

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1587
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone: Moto Z Force Droid

Re: Building requirements

Post by KINGTUT10101 » Thu Oct 26, 2017 2:11

What is the ID for Large Infinity?

User avatar
JustAnyone
Inhabitant of a Solar System
Reactions:
Posts: 1672
Joined: Sun Jul 23, 2017 12:45
Location: Pickle Command Centre
Plugins: Show
Version: Beta
Phone: Xiaomi Redmi 3s

Re: Building requirements

Post by JustAnyone » Sat Nov 18, 2017 12:02

@Lobby is there any way for a building to require an upgrade to be built?
Last edited by JustAnyone on Fri Nov 24, 2017 22:13, edited 1 time in total.
Founder and owner of DSA
TheoTown discord manager
Developer of Plugin Creator Application.

User avatar
JustAnyone
Inhabitant of a Solar System
Reactions:
Posts: 1672
Joined: Sun Jul 23, 2017 12:45
Location: Pickle Command Centre
Plugins: Show
Version: Beta
Phone: Xiaomi Redmi 3s

Re: Building requirements

Post by JustAnyone » Sun Nov 19, 2017 12:34

Here is what I mean:
Screenshot_2017-11-19-12-32-13-974_info.flowersoft.theotown.theotown.png

Code: Select all

"requirement": {
			"requirements": [{
				"type": "UPGRADE",
				"data": {
					"id": "dsahqup3"
				}
			}]
		},
Founder and owner of DSA
TheoTown discord manager
Developer of Plugin Creator Application.

User avatar
CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 5477
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Re: Building requirements

Post by CommanderABab » Sun Nov 19, 2017 13:22

upgrade
466466Currently using beta 466. 466 What's new? :)
Plugin image prefetch!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 5477
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Re: Building requirements

Post by CommanderABab » Sun Nov 19, 2017 13:29

Code: Select all

"requirement":{ "requirements":
        [ 
          {
           "type":"CONDITION",          
           "data":
           {            
             "condition":
               {"type":"and","inner":
                 [
                  {"type":"upgrade","id":"dsahqup3","min":1,"max":10},    
                  {"type":"value","id":"res","min":10000,"max":1000000000}
                 ]       
               },
             "text":"Needs a dsahqup3!, and 10000 inhabitants"                           
           }  
          }                
        ]
       },
466466Currently using beta 466. 466 What's new? :)
Plugin image prefetch!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
JustAnyone
Inhabitant of a Solar System
Reactions:
Posts: 1672
Joined: Sun Jul 23, 2017 12:45
Location: Pickle Command Centre
Plugins: Show
Version: Beta
Phone: Xiaomi Redmi 3s

Re: Building requirements

Post by JustAnyone » Sun Nov 19, 2017 15:55

CommanderABab wrote:
Sun Nov 19, 2017 13:29

Code: Select all

"requirement":{ "requirements":
        [ 
          {
           "type":"CONDITION",          
           "data":
           {            
             "condition":
               {"type":"and","inner":
                 [
                  {"type":"upgrade","id":"dsahqup3","min":1,"max":10},    
                  {"type":"value","id":"res","min":10000,"max":1000000000}
                 ]       
               },
             "text":"Needs a dsahqup3!, and 10000 inhabitants"                           
           }  
          }                
        ]
       },
Doesn't work.
Last edited by JustAnyone on Fri Nov 24, 2017 22:13, edited 3 times in total.
Founder and owner of DSA
TheoTown discord manager
Developer of Plugin Creator Application.

User avatar
JustAnyone
Inhabitant of a Solar System
Reactions:
Posts: 1672
Joined: Sun Jul 23, 2017 12:45
Location: Pickle Command Centre
Plugins: Show
Version: Beta
Phone: Xiaomi Redmi 3s

Re: Building requirements

Post by JustAnyone » Fri Nov 24, 2017 21:57

JustAnyone wrote:
Sun Nov 19, 2017 12:34
Here is what I mean:
Screenshot_2017-11-19-12-32-13-974_info.flowersoft.theotown.theotown.png

Code: Select all

"requirement": {
			"requirements": [{
				"type": "UPGRADE",
				"data": {
					"id": "dsahqup3"
				}
			}]
		},
@Lobby this is what I meant.
Founder and owner of DSA
TheoTown discord manager
Developer of Plugin Creator Application.

User avatar
Lobby
Developer
Reactions:
Posts: 2909
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone: S7 edge

Re: Building requirements

Post by Lobby » Sat Nov 25, 2017 18:19

So what is it supposed to do? That an upgrade needs another upgrade first to be applied? That's not supported (yet).
...Have a nice stay

User avatar
JustAnyone
Inhabitant of a Solar System
Reactions:
Posts: 1672
Joined: Sun Jul 23, 2017 12:45
Location: Pickle Command Centre
Plugins: Show
Version: Beta
Phone: Xiaomi Redmi 3s

Re: Building requirements

Post by JustAnyone » Sun Nov 26, 2017 19:29

I have building A with upgrade named 3.
To build building B, I require upgrade named 3.
Founder and owner of DSA
TheoTown discord manager
Developer of Plugin Creator Application.

User avatar
CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 5477
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Re: Building requirements

Post by CommanderABab » Sun Nov 26, 2017 19:52

You could currently have building A, if upgraded to 3, build an annex next door which would be building B, or a 1x1 building C (of which could be only 1) which building B would require.
466466Currently using beta 466. 466 What's new? :)
Plugin image prefetch!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
JustAnyone
Inhabitant of a Solar System
Reactions:
Posts: 1672
Joined: Sun Jul 23, 2017 12:45
Location: Pickle Command Centre
Plugins: Show
Version: Beta
Phone: Xiaomi Redmi 3s

Re: Building requirements

Post by JustAnyone » Tue Nov 28, 2017 18:54

@Lobby new upgrade thing is broken for me (1.3.81)
Founder and owner of DSA
TheoTown discord manager
Developer of Plugin Creator Application.

User avatar
Lobby
Developer
Reactions:
Posts: 2909
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone: S7 edge

Re: Building requirements

Post by Lobby » Tue Nov 28, 2017 19:11

What have you tried, what did you expect, and what happened instead?
...Have a nice stay

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest