Jump to content

Recommended Posts

Posted

This is my first time creating a mission, so it's possible I'm out of my league here.

 

In our mission we have an area that's designated for PvP (We're a free flight server). We don't want players aircraft to leave this area, so I've set up a trigger area that encompasses the area.

 

We also have two airfields for Red and Blue, and we don't want them shooting each other on the ground so I've set up trigger zones surrounding those airfields as well.

 

The triggers are as follows:

 

 

Type: 1 Once

Event: None

 

PART OF GROUP OUT OF ZONE (Aircraft name), PvP zone

OR

PART OF GROUP IN ZONE (Aircraft name), red airfield

 

Then I have it running a script to blow up the aircraft

trigger.action.explosion(Unit.getByName('Pilot #168'):getPosition().p, 100)

 

 

Aircraft will sometimes explode when exiting the PvP zone, but never explode upon entering the other airfield.

Posted

Can you explain further please?

 

Are there player clients in both red and blue coalitions or are all player clients in the blue coalition?

 

I don't know if your just using your script code as an example of what you're trying to do,

but that line "trigger.action.explosion(Unit.getByName('Pilot #168'):getPosition().p, 100)"

will only ever blow up the unit 'Pilot #168' regardless of what GROUP enters or leaves specified zones.

 

Do you know the difference between a unit and a group?

You're using a triggger condition that checks if any unit that belongs to a group is inside a zone.

 

The script you're executing is a static reference to a certain unit within some group.

 

I'd go about this whole thing with a trigger by type 'CONTINUOUS', with no condition, and a "DO SCRIPT FILE" action. Withing the script you do two separate enumerations.

 

First enumerate all units who are in the red airfield zone and explode them.

Second enumerate all units not in zone PvP zone and explode them.

GPU: PALIT NVIDIA RTX 3080 10GB | CPU: Intel Core i7-9700K 4,9GHz | RAM: 64GB DDR4 3000MHz
VR: HP Reverb G2 | HOTAS: TM Warthog Throttle and Stick
OS: Windows 10 22H2

Posted

That's the exact script I used, but changing the pilot # each time. I had each aircraft as it's own group, as to not blow up an entire side from one aircraft leaving the zone. I did manage to fix the problem though, a major part being I didn't understand how [OR] worked and ended up having an "and" statement instead.

 

I would close/delete this thread if I knew how

 

Thank you for your reply, Chris.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...