Jump to content
t-800a

[RELEASE] T8 Units - a less dynamic AI creator

Recommended Posts

On 15.4.2017 at 6:43 PM, CptDezusa said:

Hi sorry let me try this, im traing to find the AIs are spawned file ? in the fn folder 

 

Hi,

 

open the file ".../T8/fnc/fn_spawn.sqf" and search in line 380 to 400 for:

// Add a HIT event to all Units
_tmpUnit addEventHandler [ "Hit", { _this call T8U_fnc_HitEvent; } ];

you should be able to add your "killed" event there.

  • Like 1

Share this post


Link to post
Share on other sites

This works thank you, sorry for my late response. Do your script work whit the ASR AI 3 ?

Share this post


Link to post
Share on other sites

I was wondering how can i set up that if you fly helicopter or a plain the trigger zone won't trigger ?

Share this post


Link to post
Share on other sites

Hi so is it possible that if you fly a helicopter the trigger won't trigger, i have been reading her to find out if someone have asked it before but i can't find no on. In my mission you can fly helicopters to another objective but on the way you can pas some markers that have mission on it and i don't want them get trigger.

Share this post


Link to post
Share on other sites
12 minutes ago, CptDezusa said:

Hi so is it possible that if you fly a helicopter the trigger won't trigger, i have been reading her to find out if someone have asked it before but i can't find no on. In my mission you can fly helicopters to another objective but on the way you can pas some markers that have mission on it and i don't want them get trigger.

 

 

sth like this maybe?

// [ _unitsArray, _marker, _distance, _condition, _actSide, _actType, _actRepeat, _onAct, _onDeAct ] call T8U_fnc_TriggerSpawn;
[ "SpawnThisUnits", "Marker", 1000, "({ getPosATL _x select 2 < 100.0 } count thisList ) > 0", "WEST", "PRESENT", false, "", "" ] call T8U_fnc_TriggerSpawn;

 

Share this post


Link to post
Share on other sites

// [ _unitsArray, _marker, _owner, _actSide, _distance, _condition, _onAct, _onDeAct ] call T8U_fnc_Zone
[ "SpawnForest", "markerForest", 1000 "EAST", "ANYPLAYER", 210 ] spawn T8U_fnc_Zone;

will this work
no like this
// [ _unitsArray, _marker, _owner, _actSide, _distance, _condition, _onAct, _onDeAct ] call T8U_fnc_Zone
[ "SpawnForest", "markerForest", 1000,  "EAST", "ANYPLAYER", 210 ] spawn T8U_fnc_Zone;

Share this post


Link to post
Share on other sites

[ "SpawnForest", "markerForest", 1000, "({ getPosATL _x select 2 < 100.0 } count thisList ) > 0", "EAST", "ANYPLAYER", 210 ] spawn T8U_fnc_Zone;

i see so if i add it like this it will be 1000m of the ground it won't be spown ?

Share this post


Link to post
Share on other sites

can you explain this a little bit more for me pls :eh: 
i did this, than i fly over so that works, but when i land the trigger won't spawn the units. is the 1000 meter in high or is that the distance of the trigger to spawn the units ?
and and what is the false at the end.  Sorry if this is alitelbit off, but i really will like this to work :ftvsmilie1:


[ "SpawnFarm", "markerFarm", 1000, "({ getPosATL _x select 2 < 100.0 } count thisList ) > 0", "EAST", "ANYPLAYER", false, "", "" ] call T8U_fnc_TriggerSpawn;

It was wrong this, but still dont work can i fly over the marker
[ "SpawnFarm", "markerFarm", 300, "({ getPosATL _x select 2 < 500.0 } count thisList ) > 0", "ANYPLAYER", "PRESENT", false, "", "" ] call T8U_fnc_TriggerSpawn;

hmm
i did 500.0 because i thought that was the height of it

I got it to work man thank you for this  :shoot:
getPosATL _x select 2 < 20.0 that's the height.
Again thanks for this, it's really good
[ "SpawnFarm", "markerFarm", 300, "({ getPosATL _x select 2 < 20.0 } count thisList ) > 0", "ANYPLAYER", "PRESENT", false, "", "" ] call T8U_fnc_TriggerSpawn;

  • Like 1

Share this post


Link to post
Share on other sites

Hi its me again, can you help me find how to set the time if the players is not around the marker that has been triggered ? if players is not around the marker it will disappear till you trigger it again. Thanks

Share this post


Link to post
Share on other sites

Hello,

 

maybe i can't find it.

But is it possible to spawn units via script on a certain marker and then let the spawned units move them to an marked area.

Because it seems to me there is only an option to spawn units in an marked area and let them patrol in this area where the got spawned.

 

Sorry i think i found the correct option:

mySpawnContainer = [ [ [ BASIC ], [ "ATTACK", “mkr” ], [ COMMUNICATION ] ], [ [ _group, "marker" ], [ "ATTACK", “attackHERE” ] ] ];

"mkr": ?

"marker": Spawn area

"attackHERE": marked area which has to be attacked by the spawned units

 

But is it possible to run this call in an script during the mission?

Share this post


Link to post
Share on other sites

Since last update T8 is showing a lot of 'undefined variable' script errors. As far as I could check, the script still works normally, but just in case it would be nice if someone could check thoroughly.

Share this post


Link to post
Share on other sites

There seems to be an issue with waypoint creation as many groups seem to get a first waypoint at 000 000 and then the other waypoints.

 

Edit: According to the debug, they are FLANking.

Share this post


Link to post
Share on other sites

Is this script still working correctly at this time. No activity on this thread since March. Is the author still updating script ?

Share this post


Link to post
Share on other sites

Is there a possibility to use the "PATROL_URBAN" task without spawning in the vicinity of the marker ? I'm trying to get some reinforcements spawning 1km away from the patrol zone.
Even with the last parameter, (SPAWN_POS) I cant't get it work.

wave_04 = 
[
	[ [ [_QRF_ARRAY], "mkr_patrol_zone", WEST, false ], [ "PATROL_URBAN"] [ false, false, false ], "mkr_spawn_away" ]
];

 

Share this post


Link to post
Share on other sites
On 11.7.2018 at 4:37 PM, avibird 1 said:

Is this script still working correctly at this time. No activity on this thread since March. Is the author still updating script ?

 

Sorry, I haven't really played arma in a long time, so this is a bit abandoned. :/

 

 

1 hour ago, Sweedn said:

Is there a possibility to use the "PATROL_URBAN" task without spawning in the vicinity of the marker ? I'm trying to get some reinforcements spawning 1km away from the patrol zone.
Even with the last parameter, (SPAWN_POS) I cant't get it work.


wave_04 = 
[
	[ [ [_QRF_ARRAY], "mkr_patrol_zone", WEST, false ], [ "PATROL_URBAN"] [ false, false, false ], "mkr_spawn_away" ]
];

 

 

If I remember correctly you neer to add a empty array prior to your "mkr_spawn_away".

like this:

[[ _QRF_ARRAY, "mkr_patrol_zone", WEST, false ], ["PATROL_URBAN"] [false, false, false], [], "mkr_spawn_away"]

 

  • Sad 2

Share this post


Link to post
Share on other sites

Good Day All,

 

I know this script is a dead product but it works really great. I am trying to create a spawn position on the water at a designated area marker.

 

Here is the error message. If you turn on debug, the units spawn, but they always spawn on the coast nearest the area marker.

 

Quote

 7:38:52 File T8\fnc\fn_createSpawnPos.sqf [T8U_fnc_createSpawnPos], line 91
 7:38:52 Error in expression <EP  ) < 2 ) AND {( _wpPosFEP distance ( nearestObject _wpPosFEP )) < 10 })) then>
 7:38:52   Error position: <nearestObject _wpPosFEP )) < 10 })) then>
 7:38:52   Error 0 elements provided, 3 expected

 

I've found the script it's calling out, and the line. I've tried to fix it, but I have limited knowledge writing code. But I love to learn, so I would like to walk through it, and see if I am close in my deductions.

 

First the script.....

Name: fn_createSpawnPos.sqf

/*
 =======================================================================================================================

	T8 Units Script

	Funktion:	fn_createSpawnPos.sqf
	Author:		T-800a
	E-Mail:		t-800a@gmx.net

 =======================================================================================================================

*/
#include <..\MACRO.hpp>

private [ "_areaSize", "_areaSizeX", "_areaSizeY", "_wpPosFEP", "_loop", "_tmpAreaSize", "_markerPos" ];

private _marker = param [ 0, [0,0,0], [ "", []]];

if ( _marker isEqualTo [0,0,0] ) exitWith { if ( T8U_var_DEBUG ) then { [ "fn_createSpawnPos.sqf", "Can't create SpawnPos" ] spawn T8U_fnc_DebugLog; }; false };

if (( typeName _marker ) isEqualTo ( typeName "STR" )) then 
{
	if (( getMarkerPos _marker ) isEqualTo [0,0,0]) exitWith { if ( T8U_var_DEBUG ) then { [ "fn_createSpawnPos.sqf", "Can't create SpawnPos" ] spawn T8U_fnc_DebugLog; }; false };
	
	_areaSizeX		= ( getMarkerSize _marker ) select 0;
	_areaSizeY		= ( getMarkerSize _marker ) select 1;
	_areaSize		= if ((( _areaSizeX + _areaSizeY ) / 2 ) < 150 ) then { 50 } else {(( _areaSizeX + _areaSizeY ) / 2 ) / 3 };
	_tmpAreaSize	= _areaSize;
	_markerPos		= getMarkerPos _marker;

} else {
	_areaSizeX		= 50;
	_areaSizeY		= 50;
	_areaSize		= 50;
	_tmpAreaSize	= 50;
	_markerPos		= _marker;
};

_wpPosFEP		= [];
_loop			= true;

while { _loop } do
{
	private [ "_spawnPos", "_roadObj", "_roadPos"];
	_spawnPos = [ _markerPos, random _tmpAreaSize, random 360 ] call BIS_fnc_relPos;
	_roadObj = [ _spawnPos, 50 ] call BIS_fnc_nearestRoad;
	if ( isNull _roadObj ) then { _roadPos = _spawnPos; } else {  _roadPos = getpos _roadObj; };
	_wpPosFEP =  _roadPos findEmptyPosition [ 1 , 50 , "Land_VR_Block_02_F" ]; // 20x20 block ... should be enough space for a Trooper
	if (( surfaceIsWater _roadPos OR (( count _wpPosFEP  ) < 2 ) AND {( _wpPosFEP distance ( nearestObject _wpPosFEP )) < 10 })) then { _tmpAreaSize = _tmpAreaSize + 5; } else { _loop = false; };
};

if ( T8U_var_DEBUG ) then { [ "fn_createSpawnPos.sqf", "SpawnPos", _wpPosFEP ] spawn T8U_fnc_DebugLog; };

// Return
_wpPosFEP

the affected line is line 49 .

 

	if (( surfaceIsWater _roadPos OR (( count _wpPosFEP  ) < 2 ) AND {( _wpPosFEP distance ( nearestObject _wpPosFEP )) < 10 })) then { _tmpAreaSize = _tmpAreaSize + 5; } else { _loop = false; };

The log report is calling out 2 items...... Error in expression and Error in position. With the error being 0 elements provided, 3 expected. I believe the first item needing correct is the "error in expression". If that is corrected then the "error in position" may correct itself. 

 

Are there ANY experienced coders on these forums, that may be able to fix this issue? (In my best foghorn leghorn voice, "That's joke son, you see, a joke!").

 

I'll keep plugging way.

 

 

 

 

 

Share this post


Link to post
Share on other sites
_wpPosFEP = _roadPos findEmptyPosition [ 1 , 50 , "Land_VR_Block_02_F" ];

this finds no position and thus returns and empty array

 

as well as same for:

nearestObject _wpPosFEP

try this:

if
(
	(surfaceIsWater _roadPos)
	or
	((count _wpPosFEP) == 0)
	or
	((count (nearestObject _wpPosFEP)) == 0)
	or
	((_wpPosFEP distance (nearestObject _wpPosFEP)) < 10)
) then
{
	_tmpAreaSize = _tmpAreaSize + 5;
}
else
{
	_loop = false;
};

 

  • Like 1

Share this post


Link to post
Share on other sites

Appreciate the help, .kju.

 

Unfortunately, did not solve the issue.

 

I tried several different ways also. And tried to use BIS_fnc_findSafePos to force it on the water. No luck.

 

I am going to look for other solutions, like EOS, etc. I may revisit it. 

 

The reason I like this system is the built in tasks to patrol, attack, defend, etc. etc. It works pretty well.

 

Once again thanks.

 

 

Share this post


Link to post
Share on other sites

you get the same error, or what is it?

Share this post


Link to post
Share on other sites

Hi .kju,

 

Different error from before. Also different results at mission start. The units don't spawn at all.

My setup is

2 markers - one over land, one over open water.

Original code, both units spawn, the one over water spawns at the nearest coastal position. The over land spawns correctly.

 

 

Quote

 6:32:25 Error in expression <
((count _wpPosFEP) < 2)
and
{
((count (nearestObject _wpPosFEP)) == 0)
or
((_wp>
 6:32:25   Error position: <nearestObject _wpPosFEP)) == 0)
or
((_wp>
 6:32:25   Error count: 0 elements provided, 3 expected
 6:32:25 File T8\fnc\fn_createSpawnPos.sqf [T8U_fnc_createSpawnPos], line 101

 

 

Share this post


Link to post
Share on other sites

.kju

 

Sorry , no luck.

Quote

 7:07:20 Starting mission:
 7:07:20  Mission file: T8_Testing_Center_Altis
 7:07:20  Mission world: Altis
 7:07:20  Mission directory: C:\Users\Blackheart_Six\Documents\Arma 3\mpmissions\T8_Testing_Center_Altis.Altis\
 7:07:22 c:\bis\source\stable\futura\lib\network\networkserver.cpp NetworkServer::OnClientStateChanged:NOT IMPLEMENTED - briefing!
 7:07:25  Mission id: b3e050fef78f619cada20c9b4eed38146cbbc701
 7:07:30 Error in expression <or
((count _wpPosFEP) == 0)
or
((count (nearestObject _wpPosFEP)) == 0)
or
((_wp>
 7:07:30   Error position: <nearestObject _wpPosFEP)) == 0)
or
((_wp>
 7:07:30   Error count: 0 elements provided, 3 expected
 7:07:30 File T8\fnc\fn_createSpawnPos.sqf [T8U_fnc_createSpawnPos], line 99

 

and I REALLY do appreciate the effort.

 

 

 

Share this post


Link to post
Share on other sites

can you please upload your mission to check

best without mods/little as possible, and automatically to show up

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

×