OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Shashman on 21 Jan 2004, 17:43:21
-
OK here's my situation ??? :
I want to make a mission, where East have to defend a point, and West have to 'take it'. What I had in mind was that, every 20 seconds that a West soldier is in the zone, a point is scored (perhaps allow this to be admin controlled, the scoring interval,like 20 seconds, 30, seconds, etc...)
I want it so that at the set score limit, the game ends (admin can choose the score limit)
I'm also trying to figure out a way for East to win.
The mission will use the MTCO addon pack, so West are Desert MARPAT marines, and East are Desert Naval Infantry.
Right now, all I have it set up as, is a trigger, the size of the zone which needs to be captured, and when a West soldier is in this trigger, the game ends and West win. As you can imagine, not very fun, as a sneaky soldier could simply just sneak into the zone and end the mission.
Please give me your tips, as I think this could be a pretty fun mission :)
Ah nearly forgot; I'd also like the admin to be able choose the time of day, (dawn, mid-day, dusk, night) just to add more variety ;)
-
Anybody? :'(
Pleeease?? :'(
-
Ok I'm not the greatest scriptor in the world but maybe, just maybe the game ends by when all the good ppl are at the multi menu, it says set end score or something similiar, that might work as an ending score for ya.
On how east can win. Maybe they have to hold this point for say 20 minutes or something. If you have resistance check out the multiplayer mission scud hunt or something weird like that where west must destroy scud and east must defend it for "x" amount of minutes. :)
-
Basically this is an Attack & Defend mission, so the first thing youn want to do is find one, dissasemble it using a de pbo program that you can find on this website and see how they do things
second thing is you will need either
1) a looping script that looks to see if a west player is within a trigger area and if he is add a score every X loops
or
2) A repeating trigger with a condition timer that is activated when the condition has been met after X seconds
something on the lines of
_______________________________________________________
Trigger
Trigger name "Defend_zone"
Repeating:
leave the rest of the trigger in its default state, activated by anybody
_______________________________________________________
Init.sqs entries
[]exec "Monitor.sqs"
Wscore = 0
AtScore = X (X = the number of seconds that you want it to loop before you add the score (More info later in post))
____________________________________________________
script would be server side only
eg create a gamelogic, name it "Server" and use the ?!(local server):
;;Monitor.sqs
?!(local server):exit
#START
~1
?(WEST countside list Defend_zone > 0):goto "SCORING"
goto "START"
#SCORING
_count = 0
#SCORELOOP
~1
?(WEST countside list Defend_zone== 0):goto "START"
?(count == ScoreAt):Wscore = Wscore + 1;_count = 0; Publicvariable "Wscore
goto "SCORELOOP"
What basically happens is
1) The script runs in the #START loop until a west player is within the trigger area of trigger "Defend_Zone"
When this occurs, the script then jumps to #Scoring, where it sets a counter to "0"
It then jumps into the #SCORELOOP
Scoreloop runs every second
First thing it does is make sure west is still in the "Defence_Zone"
If he is , it simply loops until
either
West is no longer in the Defence_Zone , inwhich case it jumps back to the #START
or
the _counter value, which indicated how many times (Seconds) it has looped, gets to the value ScoreAt
When this value has been reached, the server adds a point to WScore, resets the _counter to "0" and off it goes again
___________________________________________________________________
As far as selecting the value "ScoreAt" as a Pre-game option, you would have to use the Param1 or Param2 boxes as defined in the description.ext
and then use the following line in your init.sqs
ScoreAt = Param1
or
ScoreAt = Param2
Param1 is by default used for gamelength
Param2 is by default used for Score limit
how you set these Description.Ext entries up and use them is dependant on whether you use the Excel Spreadsheet values or not
____________________________________________________________________
How will East win???
You could require west to have a Minimum Wscore value for them to win, and if they dont, East wins
Eg ?(Wscore >= X): do whatever you want to run the West wins scenario
or
?(Wscore < X): do whatever you want to run the East wins scenario
that should be enough for now, when you have done that, come back and ask something more specific
Generalised questions like
"How do i create a CTF, please do it for me", wont get much of a response m8
questions like
"How do i place a russian flag on a flagpole", do get answered
so the more specific your question, the better the answer
Also if the question you have asked, have solved your problem, please close the post by clicking "Solved" or whatever the selection is