Jump to content
Sign in to follow this  
Chalk2

How to make a single unit hostile

Recommended Posts

Hi,

i want to create the following situation:

a player walks up to a civilian and ask him something, hell respond by pulling his pistol out and open fire at the player.

I have everything working till the point where the guy is supposed to open fire at the player and/or the players mates. Does anybody know how to set a former friendly unit hostile towards the players side, or any other method archieving similar results?

Thanks.

Share this post


Link to post
Share on other sites

maybe use the setFirend command.

Be aware that this command only sets the friendliness of one side. If you want to have both sides attacking each other, you have to set both:

WEST setFriend [Civilian, 0];
Civilian setFriend [WEST, 0];

But i think it's enough when you set "Resistance is friendly to OPFOR" in the editor. When the civilian has a weapon, he will fire to all units on side west. A civilian with a weapon is then a resistance unit. ;)

Share this post


Link to post
Share on other sites

@Imutep

i want to stay away from setFriend cause:

Intended to be used on mission start. Changing value during mission can cause unexpected errors in AI behavior.

Im gonna think through the Resistance idea, mabye do a addWeapon/addMagazines during the conversation and see what happens, i got to sleep now, will check tomorow about it.

@Junker

could you point me to a wiki entry for "set rating" or post a syntax example on how to use it?

Edited by Chalk2

Share this post


Link to post
Share on other sites

I tryed the Resistance Idea and addRating, unfortunaly the Civilian still wont attack the player. Guess i have to do this differently.

Share this post


Link to post
Share on other sites

Use opfor armed civilians or make civilian as opfor.

Remove weapons and set him as captive.

When he needs to go bonkers add mag, gun and set him back to enemy.

Share this post


Link to post
Share on other sites

His is how i solved it:

Dummy = createGroup civilian;

"worker3" createUnit [getMarkerPos "unit", Bomber, "unitDummy = this"];

when needs to freak:

DummiEast = createGroup east;

[unitDummy] join DummiEast;

unitDummy addWeapon "...";

unitDummy addMagazine "...";

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  

×