Jump to content
Yolo Joe

Starting defense module from trigger

Recommended Posts

I've got the Defense Module to work, but I have no idea how to activate it from a trigger.

First trigger has on activation "startDefense = true"

The second trigger has condition and name "startDefense" and is synced to the defense module

The defense module has the 'Condition of presence' "true"

This system works for the "Zeus Lightning" module, but here nothing happens...

Am I doing something wrong?

Share this post


Link to post
Share on other sites
I need help people! :rolleyes:

Isn't the defense module automatically activated when placed in the editor?

Share this post


Link to post
Share on other sites
Isn't the defense module automatically activated when placed in the editor?

If everything is placed and synced together correctly, then yes. It starts automatically.

---------- Post added at 10:41 ---------- Previous post was at 10:06 ----------

But I need it to start from a trigger, not automatically

Share this post


Link to post
Share on other sites

Well, you would simply syncronise it with the trigger, but apparently that's what you did.

Share this post


Link to post
Share on other sites
Well, you would simply syncronise it with the trigger, but apparently that's what you did.

Yup, already tried it.

---------- Post added at 13:33 ---------- Previous post was at 11:45 ----------

Nevermind, I had to sync the Defend module and the Sector module.

But now I'm having a bit more complicated problem >.<

These arrows show where the enemies are attacking from.

http://i.imgur.com/N6eGPYi.jpg (922 kB)

The arrows spawn on the location of the "spawn point triggers"

http://i.imgur.com/27IX3Ny.jpg (626 kB)

The arrows appear once the mission starts, without the Defense module activated.

How can I make the arrows appear once my trigger conditions are met? I can't sync a trigger to a trigger and changing the Condition field of the triggers does nothing.

Edited by Chillroy

Share this post


Link to post
Share on other sites

The simplest way would be to hide all markers and display they once the trigger has been activated.

init.sqf

If (isServer)  then
{
   {_x setMarkerAlpha 0} forEach allMapMarkers;
};

In the trigger which activates the defend module put:

{_x setMarkerAlpha 1} forEach allMapMarkers;

However, if you only want to hide those to markers, and not every marker you would need to do it as follows:

init.sqf

if (isServer) then
{
  yourMarker = ["marker1","marker2"]; //all the marker you don't want to hide
  markerModules = allMapMarkers - yourMarker; //seperate the markers you want to hide from the ones you don't want to
  {_x setMarkerAlpha 0} forEach markerModules; //hide all unwanted markers
};

In the trigger which activates the defend module put:

{_x setMarkerAlpha 1} forEach markerModules; //show all markers once the module has been activated

I hope I could help you.

Edited by R3vo

Share this post


Link to post
Share on other sites

Thank you R3vo! It works perfectly for MP, but what do I do for SP?

if ([b]local[/b]) then
{
  yourMarker = ["marker1","marker2"]; //all the marker you don't want to hide
  markerModules = allMapMarkers - yourMarker; //seperate the markers you want to hide from the ones you don't want to
  {_x setMarkerAlpha 0} forEach markerModules; //hide all unwanted markers
};

This does not work..

(I have no idea what I'm doing :))

Share this post


Link to post
Share on other sites

The command

[url="https://community.bistudio.com/wiki/local"]local[/url]

expects an object. However, in singleplayer you don't need that at all. Simply put the code without the if condition in your init.sqf. The if (isServer) has only the purpose to prevent JIP players to execute the code all over again.

init.sqf (singleplayer)

yourMarker = ["marker1","marker2"]; //all the marker you don't want to hide
markerModules = allMapMarkers - yourMarker; //seperate the markers you want to hide from the ones you don't want to
{_x setMarkerAlpha 0} forEach markerModules; //hide all unwanted markers

Edited by R3vo

Share this post


Link to post
Share on other sites

Hi, i would use a defense module in a sp mission. I use zeus system, but no one were spawned. Please help me

Share this post


Link to post
Share on other sites

I have tried both options and other commands to disable the trigger markers.

 

Still can't get it to work, need some help please....even removing them entirely would be great!

 

 

R3vo

Posted 01 July 2015 - 22:00

The simplest way would be to hide all markers and display they once the trigger has been activated.

init.sqf

If (isServer) then
{
{_x setMarkerAlpha 0} forEach allMapMarkers;
};In the trigger which activates the defend module put:

{_x setMarkerAlpha 1} forEach allMapMarkers;


However, if you only want to hide those to markers, and not every marker you would need to do it as follows:

init.sqf

if (isServer) then
{
yourMarker = ["marker1","marker2"]; //all the marker you don't want to hide
markerModules = allMapMarkers - yourMarker; //seperate the markers you want to hide from the ones you don't want to
{_x setMarkerAlpha 0} forEach markerModules; //hide all unwanted markers
};
In the trigger which activates the defend module put:

{_x setMarkerAlpha 1} forEach markerModules; //show all markers once the module has been activated

I hope I could help you.

 

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

×