[wpdreams_ajaxsearchlite]

Hunger, warmth and any other survival stats

饥饿,温暖和任何其他生存状态

For all those who have wanted hunger, warmth and other survival stats in their games, Atavism now provides the type of stat known as Vitality Stats. These stats allow a change in the value over time (known as a shift) with actions that can be set upon reaching the minimum or maximum value (such as the player/mob dying).

对于那些在游戏中想要饥饿,温暖和其他生存统计数据的人来说,Atavism现在提供了称为Vitality Stats的统计类型。这些统计数据允许随着时间的推移改变值(称为班次),可以在达到最小值或最大值时设置动作(例如玩家/暴徒死亡)。

For example, a hunger stat can be set with a max of 100, and a min of 0. The stat can be set to increase by 2 every 6 seconds, with death occurring when hunger reaches 100. If the player doesn’t eat some food (or have some effect applied) that decreases their hunger, they will die in 300 seconds (5 minutes).

例如,饥饿状态可以设置为最大值100,最小值为0.统计数据可以设置为每6秒增加2,当饥饿达到100时死亡。如果玩家不吃一些食物(或有一些效果)减少他们的饥饿,他们将在300秒(5分钟)内死亡。

There are 3 steps in setting up a Vitality stat: Creating the max stat, creating the vitality stat, and setting the stat on the character template.

设置活力属性有3个步骤:创建最大值,创建活力统计数据,并在角色模板上设置统计数据。

Creating the Max Stat

创建Max Stat


A max-stat needs to be set up to control the maximum value of the vitality stat. Open the Stat plugin in the Atavism Editor and create a new stat with type Base Stat. I generally put the word “max” in the max-stat name to help identify it. Leave Stat Function as none and ignore the Mob Values.

需要设置max-stat来控制活力统计的最大值。在Atavism编辑器中打开Stat插件,并使用Base Stat类型创建一个新的stat。我通常在max-stat名称中加上“max”这个词来帮助识别它。将Stat Function保留为none并忽略Mob值。


Example max stat:

示例max stat:


Creating the Vitality Stat

创建活力状态


The vitality stat setup involves setting the shift data (how much the stat changes by itself over time), the requirements for the shift to occur, and what happens when the min/max values are reached.

活力统计设置包括设置班次数据(统计数据随时间变化的程度),转变发生的要求以及达到最小/最大值时会发生什么。

To create a vitality stat, open the stat plugin in the Atavism Editor and set its type to Vitality Stat. Set the minimum value you want (generally 0) and set the Max Stat to the stat created in the step above. If the stat should only effect players then tick the Player Only check box (most Vitality stats will be player only, otherwise you will have random mobs and NPC’s dying). Set the Shift value to how much the stat will change each update, and if the stat can be reversed (such as breath going back up when you are out of water) then set the Reverse Value. Now set the Shift Interval to how often (in seconds) you want the stat to update.

要创建活力统计,请在Atavism编辑器中打开stat插件,并将其类型设置为Vitality Stat。设置所需的最小值(通常为0),并将Max Stat设置为上一步中创建的stat。如果统计数据应仅影响玩家,则勾选“仅限玩家”复选框(大多数活力统计数据仅限玩家,否则您将有随机小怪和NPC死亡)。将Shift值设置为每次更新时统计数据的变化量,以及是否可以反转统计数据(例如当您离开水面时呼吸恢复),然后设置反向值。现在将Shift Interval设置为您希望stat更新的频率(以秒为单位)。

Note: Reverse mode is not functional yet and will be included in the next update.

注意:反向模式尚未生效,将包含在下一次更新中。

Set the On Min Hit and/or On Max Hit to what should happen when the stat reaches either its minimum or maximum. By default the only option at the moment is death. The system is designed for more options to be added in the future.

将On Min Hit和/或On Max Hit设置为当stat达到其最小值或最大值时应该发生的情况。默认情况下,目前唯一的选择是死亡。该系统旨在为将来添加更多选项。

The last part for the Vitality Stat setup is the requirements. Requirements can be set so stats only update when certain states are true for the player, such as the player is alive, or not in combat. The current version provides only these two options with support for new requirements to be added in. If the stat update is to run all the time, add no requirements. Click Save Data and the only task left is setting up the stat for your character templates.

Vitality Stat设置的最后一部分是要求。可以设置要求,以便统计数据仅在玩家的某些状态为真时更新,例如玩家处于活着状态,或者不在战斗中。当前版本仅提供这两个选项,并支持添加新要求。如果要始终运行stat更新,请不添加任何要求。单击“保存数据”,剩下的唯一任务是设置角色模板的统计信息。

Example vitality stat:

Explanation: The hunger stat goes up by 2 every 10 seconds and when it reaches the max value (which is 100) they will die.

说明:饥饿数据每10秒上升2,当它达到最大值(即100)时,它们就会死亡。

 

Setting the Stat on the Character Template

在字符模板上设置Stat


The stat now needs to be set on each character template that has been created in the Player Character Setup plugin.

现在需要在播放器角色设置插件中创建的每个角色模板上设置stat。


Open the Player Character Setup Plugin and for each template scroll down to the new stats and set their values. Be careful when setting the base value for the vitality stat on the character as it can result in instant death (and character creation issues) if it triggers the onMin or onMax events (for example, if the onMax action is death and the starting value for the vitality stat is equal to the max value).

打开播放器角色设置插件,对于每个模板,向下滚动到新统计数据并设置其值。在为角色设置活力属性的基础值时要小心,因为如果它触发onMin或onMax事件(例如,如果onMax操作是死亡和起始值,则可能导致即时死亡(和角色创建问题))活力统计等于最大值)。


Example stat values on my character template:

我的角色模板上的stat值示例:

Other ideas

From here you may want to offer ways for players to prevent their death from a vitality stat such as adding items that can be consumed that decrease the stat or giving them abilities they can activate. These ideas can be achieved using Stat Effects that modify the value of the vitality stat.

As Atavism development continues the plan is to add many new states and onMin/onMax actions to provide better gameplay. One example is warmth that can be increased while near certain objects (fires) and decreases when outside and based on the weather. Any adventurous programmers should be able to achieve results like this already using the base that has been programmed in.

其他想法

从这里你可能想要为玩家提供一些方法,以防止他们死于活力统计,例如添加可以消耗的物品,减少统计数据或赋予他们可以激活的能力。可以使用修改活力统计值的Stat Effects来实现这些想法。

随着Atavism的发展继续,该计划将添加许多新状态和onMin / onMax动作,以提供更好的游戏玩法。一个例子是在靠近某些物体(火灾)时可以增加的温度,在外面并且根据天气减少的温度。任何喜欢冒险的程序员都应该能够使用已经编程的基础来实现这样的结果。