Jump to content
Sign in to follow this  
manzilla

Destroy buildings to cut off reinforcements Objective

Recommended Posts

Can anyone help me with or point me to a simple script that cuts of enemy reinforcements if I blow up a building, let's say a radio antenna? I'd like to make an objective where the player attacks a city(multiple actually) and has to clear them. Reinforcements will come if spotted in a certain radius but then have an optional objective that they can blow up a few buildings to stop this capability.

The buildings are all ready on the map, placed by map author, and I know how to set that part of the objective, I think. But I dont know how to tie that to cutting off the reinforcements optional objective and how to set up the reinforcements to help defend the city if attacked without blowing up the two buildings.

If anyone can provide assistance I'd appreciate it. My scripting knowledge sucks but I'm learning. Finally.

Thanks in advance.

Share this post


Link to post
Share on other sites

To get the building you'd need to use something like

_nObject = getPos player nearestObject 123456

Where 123456 is the ID number of the building. (You can show IDs in the editor by hitting the ID button)

Once you do that, you can check to see if it's dead with

alive _nObject

I would suggest a Detected by ___ trigger that would check to see if the building is alive. If it's still alive then call in reinforcements, which can be groups that are far away but with waypoints to the objective. You'd have to have the trigger tell the group to move into the objective as reinforcements if the building is alive and you are spotted at the objective, otherwise they would not come in.

Share this post


Link to post
Share on other sites
To get the building you'd need to use something like

_nObject = getPos player nearestObject 123456

Where 123456 is the ID number of the building. (You can show IDs in the editor by hitting the ID button)

Once you do that, you can check to see if it's dead with

alive _nObject

I would suggest a Detected by ___ trigger that would check to see if the building is alive. If it's still alive then call in reinforcements, which can be groups that are far away but with waypoints to the objective. You'd have to have the trigger tell the group to move into the objective as reinforcements if the building is alive and you are spotted at the objective, otherwise they would not come in.

Thanks bud! That's what I figured. I'd like the enemy reinforcements to spawn though(which I think I know how to do) Not sure though.

EDIT:

Thanks again, I'm amazed I didn't think of this method. It's so obvious! Man my brain is slow lately.

Edited by Manzilla

Share this post


Link to post
Share on other sites
You'd have to have the trigger tell the group to move into the objective as reinforcements if the building is alive and you are spotted at the objective, otherwise they would not come in.

Question here, xPaveway. I was just reading this again and noticed this. Is there a way to tell the trigger these are reinforcements or do you simply mean I need to sync the groups to the this trigger.

Just checking there's not some scripting trick for reinforcements I'm missing here.

Take care.

---------- Post added at 02:12 PM ---------- Previous post was at 02:00 PM ----------

To get the building you'd need to use something like

_nObject = getPos player nearestObject 123456

Where 123456 is the ID number of the building. (You can show IDs in the editor by hitting the ID button)

Once you do that, you can check to see if it's dead with

alive _nObject

I would suggest a Detected by ___ trigger that would check to see if the building is alive. If it's still alive then call in reinforcements, which can be groups that are far away but with waypoints to the objective. You'd have to have the trigger tell the group to move into the objective as reinforcements if the building is alive and you are spotted at the objective, otherwise they would not come in.

Another thing how would I set this up in a trigger; to check if the building is alive. I see what you wrote above but I'm a little confused by what that means:

_nObject = getPos player nearestObject 123456

Do I put this in a trigger/game logic/etc? And what exactly is this doing?

Next,

What about this:

alive _nObject

This is what I use to check if the buildings are around, right? How would I make this 2 builds? How exactly is this trigger setup? What goes in the condition line, etc?

The way I have it set up now is with a trigger with:

a 50x50 radius with buildings in the center

Present

Condition=

!alive nearestObject [bridgeMonitor, "House"] && !alive nearestObject [bridgeMonitor_1, "House"];

and a hint message in the OnAct line just to double check.

Then I have 2 game logics named "bridgeMonitor" & "bridgeMonitor_1" over the respective buildings.

Edited by Manzilla

Share this post


Link to post
Share on other sites

To use the line:

nObjectA = (getPos bridgeMoniter) nearestObject 123456

I would put that into a Game Logic's init field, I would then simply copy that logic and change 'nObjectA' to 'nObjectB' if I wanted to check for another building. To check to see whether BOTH are Not alive I would create a trigger with axis A/B as 0, activation as none with a condition of:

!(alive nObjectA) AND !(alive nObjectB)

Hope this is what you meant :)

Share this post


Link to post
Share on other sites

Thanks Andy455!

Here's what I have so far but it doesn't seem to work. I was trying a few delete trigger-type commands but they don't seem to work. Others on the forums got them to though.

First, I have a trigger with:

Present

Condition:

!alive nearestObject [bridgeMonitor, "House"] && !alive nearestObject [bridgeMonitor_1, "House"];

OnAct:

hint "done"; trg1 setTriggerStatements ["false", "", ""]; deleteVehicle trg1;

With two GL's named "bridgeMonitor" and "bridgeMonitor_1".

Then further away on the map I have a trigger with:

Present

Activation: Group Leader

Condition:

This

Named:

trg1

OnAct:

nul=[player]execVM "Spawngroup.sqf";

And it's grouped to the player, who is also the group leader.

I blow up the buildings and I get the hint saying "done" but when I get to the trigger area the reinforcements still spawn. I was under the impression that this deleted the trigger when the buildings are blown up.

Can anyone see what I'm doing wrong or point me how to delete a trigger. I've tried what some threads have said but it doesn't work.

Edited by Manzilla

Share this post


Link to post
Share on other sites

Is your second trigger named 'trg1'? I tried it and it works? I can't activate it via radio Alpha, as the first trigger disabled it? Also tried with a hint in second trigger + activated by Bluefor - destroyed building, got first hint, ran in to second trigger, no hint - it's disabled.

Atleast the last 20 minutes working on this has taught me things :P

Share this post


Link to post
Share on other sites
Is your second trigger named 'trg1'? I tried it and it works? I can't activate it via radio Alpha, as the first trigger disabled it? Also tried with a hint in second trigger + activated by Bluefor - destroyed building, got first hint, ran in to second trigger, no hint - it's disabled.

Atleast the last 20 minutes working on this has taught me things :P

Yes it is named "trg1". Could you do me a favor and upload that example mission somewhere and post it here.

www.filefront.com is free and pretty painless.

I'm not sure what's going on here. But sometimes the Editor does the strangest things for me.

Thanks for the feedback.

Share this post


Link to post
Share on other sites
Question here, xPaveway. I was just reading this again and noticed this. Is there a way to tell the trigger these are reinforcements or do you simply mean I need to sync the groups to the this trigger.

Just checking there's not some scripting trick for reinforcements I'm missing here.

Nah there is nothing specially set up for reinforcements. I was simply saying that you could have your group start out far away from the objective, but give them a set of move waypoints and stuff into the objective. If you sync the trigger to one of the waypoints outside of your objective, they will not go past that waypoint until the trigger activates. This would simulate not having them come into the area until trigger conditions were satisfied.

First, I have a trigger with:

On that trigger, just make sure it's set to "ONCE" and I believe you don't need to worry about deleting it.

Why are you using two triggers? I think you can accomplish what you are trying to do by only using one.

Here's a rough example:

Create your objective area (for example a town). Place your normal guys you want stationed there etc. Add a trigger in the center of town. Make the trigger type a "detected by opfor" with the activator being "blufor" or whatever sides you are using.

(I dont know the details about using detected by triggers, haven't used many of them, you probably want to test it separately first)

In the detected by trigger, have the condition field as

this && alive nearestObject [bridgeMonitor, "House"] && alive nearestObject [bridgeMonitor_1, "House"];

(By having "this" in there, it means it will also check the built in 'detected by' conditions notice I removed checking for if the building is dead, in the case you'd want to check if it's alive)

Sync that trigger to your reinforcement group's waypoints. And there you go. The trigger will not fire (reinforcements wont come in) unless you have satisfied:

1. You were detected by the opfor.

2. The radio tower at bridgeMonitor is alive.

3. The radio tower at bridgeMonitor_1 is alive.

Otherwise the trigger's conditions will not be true and it will not trigger your reinforcements.

Share this post


Link to post
Share on other sites
Nah there is nothing specially set up for reinforcements. I was simply saying that you could have your group start out far away from the objective, but give them a set of move waypoints and stuff into the objective. If you sync the trigger to one of the waypoints outside of your objective, they will not go past that waypoint until the trigger activates. This would simulate not having them come into the area until trigger conditions were satisfied.

On that trigger, just make sure it's set to "ONCE" and I believe you don't need to worry about deleting it.

Why are you using two triggers? I think you can accomplish what you are trying to do by only using one.

Here's a rough example:

Create your objective area (for example a town). Place your normal guys you want stationed there etc. Add a trigger in the center of town. Make the trigger type a "detected by opfor" with the activator being "blufor" or whatever sides you are using.

(I dont know the details about using detected by triggers, haven't used many of them, you probably want to test it separately first)

In the detected by trigger, have the condition field as

this && alive nearestObject [bridgeMonitor, "House"] && alive nearestObject [bridgeMonitor_1, "House"];

(By having "this" in there, it means it will also check the built in 'detected by' conditions notice I removed checking for if the building is dead, in the case you'd want to check if it's alive)

Sync that trigger to your reinforcement group's waypoints. And there you go. The trigger will not fire (reinforcements wont come in) unless you have satisfied:

1. You were detected by the opfor.

2. The radio tower at bridgeMonitor is alive.

3. The radio tower at bridgeMonitor_1 is alive.

Otherwise the trigger's conditions will not be true and it will not trigger your reinforcements.

I'll definitely try that but what I don't know is how to set up the reinforcements using the spawn script I have under your method. I don't want the actual units on the map at all, don't want them getting into it with any air units or anything else that may appear.

I'm trying it the other way just for s&%ts n' giggles. Trying to learn a bunch of different ways of doing things, even if it's the easy way and the really hard way. I learn a lot better when I try things the hard way.

Thanks for your help. I'll try it and let you know.

Share this post


Link to post
Share on other sites

http://www.filefront.com/15394499/Manzilla%20Delete%20Trigger%20Test.zip

Check 1 fires on building destruction, Check 2 fires when you run to the left of the tank, and the trigger is active.

You can see for yourself by running before taking out the building - Check 2 works. Destroy the building, then Check 2 does not work.

And I know what you mean - I have those crazy bugs too :/

Share this post


Link to post
Share on other sites

Much appreciated bud. I'll give that a go. Excellent! :coop:

---------- Post added at 09:36 PM ---------- Previous post was at 08:18 PM ----------

Wow this is embarrassing. After checking yours I noticed I had "trg1" in the text box of the trigger. I'm used to putting names in units much more than triggers I guess. :D

Share this post


Link to post
Share on other sites

Hehe.

Ahh well - thanks for this - I learnt a lot. I've got tons of threads floating around unanswered :P

Also, I've been searching out your threads, and Splicer's, because you guys seem to have the best questions :P

Have a good one, mate,

- HateDread.

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  

×