Jump to content
Sign in to follow this  
Katrician

Spawned vehicle not reacting against enemy

Recommended Posts

Hello playing with create vehicle I setup a simple mission to test as follow :

- Me player West

- East UAZ spg9 spawns and move to a waypoint "GUARD"

- West truck move towards the UAZ, as me too even firing rounds in the air...

The East UAZ spg9 does nothing, I can shoot them they won't react at all, the West truck either?

Here is the code I used in my sqf file :

_sideHQ = createCenter EAST;
_grp = createGroup EAST;
_tmp = [markerPos "posGlbSpawn2", 180, "LandRover_SPG9_TK_EP1", _grp] call BIS_fnc_spawnVehicle;
//[_grp] call BIS_fnc_spawnCrew;
_wp = _grp addWaypoint [markerPos "wpBrdm", 0];
_wp setWaypointType "GUARD";
//_wp setWaypointBehaviour "COMBAT";
//_wp setWaypointCombatMode "RED";

Share this post


Link to post
Share on other sites
It doesnt even spawn the vehicle for me.

I use OA so

In the editor put soldier West (player)

Then put a trigger (over player) activated BLUEFOR/present and in the On Act. field put :

nul= [] execVM "brdm.sqf"

Place two markers called posGlbSpawn2 and wpBrdm

Place a West truck with a waypoint move near the marker wpbdrm.

Place the brdm.sqf file into the folder of the mission.

To make brdm.sqf copy this code into Notepad and save it as brdm.sqf

_sideHQ = createCenter EAST;
_grp = createGroup EAST;
_tmp = [markerPos "posGlbSpawn2", 180, "LandRover_SPG9_TK_EP1", _grp] call BIS_fnc_spawnVehicle;
//[_grp] call BIS_fnc_spawnCrew;
_wp = _grp addWaypoint [markerPos "wpBrdm", 0];
_wp setWaypointType "GUARD";
//_wp setWaypointBehaviour "COMBAT";
//_wp setWaypointCombatMode "RED";

Share this post


Link to post
Share on other sites

I think my game must be fking vicitmized by black magic, I did everything as you said (though im not an editor noob :D) but nothing spawns. I swear I worked yesterday, today I even reinstalled every ArmA2 component but its still shitting me. :386::386:

Can you upload your mission? Im sooooo sure I did everything right but I jsut feel like trying it.

Edited by ziiip

Share this post


Link to post
Share on other sites

@ziiip

You need to place the Function Manager Module for it to work.

@Topic

Not sure why the UAZ doesn't react. I use pretty much the same code quite often.

Have you tried using a different WP type, e.g. Move?

Share this post


Link to post
Share on other sites

It's because the East side probably has no sideCenter. You don't happen to have already placed an East unit on the map (which would setup the sideCenter automatically), but only spawn them with a script, right?

Create your sideCenter and setup the relationships prior to spawning your units and they should act as you intend them to.

Share this post


Link to post
Share on other sites
I think my game must be fking vicitmized by black magic, I did everything as you said (though im not an editor noob :D) but nothing spawns. I swear I worked yesterday, today I even reinstalled every ArmA2 component but its still shitting me. :386::386:

Can you upload your mission? Im sooooo sure I did everything right but I jsut feel like trying it.

Check your MP ;)

Share this post


Link to post
Share on other sites
It's because the East side probably has no sideCenter. You don't happen to have already placed an East unit on the map (which would setup the sideCenter automatically), but only spawn them with a script, right?

Create your sideCenter and setup the relationships prior to spawning your units and they should act as you intend them to.

SideCenter is created in the very first line of the script. ;)

But you're right about the setFriend part.

Share this post


Link to post
Share on other sites
@ziiip

You need to place the Function Manager Module for it to work.

@Topic

Not sure why the UAZ doesn't react. I use pretty much the same code quite often.

Have you tried using a different WP type, e.g. Move?

:lookaround:erm... looks like I forgot to tell Ziiip about the Function Manager Module...

Clayman I must say obviously part of the code is from you :blush: since I learn to works with spawning units to make mission efficient, I tended to put AI and use waypoints but now I want something "clean".

It's because the East side probably has no sideCenter. You don't happen to have already placed an East unit on the map (which would setup the sideCenter automatically), but only spawn them with a script, right?

Create your sideCenter and setup the relationships prior to spawning your units and they should act as you intend them to.

Ruebe you are right there is no East unit(s) present on map before the car spawn I will check it, like you explained.

EDIT: Solved adding an East soldier somewhere on the map did the trick.

Edited by Katrician
I hear voices...

Share this post


Link to post
Share on other sites

I did this, but only the leading APC moves, the other 2 stay still. :rolleyes:

code

ukveh1 = [getMarkerPos "marker14", 310, "BAF_FV510_D", WEST] call bis_fnc_spawnvehicle;

ukapc1 = ukveh1 select 0;

ukveh2 = [getMarkerPos "marker14", 310, "BAF_FV510_D", WEST] call bis_fnc_spawnvehicle;

ukapc2 = ukveh2 select 0;

ukveh3 = [getMarkerPos "marker14", 310, "BAF_FV510_D", WEST] call bis_fnc_spawnvehicle;

ukapc3 = ukveh3 select 0;

ukapc1 setRank "CAPTAIN"; ukapc2 setRank "LIEUTENANT"; ukapc3 setRank "SERGEANT";

[ukapc2, ukapc3] join ukapc1;

sleep 10;

ukapc1wp1 = group ukapc1 addwaypoint [[getmarkerpos "marker15" select 0, getmarkerpos "marker15" select 1, 0], 0, 1];

[group ukapc1, 1] setWaypointType "MOVE";

[group ukapc1, 1] setWaypointBehaviour "SAFE";

[group ukapc1, 1] setWaypointFormation "LINE";

Edit: apparently the problem is the join command. It doesnt work properly with vehicles. :\

Edited by ziiip

Share this post


Link to post
Share on other sites

Also remember, the GUARD waypoint only works if there are GUARDED BY triggers on the map.

Share this post


Link to post
Share on other sites

Are you sure? BIS_fnc_taskDefend seems to utilize the guard waypoint type without any requirements for any guardedby triggers. Description says "...and guard the position". Note that there are no running loops in that procedure, yet still the group will try to keep any nearby static guns manned (iirc).

Edit: No wait, that was a slightly modified version. Sorry my bad. But not sure what the guard wp does in this respect though.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

guard wp and triggers get only interessting if there are multiple guarded by triggers around. The idea behind this is, that a guardedby trigger has to be guarded by at least one group. If a guardedby trigger isn't guarded by anyone, then the next group with such a guard wp will move there and guard it as highest priority.

Let's say you have two guarded by triggers around, say for a camp and one for a strategic building. Then lets have two groups, each with a guard wp, one for each trigger. You should now see each group guarding their guarded by trigger.

Now, let's have a third group, too with a guarded by trigger, but somewhere else, alway from the guarded by triggers. They should not yet move out to any guarded by trigger (not really that sure about this.. sorry) since all guarded by triggers are "satisfied" with a group guarding them. But as soon as one of these groups get's wiped out, this group should move out there and guard that guarded by trigger, that isn't guarded by anyone anymore.... thus you may use this to easily model reinforcements/counterattacks.

At least I remember them to work something like this, but I'm not sure about all the details invovled. :)

Share this post


Link to post
Share on other sites
Also remember, the GUARD waypoint only works if there are GUARDED BY triggers on the map.

But, but you mean that making GUARD waypoints without a trigger "guarded by East/West" has no utility??

Share this post


Link to post
Share on other sites
But, but you mean that making GUARD waypoints without a trigger "guarded by East/West" has no utility??

Yeah, basically it's how ruebe explained, the GUARDED waypoint just tells a group to look for an unguarded GUARDED BY trigger area and move to it. If there aren't any, then they just kind of hang out where they are.

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  

×