Skip to content

Commit

Permalink
Add fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NachosChipeados committed Nov 30, 2024
1 parent 18f664e commit ce304c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ void function ClientCodeCallback_BodyGroupChanged( entity ent, int bodyGroupInde
{
// PrintFunc( "entity " + ent + " index " + bodyGroupIndex + "newstate " + newState )

if ( IsSpectre( ent ) || IsStalker( ent ) )
if ( IsSpectre( ent ) )
{
if ( bodyGroupIndex == ent.FindBodyGroup( "head" ) || bodyGroupIndex == ent.FindBodyGroup( "removableHead" ) )
{
ModelFX_DisableGroup( ent, "foe_lights" )
ModelFX_DisableGroup( ent, "friend_lights" )
}
}
else if ( IsStalker( ent ) )
{
if ( bodyGroupIndex == ent.FindBodyGroup( "removableHead" ) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ void function ClSpectre_Init()
void function CreateCallback_Spectre( entity spectre )
{
AddAnimEvent( spectre, "create_dataknife", CreateThirdPersonDataKnife )
spectre.DoBodyGroupChangeScriptCallback( true, spectre.FindBodyGroup( "removableHead" ) )

int bodyGroupIndex = spectre.FindBodyGroup( "head" )
if ( bodyGroupIndex == -1 )
bodyGroupIndex = spectre.FindBodyGroup( "removableHead" )

spectre.DoBodyGroupChangeScriptCallback( true, bodyGroupIndex )

asset model = spectre.GetModelName()
if ( model in file.initialized )
Expand Down
5 changes: 4 additions & 1 deletion Northstar.Custom/mod/scripts/vscripts/ai/_ai_spectre.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ void function SpectreOnDeath( entity npc, var damageInfo )
DamageInfo_AddCustomDamageType( damageInfo, DF_KILLSHOT )
// EmitSoundOnEntityExceptToPlayer( npc, attacker, "SuicideSpectre.BulletImpact_HeadShot_3P_vs_3P" )

int bodyGroupIndex = npc.FindBodyGroup( "removableHead" )
int bodyGroupIndex = npc.FindBodyGroup( "head" )
if ( bodyGroupIndex == -1 )
bodyGroupIndex = npc.FindBodyGroup( "removableHead" )

int stateIndex = 1 // 0 = show, 1 = hide
npc.SetBodygroup( bodyGroupIndex, stateIndex )

Expand Down

0 comments on commit ce304c3

Please sign in to comment.