Jump to content

Don't Fire Unless Fired Upon


JustSomeGuy

Recommended Posts

I've beat my head against the wall long enough...

I want to script a mission where the team is required to hold their fire unless fired on. I know I've seen something like this before, but I can't remember what mission/mod, so I can't even lift the script.

Does anyone remember the mod or know how to script a set of triggers and responses that would allow me to remove the objective once the OpFor has fired and fail the team if they fire first?

I can get most of this; all except the key element, the OpFor (any actor on the OpFor) fires as a trigger.

Link to comment
Share on other sites

To the best of my knowledge there is no easy way to detect if any member of a company (or platoon, or team) has fired their weapon. You can check if a specific actor has fired, but that is obviously cumbersome.

Our tournaments, instead, used a "spotting script" to detect if a player had been observed (for long enough) by an OPFOR, and would trigger responses if that happened.

Here is a snippet of the script from "A Cold Welcome" from the 2006 community coop tourney -- this was the "final" version of this chunk of script we used (you can download the full mission from this thread in our forums).


Group: <Default>

Comment:

   Start Up

Trigger Event:

   The simulation is starting.

Responses:

   Set Player Platoon to (The player-controlled platoon).

   Enable the (STLTH) Spot script blocks.

   Set FLG:StealthBroken to false.


Group: (STLTH) Spot

Comment:

   Main spot loop

Trigger Event:

   2 second(s) elapsed.

Responses:

   Allow this block to be reactivated.

   Skip the remaining responses if ((The value of DS:count) is less than (The value of DS:active-players)).

   Skip the remaining responses if (The state of DS:spotted).

   Set DS:count to 0.

   Set DS:active-players to (The number of active actors on Player Platoon).

   Use (STLTH) Spot to loop over all actors in Player Platoon after this block.

   Continue executing responses if (The state of FLG:StealthBroken).

   Disable the (STLTH) Spot script blocks.


Group: (STLTH) Spot

Comment:

   Loop over players

Trigger Event:

   An actor loop is ready to process DS:player.

Responses:

   Allow this block to be reactivated.

   Continue executing responses if (DS:player is active).

   Increment DS:count.

   Skip the remaining responses if (The state of DS:spotted).

   Continue executing responses if (DS:player is being seen by Bad guys).

   Set DS:spotted to true.

   Set DS:detected-player to DS:player.

   Set DS:det-check to expire in 5 second(s).


Group: (STLTH) Spot

Comment:

   Check if still seen

Trigger Event:

   DS:det-check has expired.

Responses:

   Allow this block to be reactivated.

   Set DS:spotted to false.

   Continue executing responses if (DS:detected-player is being seen by Bad guys).

   Disable the (STLTH) Spot script blocks.

   Call Stealth Broken after this block.

It has some "funny" weaknesses if multiple players get spotted at nearly the same moment, and it only checks once after 5 seconds to see if the player is still spotted, but it is quite effective/realistic in game. I think most/all of the people that were "caught" by this felt like they got spotted.

Good luck, I hope this helps.

Edited by Buehgler_AS
Link to comment
Share on other sites

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...