Jump to content

Recommended Posts

Flare Collections - Laws for Map vs2.0

Created by DarknessFalls. All Credit must be given to me. Free for commercial use.

 

Download: Get me

 

The script must be named: Flare-LawsForMap.js

ATTN!

 

All code is written in ES6, including classes, static classes and so on. Do not edit the script it's self. You can view the source code here and learn how to build the script for your self here

 

 

 

ScreenShots:

 

 

DUHUfW9.png

mjle6qF.png

 

screen_shot_2015_11_29_at_12_05_50_pm_by

screen_shot_2015_11_29_at_11_42_57_am_by

screen_shot_2015_11_29_at_11_44_26_am_by

screen_shot_2015_11_29_at_11_43_33_am_by

screen_shot_2015_11_29_at_11_42_47_am_by

xjifq3L.png

 

 

Welcome to Laws for Map.

 

The script allows you to set up a set of laws for a map, these laws are then checked when a player does an action that targets either it's self, another actor or even an enemy. If you say no potions and I use a potion, you bet ill be punished in some way.

 

Laws for Map comes with lots of things right out of the bag, lets get into it.

 

Setting up laws

 

you can have any number of laws on a map, we will only show you three of those laws at any one time. When the player starts up the map either from a new and saved game we will randomize those laws and show a new set of three. The same goes for when a player transfers to a different map and back again.

 

Laws are comprised of a couple of things, a short name, a icon, a punishment and a cantUse which is allowed to hold three things in it (any more and I slice them off).

 

So lets set up a law:

<law
  name:"Attacking Causes Death"
  punishment:"hp"
  amount: 1000
  icon: 26
  cantUse: "attack, potion, heal"
>
  • name: The name of the law.
  • punishment: The thing to punish on the actor object. (see below)
  • amount: How much do we do when we punish the user?
  • icon: What icon is representing the law?
  • cantUse: What can we not use? (see below)

ATTN!

 

The parser I use will read the tag as is, if you copy and paste it into the map detail window.

 

Duplicate cantUse

 

Consider the following example:

<law
  name:"Attacking Causes Death"
  punishment:"hp"
  amount: 1000
  icon: 26
  cantUse: "attack, potion, heal"
>

<law
  name:"Minor Health Loss"
  punishment:"hp"
  amount: 10
  icon: 26
  cantUse: "attack, potion, heal"
>

The issue here is that when we process which law you broke, we take the first one we find in the array of laws for the map is the first one we take. In this case Minor Health Loss would never get used because we found Attacking causes death first.

 

Your can't use has to be unique like the name of the law.

 

Punishment

 

punishments are things we do to the player, we take away things like hp, mp, tp or xp. We can even take away gold.

 

We cannot take a away items, weapons or armor (equiped or not).

 

When we take away xp, we can level down the actor.

 

ATTN!

 

Laws can kill. if you reduce the hp below 0 or to 0 on a map or in battle it can kill the player.

 

If you are on a map and you kill the whole party, the last law window will tell You that every one is dead and its game over before actually going to the game over.

We tell you before we punish you, battles.

 

In battles when you do an action and the law is broken, if that law would kill You we will tell you before we actually punish you.

 

We Punish before we tell you, map.

 

If you are on the map and you use a potion and we have stated no you cannot use potions, then we will show you the law window and THEN punish you.

The following are acceptable punishments: hp, mp, tp, xp, gold.

 

No you cannot have multiple punishments.

 

cantUse

 

Cant use stipulates what a actor can and cannot use. Because laws are not party wide and affect only the actor breaking it the cantUse only applies to that specific actor at the time that they use an action.

  • You can state, for battles: Attack, Item Name, Skill Name, Special Name
  • For maps you can do: Item Name, Skill Name, Special Name
You can only have three cantUse per law.

 

For example: attack, potion, spark

 

When a player uses attack in battle or spark in battle they have broken a law. When a player uses potion either in or out of battle that player has broken a law.

 

The same goes for out of battle. If a player uses a potion out of battle they will be punished.

 

Regarding Breaking Laws in Battle.

 

In a battle its the sole act of doing an action thats against the law that breaks the law. For example if the law states you cannot attack and you attack, but it misses, you still broke the law and will be punished according to that law.

 

Regarding Yanfly Scripts.

 

For Yanfly battle and Yanfly Menu Manager, you don't have to do anything at all.

 

This script also works with Yanfly Aftermath, you just have to place laws in the list of reward windows:

 

exp custom drops laws
Reward for not breaking a law

 

You can set this up with a tag in the map notes:

 

<lawReward i: 5 w:5 a:8 gold:78 xp:90>
This will reward the player it an item of id 5, weapon of id 5 and armor id of 8. The party will also gain 78 gold and the whole party will gain 90 xp.

 

You can also do:

 

<lawReward i: "5,6,7" w:"5~89" a:8 gold:"1~78" xp:90>
This reads as, gain item id of 5,6 and 7. Gain a random weapon between if 5 and 89. Gain armor with id of 8. Gain random gold between 1 and 78 and finally the whole party gains 90 xp.

 

Calculate Before or After Battle?

 

 

If you set this plugin option as before then you will see:

 

screen_shot_2015_11_29_at_11_42_57_am_by

 

You can scroll through the laws that associated with this map and hit enter to scroll through the list of rewards.

 

All of these rewards will be the same for every single battle.

 

If you want to have the rewards calculated after every single battle and you are using concepts of: "1 ~ 6" which is how we calculate random rewards.

 

Then you'll see:

 

screen_shot_2015_11_29_at_12_05_50_pm_by

 

Which indicates that there is no reward information to be shown because that information is calculated after every battle.

 

Bonus:

 

You can do the following:

i: 1 // item id 1
i: "1 ~ 67" // random item between 1 and 67
i: "1,2,4" // Give items 1,2 and 4
Public API

 

For developers, you get some public api. Non developers might find this useful.

 

You have access to the FlareLawsForMap static class which has the following functions on it:

  • getLawsForMap() Gets all the laws for the current map, returns an array of 3 objects.
Example:

FlareLawsForMap.getLawsForMap() // Returns and array: [Object, Object, Object]
Edited by DarknessFalls
  • Like 2

Share this post


Link to post
Share on other sites

Massive Update!

 

Version 2.0

 

Whats new? Whats new and exciting? OMG Lets all have some amazing fun!!!!

 

Law Rewards: You can now use the following tag on a map to give rewards: 

<lawReward i: 1 a: "1,2,3" w: "5 ~ 23" xp: 89 gold: 879>
This reads the following:

 

Give item id of 1, armor with ids of 1,2 and 3, a random weapon between id 5 and 23. Finally give the WHOLE PARTY 89 xp and 879 gold.

 

This tag is only executed WHEN and ONLY when your WHOLE party does NOT break any laws.

 

We have some new plugin options:

  • How many laws per map? If you set up, for example, 76 law tags and choose 6 flaws per map when ever that map loads we will choose 6 random laws of the 76 tags.
  • Calculate law after or before battle? If you set "after" this means that if no one in your party has broken a law, rewards will ONLY be given and rewarded AFTER the battle. this is good if you are using the random syntax: "x ~ y" If you set it to "before" then the rewards will be calculated when the map loads and after every battle if you haven't broken any laws you will ALWAYS get the same reward.
New Interface for looking at laws.

 

Lets look at one where we calculate the law rewards when a map loads:

 

screen_shot_2015_11_29_at_11_42_57_am_by

 

 

On the left we have a list of laws. On the right we have (top to bottom) law description (mandatory) dummy window and a selectable list of rewards.

 

Scroll through the laws, hit enter, scroll through the rewards. Hit esc to get back to the list of laws and esc again to get back to the main menu.

 

What if you set the plugin option to after?

 

screen_shot_2015_11_29_at_12_05_50_pm_by

 

Its the same as before accept this time we don't have anything for you to scroll through on the right hand side because these rewards are calculated after each battle and "randomized" assuming you are using "x ~ y" syntax to randomize weapons, armor, items, gold and/or xp.

 

This script works with Yanfly Menu Manger (you don't have to do anything) and it works with Yanfly Aftermath :D

 

How do we use with Yanfly Aftermath? Set "laws" in the victory order:

exp custom drops laws
When you win with victory aftermath you'll see:

 

screen_shot_2015_11_29_at_11_43_33_am_by

 

This is a selectable list that you can scroll through.

 

Regarding XP

 

XP is rewarded directly after the battle. So if your enemy gives you 600 xp and you bonus reward 400, every one gets 1000xp, level up's are also shown.

 

Always looking for feed back, ideas, suggestions and so on :)

 

Bonus: Whats coming in 3.0? Regions. Whats that mean???

Share this post


Link to post
Share on other sites

Please do not meaninglessly bump threads in that area unless you have an update. (=
Imagine what would happen if everybody would start bumping their script and game threads. ( ͡° ͜ʖ ͡°)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted