Grunt Weapon Loadout Created 6 years ago2017-09-01 01:23:57 UTC by MistaX88 MistaX88

Created 6 years ago2017-09-01 01:23:57 UTC by MistaX88 MistaX88

Posted 6 years ago2017-09-01 01:25:58 UTC Post #337199
So I'm working with monster entities for the first time. I'm simply adding in some monster_human_grunts to attack the player. I plan to have more teleport in after a certain point but right now I have four that are scripted to run out to a certain point around where the player will end up. All that works just fine (aside from one grunt stuck where he spawns but I know what the issue is there).

The issue I don't know how to fix is the fact that all the grunts have grenades and in the relatively small area they are fighting combined with the fact that the player can climb up vertically where they can't go it ends up with them lobbing grenades all willy nilly and blowing each other up. This is not a desired effect. The thing is, I have the grunts all set to either shotgun or 9mmar and I do not have the guns +HG or +GL selected, which I assumed stood for Hand Grenade and Grenade Launcher.

Yet here they are, lobbing nades in a futile manner in the air, and occasionally killing each other (a problem which can only get worse when I more than double the number of grunts in the battle).
Posted 6 years ago2017-09-01 03:40:36 UTC Post #337204
monstermaker grunts and repel grunts all carry hand granades by default, I dont think this can be changed

However, if you have a monster_human_grunt with weapon set to non-HG and non-GL still using granades, I think your fgd has a problem.
Posted 6 years ago2017-09-01 04:07:52 UTC Post #337205
Do you happen to know what the values are with smart edit turned off? I was checking each weapon selection on the drop down menu and noticed with smart edit off it skipped numbers.

It went:

1 9mmar
3 9mmar + HG
5 9mmar + GL
8 Shotgun
10 Shotgun + HG

EDIT:

I compared my newer FGD to the old 2002 one that came packaged with Hammer 3.5 and the values are the same. I don't know why they have nades. Though I have noticed that they aren't actually throwing them, they plop them on the ground. When I switch it to "9mmar + HG" they actually throw them at me, but the result isn't much better. I still find half of them in little meaty chunks all over the floor before I fire a single shot.
Posted 6 years ago2017-09-01 06:43:32 UTC Post #337206
I looked at the code, even if a grunt is set to 9mmar (1), if they are not in a squad the slGruntGrenadeCover schedule may be triggered, which has them dropping a grenade and trying to run for cover. In a confined space they will blow themselves up.

Try adding them all to a squad, see if that fixes it.
Posted 6 years ago2017-09-01 18:36:06 UTC Post #337218
[quote]
case SCHED_TAKE_COVER_FROM_ENEMY:
{
if ( InSquad() )
{if ( g_iSkillLevel == SKILL_HARD && HasConditions( bits_COND_CAN_RANGE_ATTACK2 ) && [b]OccupySlot( bits_SLOTS_HGRUNT_GRENADE)[/b])
 {
if (FOkToSpeak())
{SENTENCEG_PlayRndSz( ENT(pev), "HG_THROW", HGRUNT_SENTENCE_VOLUME, GRUNT_ATTN, 0, m_voicePitch);
   JustSpoke();}
  return slGruntTossGrenadeCover;
}
 else
 {return &slGruntTakeCover[ 0 ];}
}
[green]else
{if ( RANDOM_LONG(0,1) )
   {return &slGruntTakeCover[ 0 ];}
else
   {return &slGruntGrenadeCover[ 0 ];}
}[/green]
}[/quote]

Sleezy valve coders...

How'd you go about fixing this?

P.S. You know theres a frequent grunt problem is that sometimes when they shoot you and you go into cover, they keep shooting forever and never run out of bullets in their clip UNTIL they see you? Know where that bug is?
Posted 6 years ago2017-09-01 19:23:45 UTC Post #337219
To fix that just check if the grunt has the hand grenade, else always take cover:

[quote]
if ( !( FBitSet( pev->weapons, HGRUNT_HANDGRENADE ) ) || RANDOM_LONG(0,1) )
{
return &slGruntTakeCover[ 0 ];
}
else
{
return &slGruntGrenadeCover[ 0 ];
}

[/quote]

The second bug i don't know about, i can take a look at it.

EDIT:
It's probably just the animation and audio that keeps going, it won't actually shoot:
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/hgrunt.cpp#L917
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/hgrunt.cpp#L787

The real problem is the AI not changing schedules to stop the animation, but i'd have to try this out to see what it's doing to figure that out.
Posted 6 years ago2017-09-01 23:54:43 UTC Post #337225
I actually have them all set to be in a squad but they have no squad leader. Maybe they also need the squad leader to stop throwing nades? I never noticed the first time if they threw nades with a leader because one guy was stuck where he spawned in and the squad leader yelled, "Squad, get Freeman!" which is not ideal for TWHL Pockets where you aren't supposed to be Freeman and I promptly quit and recompiled without the leader. Perhaps I'll add in a squad leader again and wall him off in some out of reach room and see if the rest of the grunts stop dropping nades.

As for the code, I'm not a coder and even if I was I couldn't fix the code for this since it's for TWHL Pockets and it would have to be done on Urby's end and it would affect everyone else making a map for it.

EDIT:

So I've added in a squad leader that is trapped in a hidden room. The first 4 grunts that are already on the floor don't blow each other up with grenades, but once the other 6 teleport in off screen they start blowing each other up. The problem is reduced significantly compared to before but it's still noticeable. I don't know what else I can do at this point though so I think I'm stuck with what I've got.
Posted 6 years ago2017-09-02 02:57:15 UTC Post #337227
I read somewhere recently that monster_human_grunt's squad code only expects around 4 grunts per squad. Maybe assign a couple more seperate squads?

As for the "SQUAD GET FREEMAN!" lines, I expect that Urby will be disabling those in the mods sentence.txt, and I'm also pretty sure that standard grunts have an equal chance of yelling that, so I wouldn't worry about not having squad leaders to prevent that.
Notewell NotewellGIASFELFEBREHBER
Posted 6 years ago2017-09-02 04:13:07 UTC Post #337228
@JeffMOD

That did it... well, mostly. I split them all up so they are 3 separate squads. They do start dropping nades once you start killing off their squad leaders but at the very least they don't start TKing each other until you've already got weapons and have started fighting. The difficulty level of the map has increased a lot overall though and it's right around where I intended it to be.
Posted 6 years ago2017-09-02 09:58:18 UTC Post #337231
TWHL POCKETS will be fully "defreemanised" before release.
monster_urby monster_urbyGoldsourcerer
You must be logged in to post a response.