Programming enemies

Discuss modding & editing for H&D Deluxe using the Insanity 2 editor and 3d Studio Max here.
User avatar
Wilson
Private
Posts: 8
Joined: Sat Jan 22, 2005 12:46 am
Location: USA

Programming enemies

Unread post by Wilson » Sat Nov 13, 2010 8:18 pm

Anyone know if it is possible to get enemies to use grenades?

Anyone know what the "PRG" statement does?

Lars
Commando
Posts: 876
Joined: Wed Sep 08, 2004 9:37 pm

Re: Programming enemies

Unread post by Lars » Sat Nov 13, 2010 9:54 pm

Tried it several times that they should use granades - they never did it for me.
PRG should be some of the unused things left in there for mafia

User avatar
p.jakub88
SAS Soldier
Posts: 2457
Joined: Fri Dec 30, 2011 1:48 pm
Location: Poland

Re: Programming enemies

Unread post by p.jakub88 » Wed Jul 16, 2014 8:52 pm

Wilson wrote:Anyone know if it is possible to get enemies to use grenades?
Hello Wilson,

i figured this out today smile01 .

I remember, that in the default mission in the Ardenes campaign (mission 3) one German soldier thrown a grenade to destroy the stug3 that i drived.

So i made a small test and i edited the 1 mission in Prague.

I created a German soldier equipped with only one stielhandgranate (inventory id 26). I ordered him to stay invisible (set visible - false) until he receives a signal to attack (wait signal suspended and set visible - true). I set his Volume to dynamic (red colour), so he could move. I created a dummy actor (detector) in front of my SAS soldier. So, when the SAS soldier gets close to the 5m range from the dummy (Player in range 5 m), the German will receive the signal to attack (send signal). Below the dummy i placed a checkpoint (user type - green colour) and i named it "granat". Then i programmed the German soldier to attack - subject granat.

I deleted other SAS soldiers to make the scene simpler and i press F6 in HDD Editor to play it. When my SAS soldier reach the dummy in the range of 5 meters, the German soldiers appeared. He started to run in my direction with a grenade in his hand. Then he throw the grenade directly on my position and i was killed.

So, as you see it is possible to program German soldiers to throw grenades only into your SAS commandos, when they appear on a certain place.

EDIT: I also just created a German soldier with grenade and i ordered him to guard. When he saw my SAS commando he thrown a grenade into his position. So, in theory when the enemy soldier has only a grenade left in his inventory he would attack you with it, otherwise he will use another weapon available. You could also set wait signal instead of wait signal suspended.

So, you could force the enemy to use grenades by choosing one of those 5 options:

--> set enemy invisible until he receives a signal from the detector (wait signal suspended) and order him to attack a named checkpoint (user type),

--> set enemy idle until he receives a signal from the detector (wait signal) and order him to attack named checkpoint (user type),

--> equipping him with a firing weapon (like MP40) then order him to use inventory (id 26 - German grenades),

--> equipping him with grenades as a primary weapon (item 0) and order him to guard,

--> equipping him only with the grenades and order him to guard.
"Who Dares Wins" - SAS motto.

User avatar
NilsZ
Major
Posts: 431
Joined: Sun Dec 29, 2013 8:19 pm
Location: Germany

Re: Programming enemies

Unread post by NilsZ » Sat Aug 16, 2014 6:12 pm

Hey p.jakub88

have you also sometimes the Bug that the enemys are to "shy" to throw the grenade?
if you are to close or not in the right distance they dont throw the grenade. When i make the enemys head size to 0 they throw grenades like crazy but they can't aim right.

I think in FfF the A.I. was better at throwing grenades.

EDIT: PRG ist for running around the world in random directions. Good for defense maps.

User avatar
p.jakub88
SAS Soldier
Posts: 2457
Joined: Fri Dec 30, 2011 1:48 pm
Location: Poland

Re: Programming enemies

Unread post by p.jakub88 » Sat Aug 16, 2014 11:30 pm

NilsZ wrote:Hey p.jakub88

have you also sometimes the Bug that the enemys are to "shy" to throw the grenade?
if you are to close or not in the right distance they dont throw the grenade. When i make the enemys head size to 0 they throw grenades like crazy but they can't aim right.

I think in FfF the A.I. was better at throwing grenades.

EDIT: PRG ist for running around the world in random directions. Good for defense maps.
Hello NilsZ,

yes i noticed, that the player need to be in the right distance from the enemy, otherwise they don't throw grenades - they will sometimes run towards you and throw grenades. Thank you for explaining the PRG.
"Who Dares Wins" - SAS motto.

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests