Can you add updates in your own plugins?

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

User avatar
Nifaroux
Villager
Reactions:
Posts: 15
Joined: 10 Jan 2022, 05:07

Can you add updates in your own plugins?

#1

Post by Nifaroux »

can you add updates to your structures and if so, how

An example
IMG_20220127_215547.jpg
IMG_20220127_215547.jpg (11.71 KiB) Viewed 1266 times
User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Can you add updates in your own plugins?

#2

Post by CommanderABab »

Yes, an example below:

Code: Select all

[(
  "id": "Commander,"
  "type":"commercial",
        //...frames, price, etc ...
  "upgrades": [{
   "id": "Commander.upgrade",//id of upgrade
   "type": "commercial",//or other type
   "title": "title of upgrade",
   "text": "text describing upgrade.",
   "frames": [],//if upgrade looks the same, otherwise provide image
   "price": 7000,//of upgrade
   "monthly price": 200,//added to Commander monthly price
   "influence park": 39,//added
   "influence level1": 50,,//added
   "influence lev2": 50,,//added
   "power": -100,,//added to usage
   "water": -200,,//added to usage
   "level": 3

    }//,you could have other upgrades here
   ],


  "fun": [
   {
    "condition": {
     "type": "upgrade",
     "id": "Commander.upgrade",
     "x": 0,
     "y": 0//check here if an upgrade was done

    },
    "actions": [{
      "type":"remove",
      "x": 0,
      "y": 0
     },

     {
      "type": "build",
      "id": "ABab"
     }

    ]
   }
  ]
		
}] 
The fun in the example is optional and here removes the building if that specific upgrade has been done and replaces it with another building. It is important that the replacement building is the same size.
User avatar
Nifaroux
Villager
Reactions:
Posts: 15
Joined: 10 Jan 2022, 05:07

Re: Can you add updates in your own plugins?

#3

Post by Nifaroux »

CommanderABab wrote: 28 Jan 2022, 18:38 Yes, an example below:

Code: Select all

[(
  "id": "Commander,"
  "type":"commercial",
        //...frames, price, etc ...
  "upgrades": [{
   "id": "Commander.upgrade",//id of upgrade
   "type": "commercial",//or other type
   "title": "title of upgrade",
   "text": "text describing upgrade.",
   "frames": [],//if upgrade looks the same, otherwise provide image
   "price": 7000,//of upgrade
   "monthly price": 200,//added to Commander monthly price
   "influence park": 39,//added
   "influence level1": 50,,//added
   "influence lev2": 50,,//added
   "power": -100,,//added to usage
   "water": -200,,//added to usage
   "level": 3

    }//,you could have other upgrades here
   ],


  "fun": [
   {
    "condition": {
     "type": "upgrade",
     "id": "Commander.upgrade",
     "x": 0,
     "y": 0//check here if an upgrade was done

    },
    "actions": [{
      "type":"remove",
      "x": 0,
      "y": 0
     },

     {
      "type": "build",
      "id": "ABab"
     }

    ]
   }
  ]
		
}] 
The fun in the example is optional and here removes the building if that specific upgrade has been done and replaces it with another building. It is important that the replacement building is the same size.
Thanks
Post Reply Previous topicNext topic

Return to “Plug-In Discussion”