Monster changing player speed
Posted: Mon Jan 12, 2015 6:20 pm
So, I'm working on a rough concept with a friend for a horror mod. One aspect involves something that slowly pursues the player and will kill him if it catches him. If shot, it retreats.
Anyway, the closer it gets, the more it is supposed to slow the player down. I've had luck modifying the player's speed in past mods in DECORATE by calling ACS scripts in the appropriate places using a tID of 0. Now, I'm trying to have something else do this, and it isn't working.
Here's the relevant code:
In DECORATE, the See state jumps based on proximity.
Scripts:
So, that's the general idea. I'm not sure if this is fundamentally flawed, or if I'm missing something. Thanks in advance!
Anyway, the closer it gets, the more it is supposed to slow the player down. I've had luck modifying the player's speed in past mods in DECORATE by calling ACS scripts in the appropriate places using a tID of 0. Now, I'm trying to have something else do this, and it isn't working.
Here's the relevant code:
In DECORATE, the See state jumps based on proximity.
Code: Select all
See:
SPOS A 0 A_Jumpifcloser(256, "CloseSee")
SPOS A 0 A_Jumpifcloser(512, "NearSee")
SPOS A 0 A_Jumpifcloser(1024, "MedSee")
Goto FarSee
FarSee:
TNT1 A 0 ACS_Execute(202, 0, 0, 0, 0)
TNT1 A 0 A_SetTranslucent(0.40)
SHAD AABBCC 3 A_Chase
Goto See
MedSee:
TNT1 A 0 ACS_Execute(203, 0, 0, 0, 0)
TNT1 A 0 A_SetTranslucent(0.50)
SHAD AABBCC 3 A_Chase
Goto See
NearSee:
TNT1 A 0 ACS_Execute(204, 0, 0, 0, 0)
TNT1 A 0 A_SetTranslucent(0.60)
SHAD AABBCC 3 A_Chase
Goto See
CloseSee:
TNT1 A 0 ACS_Execute(205, 0, 0, 0, 0)
TNT1 A 0 A_SetTranslucent(0.70)
SHAD DDEEFF 3 A_Chase
Goto SeeScripts:
Code: Select all
Script 1 ENTER
{
Thing_ChangeTID(0, (1000 + PlayerNumber()));
}
//set speed 100%
script 202 (void)
{
SetActorProperty((1000 + PlayerNumber()), APROP_Speed, 1.0);
}
//set speed 75%
script 203 (void)
{
SetActorProperty((1000 + PlayerNumber()), APROP_Speed, 0.75);
}
//set speed 50%
script 204 (void)
{
SetActorProperty((1000 + PlayerNumber()), APROP_Speed, 0.5);
}
//set speed 25%
script 205 (void)
{
SetActorProperty((1000 + PlayerNumber()), APROP_Speed, 0.25);
}