Jump to content
Sign in to follow this  
wolffy.au

cB Random Group Demo - v2.0

Recommended Posts

http://creobellum.org/node/160

Download:

cB Random Group Demo(6kB)

This mission is to demonstrate the use of the random group script which includes random spawning of Infantry, Motorised, Mechanised and Armoured groups.

screenshot_7.jpg

Specific factions or sides can be optionally specified. Use the radio commands for teleport and camera functions.

Created by: (AEF)Wolffy.au [2CAV] & (AEF)Odin [2CAV]

Usage:

To use it, put the following in the INIT line of Game Logic objects:

Default EAST side any faction:

call {[position this, "Infantry"] execVM "crB_scripts\crB_randomGroup.sqf";};

Where "Infantry" can be "Infantry", "Motorized", "Mechanized", "Armored" or "Air".

Specific side any faction:

call {[position this, "Infantry", resistance] execVM "crB_scripts\crB_randomGroup.sqf";};

Where resistance can be east, west, resistance or civilian.

Specific faction:

call {[position this, "Infantry", "ACE_USARMY"] execVM "crB_scripts\crB_randomGroup.sqf";};

Where "ACE_USARMY" can be any valid faction including those from add-ons.

Specific factions:

call {[position this, "Infantry", ["ACE_USARMY_DESERT", "ACE_USMC_DESERT"]] execVM "crB_scripts\crB_randomGroup.sqf";};

Where the array can contain any number of valid factions including those from add-ons.

If the group is not spawning, it maybe due to a lack of AI Centre. Place a unit of the same side into the editor to initialise.

Change Log:

Version v2.0

- Added optional faction selection

- Added random East faction selection by default

- Added wait for ACE initialisation

- Removed RADIUS parameter to simplify component (taskPatrol/taskDefend)

Version v1.0 - Initial Release

Thanks to:

Random Group Spawn code by Odin

Visit us a http://creoBellum.org

Developer notes:

Here is a list of nifty components to be found in this mission.

Random Group Spawn code by Odin

- This piece of code has turned out to be the most important piece of my future mission making. Using GameLogic objects, this code will spawn random enemy groups of Infantry, Motorised, Mechanised, Armour and Air. In conjunction with Binesi's taskDefend and taskPatrol code, randomised mission making has never been simpler.

Edited by Wolffy.au

Share this post


Link to post
Share on other sites

I love your scripts and use them in future on my missions.Thx for this nice script!

Put it on our scripts section at Assault Mission Studio.

dlicon.gif

Random Group [2.0] by Wolffy.au

Share this post


Link to post
Share on other sites

Thanks for the update :yay:

One silly question, how can i use Binesi's taskDefend and taskPatrol scripts after this release ?

Thanks for any answer, pls forgive, my poor English :)

Share this post


Link to post
Share on other sites
One silly question, how can i use Binesi's taskDefend and taskPatrol scripts after this release ?

Yes, its a good question.

I'm releasing crB_taskPatrol.sqf and crB_taskDefend.sqf to address this. The reason for the change is two reasons:

(1) crB_randomGroup.sqf maybe submitted to another project simply for the creation of random groups. If I leave Binesi's code in there, its not relevant to the function of group creation.

(2) crB_taskPatrol.sqf and crB_taskDefend.sqf are somewhat redundant in their current format. They simple isolate patrol and defend incase I want to change the patrol/defend method in the future (e.g. CBA or BIS), without having to change all coding references. This is why I am now changing them to be the method to use Binesi's code. (does that make sense?)

I hope that explains the change and apologies for those that have heaps of missions using the old method, hopefully there won't be major changes like this again for a long time.

Share this post


Link to post
Share on other sites

Hi Wolffy,

Is there a way to get Lingor Untis into the armour , as it looks silly when they jump out and they are not the same units as the rest on my map ?

Thanks

Share this post


Link to post
Share on other sites
Hi Wolffy,

Is there a way to get Lingor Untis into the armour , as it looks silly when they jump out and they are not the same units as the rest on my map ?

Thanks

If i've understood your question correctly, you might want to ask Icebreakr if he can create you some Armour groups that show in the Editor, as that is where the script gets its configurations from.

Share this post


Link to post
Share on other sites

how di I get units to spawn? Ive added a Game Logic Unit and in the INIT section I put

call {[position this, "Infantry"] execVM "crB_scripts\crB_randomGroup.sqf";};

and made sure to add the lines contained in the INIT.sqf file into the INIT.sqf of the mission im making. But nothing happens, ive added some units.

I am a bit of a noob but managed to get a Helicopter script to work perfectly as support for my guys, I just cant seem to get this random script to work.

PS I would run the example mission to see how its done but I get a message saying I cannot edit it because I dont have the correct units.

Share this post


Link to post
Share on other sites

Do you have one unit of the side you are trying to spawn placed in the editor?

Share this post


Link to post
Share on other sites

yes ive got a few infantry place of the same side on the map. Truth is I dont really know what to do with it, i tried everything in the readme, but I never get any random spawns :confused:

Share this post


Link to post
Share on other sites

awsome script Wolffy

ive got a question about it how can i spread out the spawn zone see i am calling this by a trigger becouse i have it connected to multiple random missions so when the mission marker is created the trigger spawns the corrosponding units.

in my trigger

{[getMarkerPos _x, "infantry", INS] execVM "crb_scripts\crB_taskDefend.sqf";} forEach ["mrkTaskMM1"];

but when i place say 3 triggers (each one different class) around the marker that they will spawn on,

they all spawn on top of each other.

Share this post


Link to post
Share on other sites
awsome script Wolffy

ive got a question about it how can i spread out the spawn zone see i am calling this by a trigger becouse i have it connected to multiple random missions so when the mission marker is created the trigger spawns the corrosponding units.

in my trigger

{[getMarkerPos _x, "infantry", INS] execVM "crb_scripts\crB_taskDefend.sqf";} forEach ["mrkTaskMM1"];

but when i place say 3 triggers (each one different class) around the marker that they will spawn on,

they all spawn on top of each other.

If you put that in 3 triggers you will get 3 lots of enemy spawning on "mrkTaskMM1" because that is what you are telling it to do. To spread the area out you need more than 1 marker and only 1 trigger.

{[getMarkerPos _x, "infantry", [color="#FF0000"]"INS"[/color]] execVM "crb_scripts\crB_taskDefend.sqf";} forEach ["mrkTaskMM1","mrkTaskMM2","mrkTaskMM3"];

If you put that in 1 trigger it will spawn enemy on each of the 3 markers. (NOTE - You need the INS in quotes "")

---------- Post added at 02:12 AM ---------- Previous post was at 01:01 AM ----------

While testing this for hogmason I noticed it would not spawn BAF groups?

waitUntil {!isNil "bis_fnc_init"};
grp1 = [getMarkerPos "spawn1", West, (configFile >> "CfgGroups" >> "West" >> "BIS_BAF_MTP" >> "Infantry" >> "BAF_Fireteam_MTP")] call BIS_fnc_spawnGroup;

That works. But this in your example mission doesn't?:

0 = [position this, "Infantry","BIS_BAF_MTP"] execVM "crB_scripts\crB_taskDefend.sqf";

Have I got something wrong or did the configs change with the DLC? I have tried BIS_BAF and "BAF_Fireteam_MTP". Side centre is created with AI 0% probability.

A problem is discussed here:

http://forums.bistudio.com/showthread.php?119184-BAF-cfgGroups-not-working-with-BIS_fnc_spawnGroup-SOLVED&p=1932338#post1932338

Edited by PELHAM

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×