Code: Select all
#include "zcommon.acs"
script 1 open {
if(GetActorProperty(0, APROP_HEALTH) <25)
{
Giveinventory(HealthBonus, 1);
{
Delay(36);
restart;
}
Code: Select all
#include "zcommon.acs"
script 1 open {
if(GetActorProperty(0, APROP_HEALTH) <25)
{
Giveinventory(HealthBonus, 1);
{
Delay(36);
restart;
}
Code: Select all
script 1 enterWhich is what I said. Very abbreviated.Apothem wrote:When using a script that has open associated with it, the activator is the map. If you use ENTER, the activator is the player. For commands like giveinventory, you need to make sure the activator is the appropriate actor. In this case, it's the player.
Code: Select all
States
{
Spawn:
PLAY A -1
PLAY A 0 ACS_ExecuteAlways(1,0,0,0,0)
Loop
Code: Select all
script 1 enter
{
if (GetActorProperty(0, APROP_Health) < 25)
{
GiveInventory("HealthBonus", 1); // Note the quotation marks
} // Note the fixed bracket
delay (36)
restart;
}Which is also convenient for error-checking, to make sure you've written a valid script.Morpheus wrote:The compiling process transforms the text into a compiled lump called BEHAVIOR. That makes it readable for the engine.