Jump to content
Sign in to follow this  
Troy

Any one know how to make a AI soldier commit Suicide?

Recommended Posts

hey guys, I'm making this mission where you crash your helicopter and so on, but when every body gets out of the helicopter i want the captain of the crew to kill himself but it would look like the other side killed him (Russia) with the gun sound of AK-107 or some Russian gun killed him so you are now unexpectedly the captain with out been the captain from the start of the mission. Iv done another way, iv put a waypoint on him set as Hold, 'never fire, stealth,' then i have put a trigger and set to 'if blufor are present then switch' sync this trigger with the hold waypoint. next from the hold waypoint i put 'destroy' where he is meant to die and set the behavior to 'fire at will and combat'. It worked but no really well so i thought I might give this a try but im not sure how so can you guys please help me???

Sorry if it doesn't really make any sense im really tried!

Share this post


Link to post
Share on other sites

In a trigger (when you want him to die) put this in its onAct:

CaptainName setDamage 1;

That will kill him outright, although there wont be a sound to accompany it, maybe in the effects options there is gun sounds?

Share this post


Link to post
Share on other sites

I read in other threads that one can place bombs to go off when the mission starts.

Perhaps this could be done attaching a grenade to the AI and set the grenade off with a trigger?

That'd definitely give you both a nice boom and kill the AI.

Just a thought. :D

Best, Splicer.

Share this post


Link to post
Share on other sites

To do it the way Splicer suggested, simply put this into your units init field:

_hg = "G_40mm_HE" createVehicle (getPos this);

Share this post


Link to post
Share on other sites

thanks a lot guys you have really helped me but still there is only one problem with Andy455's CaptainName setDamage 1; idea, it worked but i wont the guy to die on the ground not while hes in the helicopter, it keeps doing that because we keep flying over the trigger is there like a way to make the trigger only work on the ground and not in the air?? and splicer's idea work as well but it only went off when he was in the helicopter not when he was walking over the trigger :confused:

Share this post


Link to post
Share on other sites
(not (unit1 in helicopter))

Maybe put that in conditions for trigger, as well as 'this', so I believe it should say

this && (not (unit1 in helicopter))

Just changed Unit 1 to name of that soldier, and helicopter to heli name, I believe.

Have you grouped the trigger to the squad, and made it so the leader has to be within the radius for it to work? If you combine that with my code... might work.

Mess around with that a bit.

Regards,

- HateDread

Share this post


Link to post
Share on other sites

To HateDread,

I have tried it but it didn't work, i put all the codes and stuff in the trigger like you said but it wouldn't let me press ok, it keep on saying missing ; and invalid number or something like that i couldn't work it out! :( you don't have to but if you like, if you get it working, can you print screen the trigger so i know what to do or any one else that can help me

thanks!

Share this post


Link to post
Share on other sites

Sorry, that was a guess on my behalf. Gimme a minute.

Hmm...

Alright, I got it.

In the condition field of the trigger, you put

(not (Player in H1)) && this

Where player is the unit and H1 is helicopter name.

Group the trigger with the guy, and in the activation drop-down, select 'Group leader'. Set the radius to whatever you need.

Since that condition says '&& this', it basically checks for both conditions - not being in the chopper, AND what you selected in the drop-down menu, as 'this' refers to the activation option you selected.

In the 'On Act';

CaptainName setDamage 1;

Hope this helps!

Regards,

HateDread.

Share this post


Link to post
Share on other sites

Okay let's see if I got it right.

You have a squad inside a helicopter. The helicopter crashed and once the squad leader is out of the helicopter you want him to be killed (by enemy gun fire).

You need atleast three things:

1) The helicopter needs to have a name, here we name him "heli1"

2) the squad leader needs to have a name too. We keep "unit1" from above example.

3) A trigger which checks if the squad leader (unit1) is outside the helicopter and if yes kills the squad leader.

Optional

4) AK single shot soundfile from \addons\weapons.pbo

In the trigger you add this to the condition line:

!(unit1 in heli1)

In the onActivation line you type:

unit1 setDamage 1

I also suggest you add a little delay to the trigger (2 or 3 seconds) so the leader isn't killed instantly.

I made you a small example mission (with the AK sound).

Share this post


Link to post
Share on other sites

Wow thanks W0lle you have done it thanks you have helped me out so much and same to you HateDread! Thank you both you guys and all the other people that have also help me really big thanks!!!!!!

Now to continue making my mission :yay:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×