agent_set_hit_points command.

Users who are viewing this thread

AndreusAs

Grandmaster Knight
Hello everyone!

I'm wondering how does the above mentioned command works. It's description says, I have to put a "1" if I want my hp value to be absolute. The problem is - this command doesn't level the chracter's health higher, that they had it before leveling. So, let's say I want my charcater to have 300 hp:

health_stats = (ti_on_agent_spawn, 0, 0, [],
      [
                 
                (get_player_agent_no,":player"),

              (try_for_agents, ":agent_no"),
                (eq, ":agent_no", ":player"),
                (store_agent_hit_points,":hp",":agent_no",1),
                (assign, reg8, ":hp"),
                (agent_set_hit_points,":agent_no",300,1), 
                (display_message,"@{reg8}"),     
              (try_end),
])

But I can't, though if I set the value to something like 20 or 30 it works fine. So, is it a restriction, or I'm doing something wrong?
 
You should use (agent_set_max_hit_points, ":player", 300, 1), before agent_set_hit_points.
Btw, it's not neccesary to create a loop every time an agent is spawn. You can simply write:
Code:
health_stats = (0, 0, ti_once, [],
       [ 
           (get_player_agent_no,":player"),
           (agent_set_max_hit_points, ":player", 300, 1),
           (agent_set_hit_points, ":player", 300, 1),
])
 
Back
Top Bottom