Scope Conditions
This script allows you to specify a scope condition for your items and skills.
A scope condition is a formula that is used to determine whether a skill
or item has an effect on a target or not. If it has no effect on a target then
the action does not do anything to that target.
Download
Script: download here
Installation
Place this script below Materials and above Main
Usage
Note-tag skills/items with
<scope condition: formula />
Where the formula is some valid ruby statement.
The following variables are available for your formula
a - current attacker b - target f - friends unit o - opponents unit v - game variables s - game switches
The target is all of the targets that the skill/item can affect. For example,
if a skill affects all enemies, then b
will be replaced with each enemy
during action execution.
The f and o variables depend on who the current attacker is.
If the attacker is an actor, then the friends unit is the game party.
Examples
Some example scope conditions
<scope condition: b.level % 5 == 0 /> -targets with levels that are multiples of 5 <scope condition: b.state.include?(23) /> -targets with state 23 applied <scope condition: b.name =~ /slime/i /> -targets with the word "e" in their name (case-insensitive) <scope condition: b.hp > (b.mhp / 2) /> -targets with more than 50% of their max HP
I have been browsing on-line more than 3 hours today, yet I by no means found any attention-grabbing article like yours.
It is lovely price enough for me. In my view, if all webmasters and bloggers made excellent content material as you probably did, the internet will likely be much more useful
than ever before.
Hey there just wanted to give you a quick heads up. The text in your post seem to be running off the screen in Ie.
I’m not sure if this is a format issue or something to do with internet browser compatibility but
I thought I’d post to let you know. The design and style look great though!
Hope you get the issue resolved soon. Kudos
Thank you a bunch for sharing this with all folks you
actually recognize what you’re speaking about!
Bookmarked. Kindly also consult with my website =). We could
have a link trade contract between us
Hi are using WordPress for your blog platform? I’m
new to the blog world but I’m trying to get started and set up my own. Do you
require any html coding expertise to make your own blog?
Any help would be really appreciated!
I think that is among the most vital info for me.
And i’m glad studying your article. But wanna observation on few basic things, The web site style is ideal, the articles is truly great : D.
Good task, cheers
Your style is really unique in comparison to other
people I have read stuff from. Thanks for posting when you’ve got the opportunity, Guess
I’ll just book mark this blog.
Hi there just wanted to give you a quick heads up and let you know a few of
the pictures aren’t loading correctly. I’m not sure why but I think
its a linking issue. I’ve tried it in two different internet browsers and both show the same results.
Please let me know if you’re looking for a author for your
site. You have some really good articles and I believe I would be a good asset.
If you ever want to take some of the load off, I’d love to write some content for your
blog in exchange for a link back to mine. Please shoot me an email if interested.
Thanks!
I’m gone to tell my little brother, that he should
also pay a visit this web site on regular basis
to get updated from latest gossip.
Hi, I do think this is a great blog. I stumbledupon it 😉 I am going to return once again since i
have bookmarked it. Money and freedom is the
best way to change, may you be rich and continue to help others.
I read this article completely on the topic of the
difference of most up-to-date and preceding technologies, it’s amazing article.
Fantastic site you have here but I was curious about if you knew
of any community forums that cover the same topics discussed here?
I’d really like to be a part of community where I can get
suggestions from other knowledgeable individuals
that share the same interest. If you have any recommendations, please let me know.
Cheers!
Terrific work! That is the type of info that
should be shared across the internet. Shame on the search engines for now
not positioning this submit higher! Come on over and seek advice
from my site . Thank you =)
I know this web page offers quality based content and other information, is there any other site which
provides such stuff in quality?
I needed to thank you for this good read!!
I absolutely loved every little bit of it. I have you book-marked
to look at new stuff you post…
When someone writes an paragraph he/she keeps the thought
of a user in his/her brain that how a user can understand it.
So that’s why this article is great. Thanks!
Hey! I realize this is sort of off-topic but I had to ask.
Does managing a well-established website such as yours require a massive amount work?
I’m brand new to operating a blog however I do write in my diary everyday.
I’d like to start a blog so I will be able to share my personal experience and thoughts online.
Please let me know if you have any kind of recommendations or
tips for new aspiring bloggers. Thankyou!
This is my first time pay a visit at here and i am
actually impressed to read everthing at single place.
Hi friends, its wonderful piece of writing regarding teachingand fully explained, keep it up all the time.
Greetings from Florida! I’m bored to tears at work so I decided to check out your site on my iphone during lunch break.
I love the info you present here and can’t wait to take a look when I get
home. I’m amazed at how quick your blog loaded on my mobile ..
I’m not even using WIFI, just 3G .. Anyways,
excellent site!
Write more, thats all I have to say. Literally, it seems as though you relied
on the video to make your point. You definitely know what
youre talking about, why waste your intelligence on just posting videos to your site when you could be giving us something enlightening
to read?
Thanks for sharing your thoughts on website. Regards
Very energetic post, I loved that a lot. Will there be a part
2?
I’m impressed, I have to admit. Seldom do I encounter a blog that’s equally educative and
interesting, and without a doubt, you’ve hit the nail on the head.
The issue is something that too few men and women are speaking intelligently about.
I’m very happy I stumbled across this during my hunt for
something relating to this.
I think that is one of the so much significant information for me.
And i am glad reading your article. But wanna observation on few
general issues, The web site style is wonderful, the articles is truly nice
: D. Good activity, cheers
Hi colleagues, how is everything, and what you wish for to say concerning this post, in my view its in fact awesome in favor of me.
Hey there, You have done a fantastic job. I will definitely
digg it and personally suggest to my friends. I’m confident
they’ll be benefited from this website.
I’m really impressed together with your writing skills as smartly as
with the format for your weblog. Is this a paid theme
or did you customize it yourself? Anyway keep up the
nice high quality writing, it’s uncommon to see a great blog like this one today..
Thanks very nice blog!
Hi there to all, as I am actually keen of reading this webpage’s post to be updated on a regular basis.
It carries fastidious information.
Spot on with this write-up, I seriously think this site needs
a great deal more attention. I’ll probably be returning to read more, thanks for the information!
Excellent blog here! Additionally your site a lot up very
fast! What web host are you the usage of? Can I am getting your affiliate
hyperlink in your host? I want my site loaded
up as fast as yours lol
Hey this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with
HTML. I’m starting a blog soon but have no coding knowledge so I wanted to get guidance from someone with experience.
Any help would be enormously appreciated!
I was suggested this web site by my cousin. I am not sure whether this post is written by him as no one else
know such detailed about my problem. You’re wonderful! Thanks!
Great post.
Hi! Do you know if they make any plugins to assist with SEO?
I’m trying to get my blog to rank for some targeted keywords but
I’m not seeing very good success. If you know of any please share.
Thank you!
Good day! Would you mind if I share your blog with my zynga group?
There’s a lot of people that I think would really appreciate your content.
Please let me know. Many thanks
With havin so much content and articles do you ever run into any problems of
plagorism or copyright violation? My website has
a lot of completely unique content I’ve either
created myself or outsourced but it seems a lot of it is popping
it up all over the web without my permission. Do you know any methods to help prevent content
from being stolen? I’d certainly appreciate it.
Thanks for your marvelous posting! I certainly enjoyed reading it, you will
be a great author.I will make sure to bookmark your
blog and will often come back at some point. I want to encourage yourself to continue your great work, have a nice weekend!
It’s a pity you don’t have a donate button! I’d definitely
donate to this outstanding blog! I suppose for now i’ll settle for bookmarking
and adding your RSS feed to my Google account.
I look forward to fresh updates and will share this website with my Facebook
group. Talk soon!
Great post. I was checking constantly this blog and I am impressed!
Very useful info particularly the ultimate section 🙂 I handle such information much.
I was seeking this certain info for a very long time.
Thank you and good luck.
I blog quite often and I seriously appreciate your content.
This great article has really peaked my interest. I am going to take a
note of your blog and keep checking for new details about once a week.
I opted in for your Feed too.
I am regular visitor, how are you everybody? This
paragraph posted at this web page is actually good.
Hi, I think your website might be having browser compatibility issues.
When I look at your blog in Firefox, it looks fine but when opening in Internet Explorer, it
has some overlapping. I just wanted to give you a quick heads up!
Other then that, superb blog!
Hello, i read your blog occasionally and i own a similar one and i was
just curious if you get a lot of spam comments?
If so how do you protect against it, any plugin or anything you can recommend?
I get so much lately it’s driving me mad so any assistance is very much appreciated.
When someone writes an paragraph he/she retains the plan of a user
in his/her brain that how a user can be aware of it. Therefore that’s why this
post is amazing. Thanks!
I have been surfing online more than three hours today, yet I never found any interesting article like yours.
It’s pretty worth enough for me. In my opinion, if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before.
I’m really enjoying the design and layout of your blog.
It’s a very easy on the eyes which makes it much more
enjoyable for me to come here and visit more often. Did you hire out
a developer to create your theme? Fantastic work!
Hmm is anyone else experiencing problems with the pictures on this blog loading?
I’m trying to figure out if its a problem on my end or if it’s the
blog. Any suggestions would be greatly appreciated.
Great post.
Hurrah! After all I got a web site from where I know how to actually obtain helpful information concerning my study and knowledge.
Greate article. Keep posting such kind of information on your
page. Im really impressed by your blog.
Hello there, You’ve performed an incredible job.
I’ll certainly digg it and individually
recommend to my friends. I am sure they will be benefited from this website.
Thanks for ones marvelous posting! I seriously enjoyed reading it, you are a great author.I will ensure that I bookmark your blog and may come back down the road.
I want to encourage continue your great work,
have a nice weekend!
Thank you for the good writeup. It actually was once a leisure account it.
Glance advanced to far brought agreeable from you! However, how
could we keep up a correspondence?
What’s up friends, its fantastic article regarding teachingand completely defined, keep it up all the
time.
Excellent site you have got here.. It’s hard to find quality writing like yours these days.
I really appreciate individuals like you! Take care!!
Hey! I’m at work surfing around your blog from my new iphone 4!
Just wanted to say I love reading through your blog and look forward to all your posts!
Carry on the outstanding work!
Is it possible to make a skill that targets both dead and alive allies? I want to heal a selected ally, reviving beforehand if necessary.
Say I have a skill that normally hits only one target. I would like to set it up so that the same skill will instead hit all enemies if the user has a specific state (let’s say Poison, or State ID 2 by default). Is such a thing possible with this script? If so, what would the scope condition look like?
Unfortunately, the conditions only apply to the targets based on the scope of the skill. It doesn’t allow you to change the actual scope of the skill.
Hi Hime – wanted to report a bug in this script.
Using the right-carat character ” > ” in a condition seems to end the tag early, often resulting in a TRUE evaluation where it’s not intended. For instance, your “greater than half HP” example above ( [scope condition: b.hp > (b.mhp / 2)] ) does not work and will always evaluate to TRUE in my tests.
This can be worked around by using < and ! in its place; for example [scope condition: !(b.hp <= (b.mhp / 2))] so it’s not a critical issue – but I think this should at least be documented in the instructions.
Thanks for the great script!
(Replaced all > < carats with ] [ brackets so the post doesn’t become faulty.)
I’ve updated the script so that you close the note-tag with /> instead of just >
Just did a simple test with the new version and it’s working well – thank you for the fix!
It is still not foolproof in the sense that if you had the string /> anywhere in your formula, it would still cut it off prematurely. This could appear in regular expressions for example if you wanted to match on something that starts with > symbol.
Alternatively, I could provide a note-tag that looks like this
<scope condition>
FORMULA HERE
</scope condition>
Which would then reduce the possiblity that it will be cut off prematurely.
How would I have it affect all enemies with the same name as the target?
Target a slime only slimes affected, but if I target a goblin, only goblins affected? Any ideas if thats possible?
I read (mostly) the comments left and didnt see what I was looking for. How would I use this to target any enemy and all enemies that are named the same as that enemy. So, I target a slime and all other slimes are targeted as well. I would be willing to give each creature type a state so that the are labeled, if that helps. I need a skill that only chains to the target and other creatures of the same name… thoughts?
b.name gives the target’s name. b.original_name gives the name without the extra letter appended. The problem here is that the scope condition checks whether the target is valid or not, so you will need to store the name somewhere before the condition check occurs as you don’t have reference to the first target after the skill is executed.
You may be able to use pre-skill effects which allows you to execute an effect before the skill itself is executed along with formula effects which allows you to execute a formula as the effect.
The effect you might execute may be something like
$game_variables[10] = b.original_name
And then your scope condition will check the variable
b.name.include?($game_variables[10])
In terms of 'passive states' applied to enemies to identify a certain monster type, this would allow a skill to function like 'Dia' spells from Final Fantasy I, right?
Yes, you can can specify that only targets with a particular state will be affected.
Ok, well, I have a question, I looking for a formula that would disallow a skill/item to not target a boss (set as a state 130), what is the code for that?
But enemies don't consider this effect, is what I mean.
I'm okay with the fact that it's about affecting someone and not about targeting or not targeting.
I know that you can still target anyone using this script. But only the player knows not to use a move against someone who's conditions they don't meet.
Even when I set them to autobattle, normally enemies use moves that are going to be the most useful, yet they don't see a false in a scope condition to be a consideration of how useful a move is.
I'm confuzzled.
I was trying a Triple Battle System where the members on the left can't hit the enemies on the right and the members on the right can't hit the enemies on the left with most skills
So my condition was
scope condition: if a.state?(187); !b.state?(189); end; if a.state?(189); !b.state?(187); end; and nothing happened and I also tried
a.state?(187) ? !b.state?(189) : a.state?(189) ? !b.state?(187) which that gave me an error
You need to explain what your condition is supposed to mean.
Oops. I'm sorry. facepalm If user has Left state (187) then target can't have Right state (189). If user has Right state (189), then target can't have Left state (187).
Okay, I got it.
scope condition: (a.state?(187) && !b.state?(189)) or (a.state?(189) && !b.state?(187)) or (a.state?(188)) or (!a.state?(187) && !a.state?(188) && !a.state?(189))
So user has Left and target does not have Right, or Target has Right and target does not have Left, or user has Middle, or user does not have a position.
:3
And such works.
Glad to see you've got it sorted out. Presumably when you were asked to explain yourself, you had to think about how you were going to phrase it in a coherent way, which typically means it has to be somewhat logical.
🙂 Yup.
There's a problem though. I'm not sure if I should put it on Bithub instead.
Enemies don't consider the Scope Conditions in their actions.
That means that an enemy on the right side will try to attack an actor on the left side and fail.
I also know that there is http://www.himeworks.com/2014/02/23/enemy-action-conditions/
but I would also wonder if there's a way to have enemies automatically take Scope Conditions into consideration.
This script is not intended to determine whether you can select someone as a target or not, it simply determines whether it has any effect on the target or not.
Your actors should still be able to pick one of the enemies that it shouldn't be targeting, as a target.
Another script will be required to actually change who you can target.
I also tried
scope condition: (!a.state?(187) && !b.state?(189)) && (!a.state?(189) && !b.state?(187)) which lead to nothing happening
You mean Scope Condition? There wasn’t one. It started working properly only when I DID give it a Scope Condition.
I’ll have to see a demo I am not sure how you have it set up.
Well… It just so happens that I just got a Beta of sorts finished just yesterday if you want to see for yourself. The important thing is that I got it to work, but it’s still weird. I can give you a download link once it finishes uploading.
Yes, it is strange, but it’s probably a case I never considered.
Some sort of very bizarre error is popping up on line 100 of the script. I was fighting an enemy that just happens to have a skill that utilizes this script, everything goes without a hitch UNTIL the enemy uses its last attack before dying. (No other scripts involved in the process, just good ol’ Immortal until at 0% HP then use Skill that Does Not Utilize Target Scopes and remove Immortal afterwards so it dies.) The script causes the game to inexplicably crash at that particular enemy. (And no other enemy that also has final attacks as far as I know.) All I have is the fact that the enemy was paralyzed when it died, so could inability to act or something else cause a bug with it?
Addendum: Nope, it’s not about the paralysis. Same thing happens normally too.
It says “Script ‘Tsukihime_Scope_Conditions line 101 NoMethodError occured. undefined method ‘scope_condition_met?’ for nil:NilClass”
And it magically started working after I made the skill target enemies whose levels are divisible by 1. (In other words, any level.) I have no idea what happened but… At least my project works…?
What was the condition when it crashed?
I want to make some enemies (mostly bosses) to certain attack, to make this I want to make if certain switch is OFF the enemy could be target of this attack, how do I make this?
You can check whether switches are OFF using the following scope condition:
This means that the condition is met when switch 2 is OFF.
Ohh, it’s perfect! thanks 😀
UPDATE: I kinda figured it out. The reason it wasn’t working was because I was looking for a state which was listed as a Permastate (Thank you for that script as well). So, what would be the syntax for looking for a Permastate? (Looking for a “normal” state does work ok.)
b.permastate?(n)
I have updated the permanent state script to support this, so make sure you update that script.
Will do! Thanks again.
Hello TH.
I’m trying to get this script to work via current states, but it’s not working.
The formula I use is
b.state?(n)
where n is the state I’m checking for.
Is this correct?
Also, I don’t know if this matters, but I’m trying to use items from the menu outside of battle.
Thanks for the assistance.
That works for me. Does it work without that condition? Cause there are many other built-in conditions that are checked on top of the scope condition.
Yes. I tried b.hp == b.mhp and that worked perfectly.