Jump to content
Sign in to follow this  
sarelg

Make a group surrender

Recommended Posts

I saw how to make a unit surrender when I get near it, but I want to know how do I make a group surrender when I kill a certain number of soldiers in that group, (i.e. if there are 10 people in the group and I kill 5, then the rest surrender).  confused.gif

Share this post


Link to post
Share on other sites

This script (not tested) will make the units in the group all setcaptive true. You can add any other events you want to happen to the script, like play an animation, add this after the #sur.

Execute the script with, [groupname] exec "surrender.sqs"

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_group = _this select 0

#loop

_unitnum = count units _group

?_unitnum <= 5: goto "sur"

~0.5

goto "loop"

#sur

"_x setcaptive true" forEach units _group

<span id='postcolor'>

RED

Share this post


Link to post
Share on other sites

How exactly do I make it work?

Share this post


Link to post
Share on other sites

EDIT: lol

EDIT2: I apoligize, I posted in the wrong thread.

Share this post


Link to post
Share on other sites
Guest jacobaby

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (sarelg @ Mar. 21 2003,19:26)</td></tr><tr><td id="QUOTE">How exactly do I make it work?<span id='postcolor'>

In the INIT field of the group leader (or anywhere eg INIT.sqs) you have to run the script.

So you put the name of the group you want to surrender (are they French units btw tounge.gif ) into the array to fire the script.

Lets say your group is called ALPHA.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

[ALPHA] exec "scriptname.sqs"

<span id='postcolor'>

After this has run the script Red posted, the units in the group will no longer be seen as targets by any AI, although they will still track them and watch them.

To make it look extra cool you should get them to drop their weapons, and then switchmove them to the surrender animations.

TJ

Share this post


Link to post
Share on other sites

sorry I dont know anything about scripting, but how exactly do I name a group? how do I add the switchmove and remove weapons? and how do I exactly get the script to work?

Share this post


Link to post
Share on other sites
Guest jacobaby

respectfully,

These things have been discussed 100's of times.

Take a look at ofpec.com and grab a tutorial about scripts and whatever else you need.

It will really help you learn it for yourself. much better than us just telling you how to do it. You will be able to do more complicated things once you get the basics in place.

TJ

Share this post


Link to post
Share on other sites

confused.gif for some reason ofpec.com doesnt want to load on my computer. anywho, i am an extreme novice at scripts and i'm wondering how to get the scripts recognised by OPF. I have tried out the above script but when i attempt to play the level out I get a message saying the script isnt found. But i will be pleased if I can get this to work biggrin.gif

I have put the script inside the folder of the mission smile.gif

Share this post


Link to post
Share on other sites

Make sure your folder options are set so you can see the full file names, then check to see if the script file is named:

script.spq.txt

If it is, remove the .txt.

RED

Share this post


Link to post
Share on other sites

Alright, I have this working so far, but I'd like to clean it up a little bit.

Right now I have six triggers that are set up for each member of Alpha platoon so that when you shoot them they'll die and not just stay in FXStandSurUniv position:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">Condition: Not Alive Alpha1

Activation: Alpha1 switchmove ""<span id='postcolor'>

Is there a way that I can combine all of these into one trigger? It seems sloppy that I had to make a seperate trigger for each.

I'm still lost on how to get the units to drop their weapons...

Share this post


Link to post
Share on other sites

I can't think of any logical way to do that with a trigger. Try and do it with a script, it will be much easier.

I don't usualy see you around these ME parts Othin smile.gif

RED

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  

×