Home   Help Search Login Register  

Author Topic: Flag Change/Zone Captured script (DELAYED)  (Read 5295 times)

0 Members and 1 Guest are viewing this topic.

Offline norrin

  • Tutorial Writer
  • **
Flag Change/Zone Captured script (DELAYED)
« on: 04 Mar 2007, 10:41:15 »
Flag Change/Zone Captured script.

As I posted on the BI forums the triggers that activate this script may now be a little redundant thanks to the new "seized By" trigger but the triggers are based on a slightly different concept and the flag change script will still be useful for some map makers out there.

Demo mission
You can down load a simple mission from here

Mission Contents
Mission.sqm (contains triggers that activate the flag_capture.sqs)
Init.sqs (defines the global variables via mission_start.sqs)
mission_start.sqs (defines the variables once at the start of the mission then JIP players receive the current state of the global variable at the moment they join mission)
flag_capture.sqs (changes the textures of the captured flag to that of the capturing side)
 
Description of Scripts
It is a script that triggers upon an area being captured and changes the flag to that of the capturing team.

These flag change/zone captured triggers are activated after a team has been in a zone for a certain amount of time without an enemy unit entering that zone during that period.  It takes a few seconds for the flag to change after the zone is captured.

These areas and times can be adjusted within the trigger.  Currently set to 5 secs capture time (for the sake of testing - probably want this set to at least 20 or 30 seconds for match play) and capturing distance set to 20 and the no enemy units radius also set to 20 (look in the conditions line of the trigger to change this).

For the sake of testing the triggers at each flag are slightly offset so you can find them in the example mission but you'd want to superimpose them directly on top of each other in your missions.

The mission can be played as either BLUFOR or OPFOR (both without weapons for testing purposes) but you'll need to play as BLUFOR to get the initial flag change as flags are currently set to Russian textures. 

This script also allows the flag's textures to change back and forth as the different sides get control of the zones.

Really designed for testing using the method described here

Game Version tested on
1.05.  Tested on a dedicated server with multiple players and works with JIP.

Known Bugs
Some players, who join after the mission has commenced, do not get the on screen text prompts to say a flag is changing even though it does change.  Any one with suggestions on how to fix this please let me know.

Future developments
If requested I can update the mission using the new seized by trigger and if people are interested I could make the flag neutral to start with so that both sides could capture the flags from the outset.  I could also delete the hints that pop up while the script is running.

Spooner 2007-11-04: Delayed due to broken link to demo. Should the author wish to re-attach/re-link the files, then this resource will be tested for submission.
« Last Edit: 08 Nov 2007, 12:43:20 by Spooner »

Offline Ruffneck

  • Members
  • *
Re: Flag Change/Zone Captured script
« Reply #1 on: 05 Mar 2007, 18:22:22 »
Hi,

Um...I cant seen to download the link. It says file not found...?

Any ideas?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Flag Change/Zone Captured script
« Reply #2 on: 05 Mar 2007, 18:43:54 »
Worked fine for me.


Planck
I know a little about a lot, and a lot about a little.

Offline norrin

  • Tutorial Writer
  • **
Re: Flag Change/Zone Captured script
« Reply #3 on: 05 Mar 2007, 23:15:01 »
@RUFF-NEK_2-0,

I checked it seems to be working OK from my end.  If you're still having probs with the d/l could you please PM me your email address and I'll send you the files directly.
« Last Edit: 13 Mar 2007, 18:45:07 by bedges »

Offline Ruffneck

  • Members
  • *
Re: Flag Change/Zone Captured script
« Reply #4 on: 13 Mar 2007, 12:19:51 »
Hi Norrin, works fine now. (Dont know what I did different...just clicked on the link  ??? )

Anyway, the files work great!!

But, I just want to know if its possible to link the flag capture with a points system? like sector control i think

Eg: Both sides start with a set amount of points each.

If your flag is captured by the enemy then you lose say 3 point per minute. If your side owns all the flags then you wont lose any points. (Except for your own infantry deaths)

Also, it would be great to define a point structure for killing the enemies units and vehicles.

i.e.
1 point for killing infantry
2 points for vehicles
5 for aircraft
etc??

Do you know if this can be done?

Offline norrin

  • Tutorial Writer
  • **
Re: Flag Change/Zone Captured script
« Reply #5 on: 14 Mar 2007, 01:01:56 »
I've just updated the test mission to use the new "Seized by" trigger.  You can get an updated version from here

Note: Discovered that the units need to be carrying a weapon to activate these triggers

Bug: There is still a bug whereby JIP players don't see the text sent by the  globalChat and titleText commands even though they execute the scripts that contain these messages.

@RUFF-NEK_2-0

It sounds like a good idea, I think Menez was asking for something similar over at the BI ArmA forums.  Its certainly doable but it will be a little bit of time before I get a chance to look at it, that being said I might be able to get something written for the flag points fairly quickly but the rest is going to take a little longer as I'm going to need to work out how the game views these other events.   Maybe you could start a thread and get some input into what people think the various types of units are worth.

Offline D_P_

  • Members
  • *
  • YAY! I'm a lama again! ...oh wait.
    • ArmaAddons
Re: Flag Change/Zone Captured script
« Reply #6 on: 14 Mar 2007, 01:54:06 »
when I click on here to dl the example...it opens a page with a msg about the mission and then alot of code...but no file to dl :(
Am I missing a crucial step here or am I just stupid?
just setpos & forgetpos!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Flag Change/Zone Captured script
« Reply #7 on: 14 Mar 2007, 02:38:42 »
Hmmm, try Right clicking 'here' and choosing 'Save link target as'.


Planck
I know a little about a lot, and a lot about a little.

Offline Ruffneck

  • Members
  • *
Re: Flag Change/Zone Captured script
« Reply #8 on: 14 Mar 2007, 07:56:36 »
Roger that Norrin! I think it would form quite a vital part of gameplay

I was thinking of including a General for each side(AI)...If he is captured and taken back to your base then you get MEGA points, and much less if you kill him.
Same applies for taking out Jets or choppers for example because they are high value targets.

Or make the General playable and have the ability to use arty, supply drops and spysats....   :scratch:

Offline Trash Can Man

  • Members
  • *
  • We are no longer the knights who say "Ni!"
Re: Flag Change/Zone Captured script
« Reply #9 on: 19 Mar 2007, 21:18:46 »
I tried the links as well and got garbage. I also tried right clicking save target as ans all I got was an HTML page  ???


TCM

Offline norrin

  • Tutorial Writer
  • **
Re: Flag Change/Zone Captured script
« Reply #10 on: 19 Mar 2007, 22:21:30 »
PM me your email address and I'll send you the files :)

EDIT: Files sent
« Last Edit: 20 Mar 2007, 23:29:07 by norrin »

Offline Ruffneck

  • Members
  • *
Re: Flag Change/Zone Captured script
« Reply #11 on: 22 Mar 2007, 08:42:56 »
Hi again,

Any news on the points thing??

I saw a thing called addrating 2000, could that be used to define points?

Can triggers cause performance issues?

I edited sector control and merged just the flags and triggers into my map which comes with flag change/capture and points. But when I test the map in editor, my pc lags soooo much. AMD 3800+, 7600 GS, 2GB RAM.

The bulk of the new stuff is all the triggers defining points, I dont have AI following waypoints or anything...Works fine with just the flag change stuff which works. It the triggers that cause pain.
I just want to make it so that your side gets 2 points for every minute you own the flag...  :blink:

Does anyone have any experience with points or capture???   :confused:
« Last Edit: 29 Mar 2007, 09:52:02 by RUFF-NEK_2-0 »

Offline Rambo16AAB

  • Members
  • *
Re: Flag Change/Zone Captured script
« Reply #12 on: 11 Apr 2007, 20:30:53 »
Hi.

Im trying to use this script in a multiplayter map. Im having issues with  OPFOR  capturing flags. I can only get them to trigger the capture after   the US force first capture them.  Ive changed the starting flag texture in the script to a neutral flag ( not US or OPFOR ).  What am I missing ????

Offline norrin

  • Tutorial Writer
  • **
Re: Flag Change/Zone Captured script
« Reply #13 on: 20 Apr 2007, 11:56:24 »
Flag Change/Zone Captured script.

New features: Neutral flag at start and works fully with JIP (20th April 2007)

This is a revised version of the original script.  The flag now starts out with a neutral texture and can be captured by either side on multiple occasions from the outset of the mission. 

The system uses HAILO's onplayerConnected script to give a joining player the current flag and zone states and the flag change scripts have now been rewritten in sqf format.

Demo mission
You can down load a zip file with a simple mission from here.  The mission contains four zones that can be captured.

Mission Contents
Mission.sqm (contains triggers that activate the flag_capture.sqs)
Init.sqf (runs mission_start.sqs that defines the global variables and gets the variables for joining players and HAILO's JIP script)
description.ext (defines sounds)

There are also five folders that contain scripts needed for the flag change, these folders are:
Flag_capture, flags, scripts, sounds and events.

To Implement:
For four zones/flags, as in the example mission, you'll need to copy all five folders into your mission directory as well as the info contained in the description.ext and the init.sqf file.  In addition, you'll need to add eight triggers (two for each zone/flag ie. one for west and one for east for each flag) and copy across the trigger expCond, expActiv as written in the mission.sqm.  Next add four flags named flag_E1 to flag_E4 and eight markers to define sector flags and sector regions - once again use the accompanying mission as a guide.
 
Description of Scripts
It is a script that triggers upon an area being captured and changes the flag to that of the capturing team. In addition, the zone colour on the map changes to reflect the controlling team - thanks to Wedge for this feature (see below).

These flag change/zone captured triggers are activated using the seizedBy trigger.

For the sake of testing the triggers at each flag are slightly offset so you can find them in the example mission but you'd want to superimpose them directly on top of each other in your missions.

This script also allows the flag's textures to change back and forth as the different sides get control of the zones.

Game Version tested on
1.05.   Tested on a dedicated server with multiple players and works with JIP.

Special thanks to Wedge from IC-ArmA (http://www.ic-arma.com/) for writing the demo mission, adding the zone capture markers and pushing me to get this finished :).   

Offline ViperMaul

  • Members
  • *
    • Theatre Of War (Team PvP Campaign)
Re: Flag Change/Zone Captured script
« Reply #14 on: 15 May 2007, 03:27:02 »
Can triggers cause performance issues?

I edited sector control and merged just the flags and triggers into my map which comes with flag change/capture and points. But when I test the map in editor, my pc lags soooo much. AMD 3800+, 7600 GS, 2GB RAM.

The bulk of the new stuff is all the triggers defining points, I dont have AI following waypoints or anything...Works fine with just the flag change stuff which works. It the triggers that cause pain.
I just want to make it so that your side gets 2 points for every minute you own the flag...  :blink:

Does anyone have any experience with points or capture???   :confused:
RUFF-NEK_2-0,
Or anyone else. I would like to know if anyone that has observed trigger lag if they could either send me their mission or run it through this technique and let us know if its successful it eliminating lag.
Exploding Triggers- a way to reduce lag in your mission
Thanks


ViperMaul
Theatre of War (Co-Lead Dev)
ACE (Jr Project Manager)