Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

HP (hit point) and MP (mana point) are 2 custom variables for arbitrary usage, usually be used to simulate the energy of agent. Each one of agent has some initial HP and MP value after first creating. This value is store in memory and only can be modified by the related channels.
You can set the initial HP and MP in McdAgentGroup node and randomize them when initializing.



The McdAgentGroup node and the attributes on it


The hp channel for input, it will return the current value of HP inside the agent memory.
The hp and hp.set channel for output, it will set the value of HP to the specific value.
In most of the cases, we are not use using hp channel like that. Usually, we firstly setup the hp channel in default decision node, make the output type "change rate".
At this time, the hp for output channel will not set HP value, instead of that, it will change the HP value per second. For example, when the agents are walking on the radiation zone (zone[1].in channel greater than 1), the HP will drop some points(5 points) per-second. And if you want to reset the HP value in agent memory, you need use hp.set channel because at this time the hp channel is in "change rate" mode, you cannot reset hp value directly by hp channel.

...



Reset agent hp to 100 if the agent in bound


The MP and the mp channels sentences are totally exactly the same as HP and hp channelssentences.