can you add updates to your structures and if so, how
An example
Can you add updates in your own plugins?
Moderator: Plugin Moderators
- 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?
Yes, an example below:
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.
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"
}
]
}
]
}]
Re: Can you add updates in your own plugins?
ThanksCommanderABab wrote: ↑28 Jan 2022, 18:38 Yes, an example below:
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.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" } ] } ] }]