Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Scripts for Mission Creating by SaOk

  1. #1
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,342

    Scripts for Mission Creating by SaOk

    During creating missions for few years, I have made quite many scripts that maybe could be usefull for someone. For start, these scripts are mostly for single-player missions only. I will add time to time, more and more scripts to this thread (I hope they all fit in this first post). Use and modify these freely.

    EDIT (4th May 2013): New download link with all SP Stuff. I have lost the MP Versions:
    https://www.dropbox.com/s/n8jc7ayyf7...ScriptsSaOK.7z


    Resources for scripting/editing
    FSM editor:
    http://community.bistudio.com/wiki/FSM_Editor
    Scripting Commands
    http://community.bistudio.com/wiki/C...Commands_ArmA2
    Classnames:
    http://forums.bistudio.com/showthrea...t=73241&page=2

    First, usefull tools to copy positions
    Scriptname: Copypos.sqs
    Description: Copies player 3d position to clipboard for use in scripts
    How to use: Add this code to player init and use action ingame
    this addaction ["copypos","copypos.sqs"];
    Notes: You can copy only one 3d position at time. The position is array from and looks like this [32133.342,1123.22,0]
    Download:
    http://www.gamefront.com/files/20415721/copypos.sqs

    Scriptname: Copyposmap.sqs
    Description: Copies clicked map position to clipboard for use in scripts
    How to use: Add this code to player init, use the action once ingame and click map to copy position:
    this addaction ["copyposmap","copyposmap.sqs"];
    Notes: Quicker to use than the copypos.sqs. You can of course alt-tab between game and desktop to paste position for script before copy new position again from map.
    Download:
    http://www.gamefront.com/files/20415722/copyposmap.sqs

    The Scripts

    EDIT (30.6):- I found out that you can get position of the trigger with (position thisTrigger) that makes it much faster to use the ambient scripts while you can just copy&paste the same trigger and life spawns to those locations. (Thanks for Xenogf and Celery)

    Ambient Civilians:
    Spawns civilians around wanted position when player is near and later delete them, when player is away
    Notes:
    -Spawns only Takiban civilians (Unless you edit the FSM file)
    -Made for good performance so spawning happens quite near and its possible that player sees spawning from far
    Requirements:
    Functions module and one civilian unit on map
    To use, create a repeatedly activated trigger with:
    Condition: ((position thisTrigger) distance player < 400)
    On Activation: _nul = [(position thisTrigger), 200, 7, 70] execFSM "AmbientCivilians.FSM";
    Description:
    The example spawns 7 civilians that are all inside 200m radius from the trigger position. Never a civilian is spawned under 70m away from player. Distance in condition must be 400. The spawn radius needs to be lower than it. And the min distance lower that spawn radius.
    Download:
    http://www.gamefront.com/files/20415...tcivilians.fsm

    For MP:
    Spoiler:

    Download:
    http://www.gamefront.com/files/20415...iviliansMP.fsm

    Ambient Patrol:
    Spawns enemy patrol group (every (40 + (random 40) seconds) around wanted position when player is near and later delete them, when player is away.
    Notes:
    -Spawns only Takibans (Unless you edit the FSM file) with EAST as side
    -Made for good performance so spawning happens quite near and its possible that player sees spawning from far
    Requirements:
    Functions module and one enemy unit on map
    To use, create a repeatedly activated trigger with:
    Condition: player distance (position thisTrigger) < 400
    On Activation: _nul = [(position thisTrigger),400,[2,3]] execFSM "ambientpatrol.fsm";
    Description:
    The example spawns 2-3 men enemy groups.
    Download (Includes two required scripts):
    http://www.gamefront.com/files/20416...bientPatrol.7z

    For MP:
    Spoiler:

    Download:
    http://www.gamefront.com/files/20416...entPatrolMP.7z

    Ambient Criminals:
    Spawns small armed enemy criminal group (every (40 + (random 40) seconds) (5 groups max total) around wanted position when player is near and later delete them, when player is away.
    Notes:
    -Spawns only Takibans (Unless you edit the FSM file) with EAST as side
    -Made for good performance so spawning happens quite near and its possible that player sees spawning from far
    Requirements:
    Functions module and one enemy unit on map
    To use, create a repeatedly activated trigger with:
    Condition: player distance (position thisTrigger) < 400
    On Activation: _nul = [(position thisTrigger),200,[1,2]] execFSM "ambientcriminal.fsm";
    Description:
    The example spawns 1-2 men criminal groups.
    Download (Includes three required scripts):
    http://www.gamefront.com/files/20416...ntCriminals.7z

    For MP:
    Spoiler:

    Download:
    http://www.gamefront.com/files/20416...CriminalsMP.7z

    Ambient Animals:
    Spawns animals around wanted position when player is near and later delete them, when player is away
    Notes:
    -Made for good performance so spawning happens quite near and its possible that player sees spawning from far
    To use, create a repeatedly activated trigger with:
    Condition: ((position thisTrigger) distance player < 400)
    _nul = [(position thisTrigger),100,14,["Cow01_EP1","Sheep01_EP1"],50] execFSM "ambientanimals2.fsm";
    _nul = [(position thisTrigger),15,9,["Hen","Hen","Hen","Hen","Cock"],5] execFSM "ambientanimals2.fsm";
    Description:
    The first example spawns 14 animals (randomly Cow or Sheep) that are all inside 100m radius from the trigger. Never a civilian is spawned under 50m away from player. Distance in condition must be 400. The spawn radius needs to be lower than it. And the min distance lower that spawn radius. The animal types that you want to spawn are listed in the array.
    Download (You need to unpack it - for some reason gamefront didnt like the raw FSM):
    http://www.gamefront.com/files/20415...entanimals2.7z

    For MP:
    Spoiler:

    Download:
    http://www.gamefront.com/files/20415...animals2MP.fsm

    Ambient Empty Cars:
    Spawns empty cilians cars over wanted invisible helipads using the direction of the object for the cars. Cars are then deleted when player is far, unless they are used.
    Notes:
    -Spawns only Takiban Vehicles (Unless you edit the FSM file)
    -Made for good performance so spawning happens quite near and its possible that player sees spawning from far
    To use, create a repeatedly activated trigger with:
    Condition: ((position thisTrigger) distance player < 400)
    On Activation: _nul = [(position thisTrigger),0,[o1,o2,o3],0] execFSM "ambientempcars.fsm";
    Description:
    (o1, o2...) are names of the invisible helipad objects. You can as many of them you like. Random vehicle is spawned over every of them. The two zeros have no effect. Leave them as zeros or some other number.
    Download:
    http://www.gamefront.com/files/20415...entempcars_fsm

    Chopper Transport:
    Bring spawned soldiers to the battlefield with a chopper transport.
    Requirements:
    At least one unit of the spawned side needs to be on map
    To use, launch the script like this:
    _nul = [[getpos start select 0, getpos start select 1, 50], position LZ1, position WayP1, EAST, 290, "Mi17_TK_EP1", 50,["TK_Soldier_SL_EP1","TK_Soldier_MG_EP1"],[0.6,0.7],1] execFSM "ChopperTransport.fsm";
    Description:
    At position start, the chopper and cargo is spawned. At position LZ1, soldiers eject (chopper return back to start for deleting), soldiers head to "position WayP1" where they guard. Next the side is set (could be EAST, WEST, RESISTANCE) which needs to match with the spawned classes. 290 is spawning direction which is important if you use planes. Then the chopper/plane class, then flying height (good to be somewhere 50 to 100). Then array of the spawned soldiers and their random skill range. If the last parameter is 1, more soldiers is brought until the chopper is destroyed. With 0 only one group is brought and chopper is deleted and starting pos.
    Download (Includes 2 required scripts):
    http://www.gamefront.com/files/20416...erTransport.7z

    Minefield Creating System:
    Allows player to select wanted team members and send them to build minefield with wanted specs. After job is done, the builder(s) return back to player's group. Only for SP
    Template Mission: http://www.gamefront.com/files/20737...te.Desert_E.7z

    More coming very soon!
    Last edited by SaOk; May 4 2013 at 09:54.

  2. #2
    Really nice script, thanks!

    All of this script is for sp. Any chance your ambient script become Mp friendly.

  3. #3
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,342
    Author of the Thread
    I have the ambient scripts working for MP in my coop mission. I will add them next.
    Last edited by SaOk; Jun 8 2011 at 13:25.

  4. #4
    Nice scripts Buddy!
    I especially Like the chopper script.. Its a nice way to do a "defend the area for x amount of time" kind of mission. I tweaked it a bit for MP and had C130's dropping crud loads of guys Against our Opfor fire team at intreval (Condition of no Opfor Present resulted in another wave of enemy troops)
    Gigabyte GA-X58A-UD3R | Intel Core I7 920 @ 4.38Ghz | 2x ATI Radeon HD5970 Crossifire | 10gb DDR3RAM | Koolance EXOS-2 LX Watercooler | 40" Sony Bravia LCD

  5. #5
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,342
    Author of the Thread
    Nope , I will add many times more scripts. But I need to tweak them first since many are really mission connected.

  6. #6
    Nice thanks for sharing
    I've started to learn/understand a little .sqf now I need to learn .fsm (oooh my head, meeediiic, héhé)
    Just tested the ChopperTransport.fsm but jumpout.sqf is missing.

  7. #7
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,342
    Author of the Thread
    Damn, I forgot that. I update that right away.

    The FSM scripting is very easy really. Very similar than SQF. With FSM you basically create tiggers in the script.

    Edit: Okay, its fixed now. Sorry
    Last edited by SaOk; Jun 8 2011 at 19:49.

  8. #8
    In your opinion, FSM gives better results than SQF or not ?
    Nice thank you
    Last edited by panda123; Jun 8 2011 at 19:55.

  9. #9
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,342
    Author of the Thread
    For complex structures FSM is much faster to use and tweak. But if you multiply scripts a lot then its better to use SQF, I believe (and heard something like that from experienced scripters). FSM count conditions all the time, with SQF you can use sleep. But for the light use (like have having less than 50 FSM scripts running at the same time) it is really good.

  10. #10
    FSM= Good for repeated frequent use (such as creating town defenders when x condition is met)

    SQF= Scripts you only want activated ocasionaly. Really you can use either in alot of situations, I personally prefer to stick to SQF for the most part it keeps the script side cleaner and easier to debug imho (since you know exactly why a script would be running)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •