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

Thread: BIS_fnc_spawnGroup script help

  1. #1

    Post BIS_fnc_spawnGroup script help

    Been playing arma OA for a while now but I'm only just starting to use scripting, I've looked at a few pages on scripting which seemed quite complex and watched a video on spawning units via script command. I copied the script to see if I could get it to work but it didn't, so i know it's something I've done because in the video it worked. I'm trying to spawn a unit via trigger script command, the script is;

    Name of file: SpawnCfgMethod.sqf which I put in ARMA2/missions/mission folder
    _TKgroup1 = [getmarkerpos "spawnpoint1", EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Group")] call BIS_fnc_spawnGroup;

    I did this script in arma edit as was recommended in the video and its an SQF file, in the trigger in the editor I put nul = execVM "SpawnCfgMethod.sqf";

    The trigger is activated when a civilian walks into the area, but when I play the mission and walk into the area nothing appears and no error messages come up...

    This is why I've avoided scripting for so long because I can't really get my head around it, if anyone could help and give me some clarity it would be much appreciated.

  2. #2
    Probably you are missing the Functions Module (Modules -> Functions).
    Proud community admin/member of The Tour of Teamrespawn

  3. #3
    Quote Originally Posted by neokika View Post
    Probably you are missing the Functions Module (Modules -> Functions).
    Ok I hadn't done that, so I added the module onto the map but the script still doesn't work, nothing spawns at the marker I placed "SpawnPoint1" when I walk into the trigger...

  4. #4
    It may be because the EAST side has not yet been created.

    Try this before you call the spawn function (Not needed if there are already units placed in the editor of side EAST):
    PHP Code:
    createCenter EAST

  5. #5
    I would say it is due to the fact that there might not be any OPFOR on the map already. If there isn't then place one down with a possibility of 0%. That's how I do every mission.

  6. #6
    Master Gunnery Sergeant Hellfire257's Avatar
    Join Date
    Feb 17 2009
    Location
    (getPosATL player)
    Posts
    1,207
    To further clarify, you cannot spawn a unit of a given side if they do not have a center. A center is created when you place a unit of the appropriate side down in the editor. In addition, it is possible to create a center using what neokika posted.

    See the description of the command here for more details.

  7. #7
    Ideal, I put a unit in the editor with 0% chance probability and it worked, however when using the createCentre EAST; do I put this in the trigger or in the SQF file? and is it simply createCentre EAST or do I put in this createCentre EAST...? But cheers for all the comments, helped a treat!!

  8. #8
    Master Gunnery Sergeant twirly's Avatar
    Join Date
    Sep 13 2010
    Location
    Gods Own (NZ)
    Posts
    1,302
    Quote Originally Posted by Kernow View Post
    ..... however when using the createCentre EAST; do I put this in the trigger or in the SQF file? and is it simply createCentre EAST or do I put in this createCentre EAST...?
    Create a file called "init.sqf" in your mission folder and put it in there. If that script is present it will be automatically executed at mission start and you can use it to sort out all the stuff that needs to be done before anything else happens. Weather, Time, CreateCenters etc... and you generally call your other scripts from this file to get the ball rolling.

    ---------- Post added at 10:28 AM ---------- Previous post was at 10:19 AM ----------

    Check this out.... just found it. It's about the init.sqf file. It may be of help. http://forums.bistudio.com/showthrea...78425-init-sqf

    "Learn by doing!" - Quoted from a post by Imutep

    OUTERRA - OUTERRA - OUTERRA - OUTERRA - BLOWMIND!

  9. #9
    I created a file called "init.sqf" and paste createCentre EAST in but it didn't work when I played the mission without an opfor unit at 0% chance probability. But just doing the 5% probability did work....and I can work with that, cheers again!!

  10. #10
    Master Gunnery Sergeant Hellfire257's Avatar
    Join Date
    Feb 17 2009
    Location
    (getPosATL player)
    Posts
    1,207
    Try assigning a variable to it, taking the example from the wiki:

    Code:
    _SideHQ = createCenter east;
    Not sure if that will change anything however.

Page 1 of 2 12 LastLast

Similar Threads

  1. BIS_fnc_spawnGroup
    By Koni in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 12
    Last Post: Sep 7 2011, 19:49
  2. How to specify the FACTION of BIS_fnc_spawnGroup?
    By kyfohatl in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 4
    Last Post: Oct 29 2010, 11:20
  3. Help with BIS_fnc_spawnGroup
    By tobmic in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Mar 3 2010, 13:48
  4. BIS_fnc_spawngroup won't do civilians
    By TRexian in forum ARMA 2 & OA - TROUBLESHOOTING
    Replies: 2
    Last Post: Nov 18 2009, 15:18
  5. BIS_fnc_spawnGroup
    By Provac in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 8
    Last Post: Jul 7 2009, 10:16

Posting Permissions

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