Home   Help Search Login Register  

Author Topic: SOM module discussion  (Read 7943 times)

0 Members and 1 Guest are viewing this topic.

Offline jones

  • Members
  • *
Re: SOM module discussion
« Reply #15 on: 10 Sep 2009, 22:51:42 »
you could do it via action menu, when the scripts executes remove the action then use something like
Code: [Select]
["supply_drop",  unit] call BIS_SOM_addSupportRequestFunc;
_waittime = _time;
waituntil {_waittime == 120}
unit addaction.........................

not sure if it would work just jotted it down
_time variable is a reserved local variable that tracks time after the script fires. I think it would work in the instance

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re: SOM module discussion
« Reply #16 on: 10 Sep 2009, 23:57:33 »
With much thanks to this thread, I have the SOM operating in a mission such that the player can call in arty, air strike, or transport.  However, particularly with the arty, they can only do so 1x.

Is there some way to have a delay before the arty is available again, but still make it available again?

Thanks!

  i added a radio trigger to make the arty available again...

Code: [Select]
[[""artillery_barrage""], player, [[RIPPER, [1,2,3,4,5,6,7,8,9]]]] call BIS_SOM_addSupportRequestFunc;

This assumes your arty module is named Ripper and you are using a howitzer, the mortar and mlrs/grad won't fire all the shell types the cannons will.

Offline Trexian

  • Members
  • *
Re: SOM module discussion
« Reply #17 on: 11 Sep 2009, 14:15:25 »
Great ideas, guys. :)

I'd prefer not to add to the addActions - personal preference only, in that it seems like that gets cluttered rather quickly.

I'm also wondering if I can dynamically create the radio triggers.  You could have the array of types of SOM support, and select a random number of them, then add those radio calls.  They could call a script that sets them up, then delays before adding the radio call back in....

EDIT: BTW, I'm using the arty in "virtual mode" through the SOM.
« Last Edit: 11 Sep 2009, 15:31:06 by Trexian »
Sic semper tyrannosauro.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re: SOM module discussion
« Reply #18 on: 12 Sep 2009, 11:52:13 »
it appears that triggers CAN be dynamically created, I found this http://community.bistudio.com/wiki/createTrigger in the wiki but admittedly I haven't tried to use it.

Offline SaOk

  • Missions Depot Staff
  • *****
    • My youtube profile
Re: SOM module discussion
« Reply #19 on: 12 Sep 2009, 14:05:11 »
Dynamically created triggers work great and are easy to make. I used this code in my latest mission:

Code: [Select]
_trg=createTrigger["EmptyDetector",getPos player];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["HOTEL","PRESENT",true];
_trg setTriggerStatements["this", '[] exec "reschat.sqs"', ""];
_trg setTriggerText "Call in NAPA fighters";

After activation the trigger was be deleted with:

Code: [Select]
deletevehicle _trg;

Offline Trexian

  • Members
  • *
Re: SOM module discussion
« Reply #20 on: 14 Sep 2009, 14:56:20 »
Here's what I tried to create a SOM-connecting dynamic trigger.

Code: [Select]
_artyTrig = createTrigger ["EmptyDetector", (getpos Player)];
_artyTrig setTriggerArea [0, 0, 0, false];
_artyTrig setTriggerActivation ["ALPHA", "PRESENT", true];
_artyTrig setTriggerStatements ["this", "nul = [_artyTrig] execVM 'JTD_artyCall.sqf'", ""];
_artyTrig setTriggerText "Connect to Ripper 1";
[["artillery_barrage"], player, [[[1,2,3,4,5,6,7,8]]]] call BIS_SOM_addSupportRequestFunc;

But I got an error that it is missing a ] in the setTriggerStatements line (which, by experience, could mean a missing " or ' or } or ; or ) ....) :)  It occurs to me that the setTriggerStatement my automatically pass the id of the trigger?

Edit - ahh, regardless, I see your setTriggerStatements has a different combination of ' and " than I do. :)

Edit 2: And voila! That did the trick!

I don't really know how or why it works, but I now dynamically create a trigger in the init:
Code: [Select]
_artyTrig = createTrigger ["EmptyDetector", (getpos Player)];
_artyTrig setTriggerArea [0, 0, 0, false];
_artyTrig setTriggerActivation ["CHARLIE", "PRESENT", true];
_artyTrig setTriggerText "Connect to Ripper 1";
_artyTrig setTriggerStatements ["this", 'nul = [_artyTrig] execVM "JTD_artyCall.sqf"', ""];

The artycall script is:
Code: [Select]
private ["_trig"];

_trig = _this select 0;
[["artillery_barrage"], player] call BIS_SOM_addSupportRequestFunc;


And my initial tests seems like it works.  I guess the repeating nature of the trigger keeps it coming back.  It does seem to wait an appropriate amount of time before allowing more arty, which is good.
« Last Edit: 15 Sep 2009, 05:33:45 by Trexian »
Sic semper tyrannosauro.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: SOM module discussion
« Reply #21 on: 12 Jan 2010, 22:57:07 »
Since this is very much connected to the SOM module, I wanted to add to the discussion (and remind people of this nice little module and its possibilities in editing):

There is, AFAIK, NO way to initialize and use the SOM module -unless- it is synchronized from mission start with the player. This is I think the same reason it's not really working in MP. I need this for a situation where the player is not the player at the start of the mission, but will rather be created and then selected using selectPlayer. However this makes the use of the SOM module impossible since you can't use the synchronizedObjectsAdd command to synch the SOM module with the "new" player!

If anyone knows how to make this work, through any workaround, please let me know. It is very frustrating since there's no alternative for me: the player will simply not be "the player" when the mission starts (it's a campaign script, and if the main character dies then teamswitch kicks in, meaning the next mission might have -any- of the characters as the "player").

I really don't understand how BIS dropped the ball on this one, it's quite confusing. You can do it with the ACM, the first aid modules, ALICE, etc. They all work fine out of the box. But not SOM.  >:(

Help?

Wolfrug out.

"When 900 years YOU reach, look as good you will not!"

Offline Trexian

  • Members
  • *
Re: SOM module discussion
« Reply #22 on: 13 Jan 2010, 14:27:23 »
I messed around with syncing the SOM to "new" units - in my case, they were spawned.  Couldn't get it to work.  There's a few lines of code that seem to work to sync First Aid modules with new players, but I couldn't sort out how to make it work with SOM.

For your purposes, would it be possible to have the units elsewhere on the map, sync them from the start with SOM, but then move and group them together when you need it?  Maybe a scripted setPlayable for the units?

SOM might see them as sync'd from the beginning?
Sic semper tyrannosauro.