Forum Jump :

Author Message

Posts: 4

Level: Member

Country: uk
Location: United Kingdom
Occupation: Creator of RGO
In-game name:

#1 Posted at 2013-02-18 10:11        

I have been trying to make a script that will simply spawn enemies and the objective marker upon server start.

What I have so far is 2 markers on the map called "loc1" and "loc2" (without ""). What I want the script to do is to select one of those markers randomly, spawn the enemies and create a marker there for the objective.

This is what I have so far:

This however is not working. It is a simple script and in theory should work but right now nothing happens. I call on the script via a radio trigger at the moment, just for a test and still nothing happens.

Please can someone help me on this, or at least send me a mission that already implements this idea so that I can learn how it works.



Author Message

Posts: 1515

Level: Member

Country: uk
In-game name:

#2 Posted at 2013-02-18 13:18        
You seem to have a few of errors.
using getpos instead of getmarkerpos
The wrong side and names.
createMarker needed a placement position.

You will also need one unit of that side place on the map, you can set it to probability of presence 0.

_randomTown = ["loc1","loc2"] call BIS_fnc_selectRandom;
	_enemy = [getmarkerPos _randomTown, resistance, (configFile >> "CfgGroups" >> "Guerrila" >> "BIS_TK_GUE" >> "Infantry" >> "TK_GUE_Group")] call BIS_fnc_spawnGroup; 
		_marker = createMarker ["townActive",getmarkerPos _randomTown];
			//_marker setMarkerPos (getMarkerPos _randomTown);
			_marker setMarkerBrush "SOLID";
			_marker setMarkerColor "ColorRed";
			_marker setMarkerShape "ELLIPSE";
			_marker setMarkerSize [500, 500];

Tags: Ao, Random, Script, Spawn