Author Topic: Health regeneration  (Read 5688 times)

0 Members and 1 Guest are viewing this topic.

Somebody

  • Code Pope
  • Baron
  • *
    • View Profile
  • Faction: Bandit
  • WBWF&S
Re: Health regeneration
« Reply #15 on: April 24, 2011, 07:33:26 PM »
The script is wrong. val_min takes the lesser value, so it can be negative. Your trigger format is also wrong - ti_on_agent_spawn should be the first interval.
Code: [Select]
(ti_on_agent_spawn, 0, 0, []
[
(store_trigger_param_1, ":agent_no"),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(store_skill_level, ":ironflesh_level", "skl_ironflesh", ":troop_id"),
(store_skill_level, ":persuasion_level", "skl_persuasion", ":troop_id"),
(val_sub, ":ironflesh_level", 1),
(val_max, ":ironflesh_level", 0), #eliminate negative results
(val_mul, ":ironflesh_level", 3),
(val_sub, ":persuasion_level", 1),
(val_max, ":persuasion_level", 0), #eliminate negative results
(val_mul, ":persuasion_level", 11),
(val_add, ":ironflesh_level", ":persuasion_level"),   
(agent_set_slot, ":agent_no", slot_agent_regen_rate, ":ironflesh_level"),
]
),

Onitenshi

  • Recruit
  • *
    • View Profile
  • Faction: Nord
Re: Health regeneration
« Reply #16 on: April 24, 2011, 08:01:00 PM »
Thanks alot Somebody. It's a wonder this script ever worked in the tests, seeing how many things you changed in the past hours.

I have to admit, i don't get val_max or val_min at all. I thought, val_min says, that for example :ironflesh_level can't be under this (0) and every value below will be set to 0, because i set a MINIMAL value and val_max does the opposite and if i set it for :ironflesh_level to (5) that for example a 9 will be reduced to a 5, beacuse i set a MAXIMAL value. Now u tell me it's the opposite and it works... that makes no sense (in my logic. not that u are right, but how they are named -.-;; )... or do i miss something?

On the long term, many many thanks for your hard work helping me ^^
I know it was not easy ^^;;
I think this could be interesting for some people, for example creating an independent regeneration skill in one of the reserved slots.
« Last Edit: April 24, 2011, 08:03:26 PM by Onitenshi »

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Health regeneration
« Reply #17 on: April 24, 2011, 08:18:51 PM »
Quote
Now u tell me it's the opposite and it works... that makes no sense (in my logic. not that u are right, but how they are named -.-;; )... or do i miss something?
val_min : compare 2 values/numbers and keep the smaller/smallest (min) value/number.

val_max : compare 2 values/numbers and keep the bigger/biggest (max) value/number

COGlory

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: Health regeneration
« Reply #18 on: April 24, 2011, 08:28:31 PM »
An integer can support anything from −2,147,483,648 up to  +2,147,483,647, if I remember correctly.  That shouldn't be the problem.     

EDIT:  Didn't read the second page :oops: