じ☆ve冰风 发表于 7 天前

Creating Skills/Items that only affect certain enemies

This is a simple tutorial to demonstrate how to use the Tag Manager to have skills or items that only affect certain enemies.


Required


Tag Manager: http://himeworks.com/2013/03/07/tag-manager/


How it works


What we want


Suppose we want to make a skill called "Destroy Undead" which will instantly destroy any undead monsters.


Naturally, it will have the effect "add state: death"


Specifying conditions


The problem right now is if we just leave it at that, the skill would instantly kill anything it hits. So we must specify a tag condition. We do this by tagging the skill with

<tag_cond: undead>Which means the "undead" tag must exist in the target for the skill to do anything to it.
Applying tags


Now suppose we are in a battle with two slimes and a zombie.


If we would only want the skill to instantly kill undead monsters, and we want the zombie to be an "undead" monster, then we would tag the zombie with 

<tag: undead>Test this in a project and verify that using "Destroy Undead" does nothing to the slimes, and will instantly skill the zombie.
Using tags with states


Now suppose we have another skill that allows you to turn monsters into undead, called "Turn Undead"


First, you would create a state called "Undead" (or anything really).


Then you would tag the state with

                Code:        
<tag: undead>

Because states are tag objects, they will be inherited by the battler that has this state. As a result, if you used the "turn undead" skill on the slime and turned it into undead, and then used the "destroy undead" skill on the slime now, it should be instantly destroyed because it is now an undead.


本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/creating-skills-items-that-only-affect-certain-enemies.6020/
页: [1]
查看完整版本: Creating Skills/Items that only affect certain enemies