
Heatguts
Joined: Jun 6, 2014
Recon Armor FTW!
|
Posted: Jun 23, 2014 01:11 PM
Msg. 1 of 3
There is a section of a base in my level that needs to give the player health when entered. I originally thought I could just use a respawning healthpack (I still would) but I didn't see any commands for spawning equipment. So I decided I would use a trigger volume and add health using a starting profile.
This works fine except that your health goes way beyond the capacity of your health bar. I was trying to make a script that would check to only add health (probably a hundredth of total) if you had a health value of less than one using unit_get_health.
But I have run into problems I have not been able to debug. Despite there being a matched number of parentheses, sapien claims otherwise, and it cannot identify my condition.
(script continuous add_health (sleep_until (volume_test_objects addhealth (players))15) (if (< ((unit_get_health playerunit) 1)) player_add_equipment playerunit addhealth false) )
sapien's debug:
06.23.14 12:02:38 [scripts1 line 139] i expected (if <condition> <then> [<else>]).: (if (< ((unit_get_health playerunit) 1)) player_add_equipment playerunit addhealth false)) 06.23.14 12:02:38 recompiling scripts after scenarios were merged. 06.23.14 12:02:38 i expected (if <condition> <then> [<else>]).: (if (< ((unit_get_health playerunit) 1)) player_add_equipment playerunit addhealth false)) Edited by Heatguts on Jun 23, 2014 at 01:11 PM
|

MatthewDratt
Joined: Sep 11, 2010
TAKEDOWN IS OUT MattDratt.com
|
Posted: Jun 23, 2014 01:22 PM
Msg. 2 of 3
(unit_set_current_vitality (player)100 75 )
(unit_set_current_vitality <unit> <real> <real>) sets a unit's current body and shield vitality
|

Heatguts
Joined: Jun 6, 2014
Recon Armor FTW!
|
Posted: Jun 23, 2014 01:28 PM
Msg. 3 of 3
Oh thanks
I saw that command but couldn't find the default player actor to find the health values for
|