NFG WhatHiMean 0 Posted October 30, 2023 I am trying to spawn in preset mini missions on mission start using the script from this post I'm not %100 I set this up correctly but I followed the instructions as best as I could and I wasn't able to get it working. This is more complicated then the stuff I've been doing so far and I'm still learning so sorry for any dumb questions. I've also looked at this post which is basically what I want, I found the post above from here Anyways on to my actual issues, I get this error loading the mission in the editor saying Spoiler mpmissions\missionname\compositions\compositions.cfg, line 0: /: ' ' encountered instead of '{' This is the relating .cfg file class CfgCompositions { class ArtyMission { spawnartymission #include "spawnartymission.sqe" }; }; I'm not much of a scripter so I followed what larrow said in their post but clearly I don't know what I'm doing here This is how I'd like to use the function in my own script, real simple, I just want to pick a random marker and then spawn the composition on said marker one time. I made and run a mission in a pvp scenario with some friends who memorize and prioritize targets like, the enemy artillery. So unless I can make it dynamic enough to change spawn locations the balancing of the mission is fucked up in two or three runs. Spoiler private _ArtySpawnMarkers = [ "arty_spawn_marker", "arty_spawn_marker_1", "arty_spawn_marker_2", "arty_spawn_marker_3", "arty_spawn_marker_4", "arty_spawn_marker_5", "arty_spawn_marker_6" ]; private _artmarker = selectRandom _ArtySpawnMarkers; ["spawnartymission", _artmarker, 0, 0, true, true] call LARs_fnc_spawnComp; _spwndArt = _spwndArt + 1; I have read through the posts multiple times and read through every comment to see what issues other people have had and found nothing that worked for me. Any help would be greatly appreciated as this seems to be the only way to spawn in things like triggers or modules with all settings intact and functioning. I've looked around online for a while now and I can't find a way to spawn in compositions while keeping data like trigger settings, not just object variable names and similar simple data. Thanks in advance! To make sure I have the install correct, these are the other files larrow had me add/change description.ext Spoiler class CfgFunctions { #include "LARs\spawnComp\functions\functions.cpp" }; #include "compositions\compositions.cfg" The full LARs\spawnComp\functions\ file structure with all the fn_~~~.sqf files and other nested files. All of this is placed in the root mission folder and should be in place according to larrows post Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 without digging deep into your entire mission, this part is incorrect: Spoiler class CfgCompositions { class ArtyMission { spawnartymission #include "spawnartymission.sqe" }; }; and should be: Spoiler class CfgCompositions { class ArtyMission {// spawnartymission #include "spawnartymission.sqe" }; }; with // in front of spawnartymission Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 1 minute ago, panther42 said: without digging deep into your entire mission, this part is incorrect: Reveal hidden contents class CfgCompositions { class ArtyMission { spawnartymission #include "spawnartymission.sqe" }; }; and should be: Reveal hidden contents class CfgCompositions { class ArtyMission {// spawnartymission #include "spawnartymission.sqe" }; }; with // in front of spawnartymission Tyty like I said in the op I'm not a very good scripter, so if you'd explain why do I need the //? Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 // is a comment line, and is not read. Just as @Larrow instructed in his thread: Spoiler //LARs_spawnComp_debug = 1; //1 = RPT output, 2 = RPT output and ingame visual positioning info class CfgCompositions { class Walk { //Name that the composition is spawned by #include "walk.sqe" //Renamed composition.sqe }; }; Here is a bit more on Class Inheritance Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 so just from starting the mission I get both of these errors Spoiler & Either I messed up the marker placement OR the script itself is broken IDK 😕 Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 Did you try entering by the Class you defined? class ArtyMission Otherwise, I'd stick to naming the class the same as the .sqe as Larrow did Share this post Link to post Share on other sites
JCataclisma 80 Posted October 30, 2023 3 minutes ago, NFG WhatHiMean said: Hide contents Either I messed up the marker placement OR the script itself is broken IDK 😕 Similar to //comments, which will "end" at the end of the line, you can have /*/ comments /*/ or /* comments * / . Meaning, if you have more things to comment or to write that are NOT part of the code, you can add all that stuff inside /* ..... */ or /*/ .... /*/ . In your case up there, it's very likely "Grab data... " is part of a comment (note the /* before it), and if so it's probably missing its closure */ . Such things you can track more easily when you realize the game will add a symbol # right before the error it detects. Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 2 minutes ago, panther42 said: // is a comment line, and is not read. Just as @Larrow instructed in his thread: Hide contents //LARs_spawnComp_debug = 1; //1 = RPT output, 2 = RPT output and ingame visual positioning info class CfgCompositions { class Walk { //Name that the composition is spawned by #include "walk.sqe" //Renamed composition.sqe }; }; Here is a bit more on Class Inheritance I see, the commented out "Name that the composition is spawned by" confused me, reading it again it makes more sense lol. When I go to call the spawn function I use the class name "ArtyMission" in this case right? Spoiler private _ArtySpawnMarkers = [ "arty_spawn_marker", "arty_spawn_marker_1", "arty_spawn_marker_2", "arty_spawn_marker_3", "arty_spawn_marker_4", "arty_spawn_marker_5", "arty_spawn_marker_6" ]; private _artmarker = selectRandom _ArtySpawnMarkers; ["ArtyMission", _artmarker, 0, 0, true, true] call LARs_fnc_spawnComp; Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 1 minute ago, JCataclisma said: Similar to //comments, which will "end" at the end of the line, you can have /*/ comments /*/ or /* comments * / . Meaning, if you have more things to comment or to write that are NOT part of the code, you can add all that stuff inside /* ..... */ or /*/ .... /*/ . In your case up there, it's very likely "Grab data... " is part of a comment (note the /* before it), and if so it's probably missing its closure */ . Such things you can track more easily when you realize the game will add a symbol # right before the error it detects. Ty I'll try and track it down then and find the specific issue Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 2 minutes ago, panther42 said: Did you try entering by the Class you defined? class ArtyMission Otherwise, I'd stick to naming the class the same as the .sqe as Larrow did Ty, ngl I was high when I was first looking into this so half of what I have was written / researched by high me lmao Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 _compReference = [ COMP_NAME, POS_ATL, OFFSET, DIR, ALIGN_TERRAIN, ALIGN_WATER, IGNORE_ATLOFFSET ] call LARs_fnc_spawnComp; Use the private variable _compReference, or something of your choice, because Larrows code is built to return: "The function call will also return a reference string for the composition. Which can be used with some of the provided utility functions." Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 New error, I did check my description.ext and it should be defined as a function not sure why it can't see that tho Spoiler Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 Just now, panther42 said: _compReference = [ COMP_NAME, POS_ATL, OFFSET, DIR, ALIGN_TERRAIN, ALIGN_WATER, IGNORE_ATLOFFSET ] call LARs_fnc_spawnComp; Use the private variable _compReference, or something of your choice, because Larrows code is built to return: "The function call will also return a reference string for the composition. Which can be used with some of the provided utility functions." Ahh interesting alright, ty Share this post Link to post Share on other sites
JCataclisma 80 Posted October 30, 2023 5 minutes ago, NFG WhatHiMean said: Ty I'll try and track it down then and find the specific issue By a fortunate coincidence, we have just talked about notepad++ in another topic today, so I also ask: are you using a software like it for your code/tests, or just regular notepad/wordpad? Because when in Notepad++ (or any other script software), if you activate a language like C++, it will instantly show you everything that might be considered CODE or COMMENT 😉 Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 Just now, JCataclisma said: By a fortunate coincidence, we have just talked about notepad++ in another topic today, so I also ask: are you using a software like it for your code/tests, or just regular notepad/wordpad? Because when in Notepad++ (or any other script software), if you activate a language like C++, it will instantly show you everything that might be considered CODE or COMMENT 😉 Yeah, I've been using notepad++ for a few years now with my on/off coding experience. I only recently got into the scripting side of arma mission making, so I defined the sqf language for ++ and it seems to be working well. Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 5 minutes ago, NFG WhatHiMean said: New error, I did check my description.ext and it should be defined as a function not sure why it can't see that tho Hide contents ok, what is on line 7 of artymissionspwn.sqf? Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 Just now, panther42 said: ok, what is on line 7 of artymissionspwn.sqf? Spoiler private _ArtySpawnMarkers = [ "arty_spawn_marker", "arty_spawn_marker_1", "arty_spawn_marker_2", "arty_spawn_marker_3", "arty_spawn_marker_4", "arty_spawn_marker_5", "arty_spawn_marker_6" ]; private _artmarker = selectRandom _ArtySpawnMarkers; ["spawnartymission.sqe", _artmarker, 0, 0, true, true] call LARs_fnc_spawnComp; <--- Line 7 Here _spwndArt = _spwndArt + 1; Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 That line should include your class defined... private _compReference = [ ArtyMission, _artmarker, 0, 0, true, true] call LARs_fnc_spawnComp; Also, your parameters do not align correctly with what Larrow mentioned: Spoiler COMP_NAME - Classname given to composition in CfgCompositions POS_ATL( optional, default compositions saved position ) - Position to spawn composition If not given or empty array passed then original saved composition position is used Also accepts OBJECT, MARKER, LOCATION OFFSET( optional, default none ) - ARRAY [ x, y, z ] ammount to offset composition, as a compositions base pos can vary from what you want when its saved DIR( optional, deafault 0 ) - Direction to face composition in, If POS_ATL is of type OBJECT, MARKER, LOCATION passing TRUE for direction will use objects direction ALIGN_TERRAIN( optional, default True ) - BOOL, Whether composition objects should align themselves to their positions surface normal ALIGN_WATER( optional, default True ) - BOOL, If a composition objects position is over water should they align themselves to sea level IGNORE_ATLOFFSET( optional, default False ) - BOOL, If True each item in the composition will ignore its ATLOffset that usually gets added to its Z(height) Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 3 minutes ago, panther42 said: That line should include your class defined... private _compReference = [ ArtyMission, _artmarker, 0, 0, true, true] call LARs_fnc_spawnComp; Ty I have changed to that however once I tried the mission I received this error Spoiler Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 2 minutes ago, NFG WhatHiMean said: Ty I have changed to that however once I tried the mission I received this error Hide contents This is a snippet of code where the error is at Spoiler //Get position of a MARKER case ( _compPos isEqualType "" && { getMarkerPos _compPos != [0,0,0] } ) : { if ( _compRot isEqualType true ) then { _compRot = markerDir _compPos; }; _compPos = ATLToASL getMarkerPos _compPos; }; I am using empty markers, could that be a issue? Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 26 minutes ago, panther42 said: Also, your parameters do not align correctly with what Larrow mentioned: Reveal hidden contents COMP_NAME - Classname given to composition in CfgCompositions POS_ATL( optional, default compositions saved position ) - Position to spawn composition If not given or empty array passed then original saved composition position is used Also accepts OBJECT, MARKER, LOCATION OFFSET( optional, default none ) - ARRAY [ x, y, z ] ammount to offset composition, as a compositions base pos can vary from what you want when its saved DIR( optional, deafault 0 ) - Direction to face composition in, If POS_ATL is of type OBJECT, MARKER, LOCATION passing TRUE for direction will use objects direction ALIGN_TERRAIN( optional, default True ) - BOOL, Whether composition objects should align themselves to their positions surface normal ALIGN_WATER( optional, default True ) - BOOL, If a composition objects position is over water should they align themselves to sea level IGNORE_ATLOFFSET( optional, default False ) - BOOL, If True each item in the composition will ignore its ATLOffset that usually gets added to its Z(height) Adjusted to _compReference =["ArtyMission", _artmarker, [], true] call LARs_fnc_spawnComp; Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 (edited) You can't skip parameters. Try like this (if you want ignore_atloffset to be true? Your last parameter is true) private _compReference =["ArtyMission", _artmarker, [0,0,0], 0, true, true, true] call LARs_fnc_spawnComp; I should clarify the above. You can't skip if something you want to change is not the default. I have no clue what your ending true is for. You could just have the following if you do not want to change anything past the position: private _compReference =["ArtyMission", _artmarker] call LARs_fnc_spawnComp; Edited October 30, 2023 by panther42 clarification Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 5 minutes ago, panther42 said: You can't skip parameters. Try like this (if you want ignore_atloffset to be true? Your last parameter is true) private _compReference =["ArtyMission", _artmarker, [0,0,0], 0, true, true, true] call LARs_fnc_spawnComp; Larrow says everything other name the name is optional so apart from the incorrect formatting of offset I thought I was good. Not sure why ignore atloffset was true too Still getting this error, can't tell if it's a issue on my part or the script (probably me tho) Spoiler Share this post Link to post Share on other sites
panther42 52 Posted October 30, 2023 2 minutes ago, NFG WhatHiMean said: Larrow says everything other name the name is optional so apart from the incorrect formatting of offset I thought I was good. Not sure why ignore atloffset was true too Still getting this error, can't tell if it's a issue on my part or the script (probably me tho) Reveal hidden contents This is true, but the composition will be spawned at the coordinates WHERE IT WAS CREATED (someone created this at some place on the map) These markers are placed in the editor and named as you have given? 2 hours ago, NFG WhatHiMean said: private _ArtySpawnMarkers = [ "arty_spawn_marker", "arty_spawn_marker_1", "arty_spawn_marker_2", "arty_spawn_marker_3", "arty_spawn_marker_4", "arty_spawn_marker_5", "arty_spawn_marker_6" ]; Share this post Link to post Share on other sites
NFG WhatHiMean 0 Posted October 30, 2023 27 minutes ago, panther42 said: This is true, but the composition will be spawned at the coordinates WHERE IT WAS CREATED (someone created this at some place on the map) These markers are placed in the editor and named as you have given? Yes, the markers are just like this, only change is name and placement around the map Spoiler Share this post Link to post Share on other sites