Jump to content

How do I loop? Do I need to Loop?


Recommended Posts

Hello,

I have created a little mission in IGOR and I am testing different triggers and responses.

One of these that I am having trouble with is this;

I created an enemy team of six men including an officer. I am trying to trigger the enemy team to PANIC (surrender or flee) when their Officer has been killed.

I have been using my sniper to take out the Enemy Officer.

I have it set up as follows:

A) Trigger; Death to actor (Officer)

B) Respose; Panic team

What actually happens after the enmy officer has been killed, is that usually one enemy actor surrenders. The other four remaing enemy actors, just stand there with their weapons at the ready, but it seems that their AI is turned off. I canwalk right up to them and they wont shootat me.

Does anybody think that I need to incorporate actor loop in over the team to get all to bad guys to Panic? If so how do I set up a loop. I have tried to do it before but I keep getting prompted for a group parameter. I am just not sure how to set up a loop and I dont know what a group parameter is.

Thanks

Link to comment
Share on other sites

Ok. First, I'm not totally sure you need to use a loop, you may want to toggle the AI off for the team, then back on, then set them to panic. I have found that sometimes the AI doesn't like to be given too many plans w/o having the AI for the team toggled. The process of toggling the AI for the team seems to clear their recent memory or something.

The group parameter is a very powerful part if IGOR scripting. At the top of the block the Group is labeled for that block. The default Group is simply called <default>. Anything in the <default> group will function as normal, however, you can create custom groups, and they can be called from the script directly, enabled by the script to allow certain strings to be triggered once they are enabled, and they can be used to loop over actors, teams, platoons, and companies. To create a new group, simply click on the edit button next to the group box in the edit string dialog and enter the name for your new group.

There should be some tutorials on looping, but put simply, to create a loop string, you need to create a unique group for the loop. Create the string you want to be looped over the actor/team/platoon ect that you want to effect and assign it to that group. You can use multiple strings to loop by simply creating them in the same group. Once you que the loop, it will parse all strings in that group over the target. Don't forget to use the Block Preserve response first in your string, lest only the first actor/team/ect will be effected.:thumbsup:

Link to comment
Share on other sites

Ok. First, I'm not totally sure you need to use a loop, you may want to toggle the AI off for the team, then back on, then set them to panic. I have found that sometimes the AI doesn't like to be given too many plans w/o having the AI for the team toggled. The process of toggling the AI for the team seems to clear their recent memory or something.

The group parameter is a very powerful part if IGOR scripting. At the top of the block the Group is labeled for that block. The default Group is simply called <default>. Anything in the <default> group will function as normal, however, you can create custom groups, and they can be called from the script directly, enabled by the script to allow certain strings to be triggered once they are enabled, and they can be used to loop over actors, teams, platoons, and companies. To create a new group, simply click on the edit button next to the group box in the edit string dialog and enter the name for your new group.

There should be some tutorials on looping, but put simply, to create a loop string, you need to create a unique group for the loop. Create the string you want to be looped over the actor/team/platoon ect that you want to effect and assign it to that group. You can use multiple strings to loop by simply creating them in the same group. Once you que the loop, it will parse all strings in that group over the target. Don't forget to use the Block Preserve response first in your string, lest only the first actor/team/ect will be effected.:thumbsup:

Hello, Thanks for responding to my post about loopig. I tried as you sugested by triggering the AI off and on. I am still getting the same result. One man surrenders and the others just stand there as if their AI is off.

You were able to give me a little bit of insight to looping but I still dont know how to loop. It is frustrating. You mentioned a tutorial for looping. Do you know which Tutorial it is? I have looked and cant find any tutorials. I have a feeling that what I want to do is pretty straight forward, however, when you dont know how to loop it is a little bit complicated.

Thanks

Brian

Link to comment
Share on other sites

Ok. First you need to create your loop block. The first step is to create the group name for it, for this example I will call it <loop for surrender>. Now, once you have created the tag, you will need to actually assign it to your block. The trigger will be loop for actors. It will read, a loop is ready to process actor x, you will select the This Actor, actor reference tag you will create.(for clarification, this actor=anything you wish, eg. surrendering actors ect.)

The first response you need to use is the 'block preserve'. After that, you can add any other strings you would like to. For instance,

assign no_weapon.kit to This Actor

set This Actor to captive behavior

set This Actor to hostage behavor, ect.

When your officer is killed, his death should trigger a block that ques the <loop for surrender> block over all the actors on your support team. The loop will take away their weapons.

In the same block triggered by the officer's death, you could abort the team's current plan. Create a new group called <surrender>. Use the response 'call' to call a new group from the script(the block triggered by death), you will call the <surrender> group you just created. Now, create a new block under the surrender group, have it triggered when called. This block will contain the new plan which will set the team to surrender behavior. You may want to create a trigger plan with the alertness locked to panic and assign that to them as well if they still give you trouble.

Perhaps there isn't a specific tut on looping, however there are sever really good ones on scripting located here.

Link to comment
Share on other sites

Ok. First you need to create your loop block. The first step is to create the group name for it, for this example I will call it <loop for surrender>. Now, once you have created the tag, you will need to actually assign it to your block. The trigger will be loop for actors. It will read, a loop is ready to process actor x, you will select the This Actor, actor reference tag you will create.(for clarification, this actor=anything you wish, eg. surrendering actors ect.)

The first response you need to use is the 'block preserve'. After that, you can add any other strings you would like to. For instance,

assign no_weapon.kit to This Actor

set This Actor to captive behavior

set This Actor to hostage behavor, ect.

When your officer is killed, his death should trigger a block that ques the <loop for surrender> block over all the actors on your support team. The loop will take away their weapons.

In the same block triggered by the officer's death, you could abort the team's current plan. Create a new group called <surrender>. Use the response 'call' to

call a new group from the script(the block triggered by death), you will call the <surrender> group you just created. Now, create a new block under the surrender group, have it triggered when called. This block will contain the new plan which will set the team to surrender behavior. You may want to create a trigger plan with the alertness locked to panic and assign that to them as well if they still give you trouble.

Perhaps there isn't a specific tut on looping, however there are sever really good ones on scripting located here.

Hey thanks again for responding. I am most of the way there. I think that I just have one more question. How do I stop the loop? The command that I have in place now that I think is the proper one is

:"Continue execution if(this actor is active)"

The whole things looks like this;

Group: Defualt

Coment: Officer gets killed and team panics

Trigger event: Team Main Force 1 Officer has been killed.

Response: force main force team 1 to flee

use officer dies to loop all actors in main force team 1 after this block

Cancel execution of any plan assigned to Main Force Team 1

Group: Officer dies

Comment: loop and make actors flee

Trigger: An actor is ready to process This Actor

Responses: Allow this block to be reactivated

Force this actor to flee

Continue executing rresponses if(This Actor is active)

I have tried this out and out of my six man bad guy team I get one man (Officer) Killed. One man to surrender. Onde man to run away. And three that just satnd there and do nothing pointing thier weapons.

I am just not sure if I am ending the block corredtly.

Thanks

Link to comment
Share on other sites

First, you may not need the continue if active string as they wont flee far if they are dead. Also, the loop will loop over the whole team once, unless called again. For instance, if you wanted a loop to run over and over, as a type of query, you could use a time elapsed trigger, set to say 2 seconds. Every two seconds, the loop would be parsed over the actors in the team. Otherwise, it does only parse once. Perhaps you should follow Lexis' advice and try putting each team member on their own team. Change the This Actor reference to a This Team reference and you are on your way.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...