Forum Jump :

Author Message

vcson  



Posts: 5
Rank:


Level: Member

Country: se
Location:
Occupation:
Age: 21
In-game name:

 
#1 Posted at 2015-12-11 22:07        
     
Hi! What I would like to do is that when Im manually opening the bargate in game I would like to activate a trigger.
This is the moast simple way I can discribe it. 'If bargate = open then activate trigger'. Hope its possible

Best Regards

Victor


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2015-12-12 00:27        
     
Should be easy.

Trigger cond
(objname animationphase "Door_1_rot") > 0

On Act
hint "Gate is opening"

or if you only want it to activate if the gate is fully open then it would be


Trigger cond
(objname animationphase "Door_1_rot") == 1


Advertisement


Author Message

vcson  



Posts: 5
Rank:


Level: Member

Country: se
Location:
Occupation:
Age: 21
In-game name:

 
#3 Posted at 2015-12-12 18:08        
     
thanks it works like a charm! :D

Added 2 hours later:

Do you possible know how to change so I can pick a pacific driver for example "CAF_AG_ME_CIV_02". Instead of the call BIS_fnc_spawnCrew;

This is what I have:
//moving group to cargo and assigning driver.
{_x moveincargo _vehicleSpawn} foreach units _spawnGroup;
{_x assignascargo _vehicleSpawn} foreach units _spawnGroup;
_vehicleCrew = [_vehicleSpawn,_spawnGroup] call BIS_fnc_spawnCrew;

Sorry, I dont know yet how to do the bars you are making when writing the scripts.

This post was edited by vcson (2015-12-12 20:10, 730 days ago)


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#4 Posted at 2015-12-12 20:50        
     
Try:
_driver = "CAF_AG_ME_CIV_02" createVehicle position _vehicleSpawn;
_driver assignasdriver _vehicleSpawn;
_driver moveindriver _vehicleSpawn;

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2015-12-12 21:17        
     
Never mind above should work.


Author Message

vcson  



Posts: 5
Rank:


Level: Member

Country: se
Location:
Occupation:
Age: 21
In-game name:

 
#6 Posted at 2015-12-12 22:23        
     
Sorry but I cant get it to work.
Im trying to edit a mission made by PFC Burnes - 15th MEU(SOC).
There are some things I would like to change to make it more suitible for my m8:ts to play.
If anyone would like to have a look at the sqf file It would be much appreciated.

If you search for 'assigning driver' to find the places where you assign the different drivers to the special group.
To make it simple for me later if you can figure it out. We can say that the character thats drive the vehicle should be 'O_Soldier_AR_F'

SQF File:
[url=https://www.dropbox.com/s/kxrrnpk6csjg5kg/spawnScript.sqf?dl=0][/url]


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#7 Posted at 2015-12-13 01:35        
     
Sorry I didn't remember how weird could be createVehicle for a unit. You can't do anything once created, probably because it doesn't belong to a group.
So, try instead:
_driver = [getPosatl _vehicleSpawn, civilian, ["CAF_AG_ME_CIV_02"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;
leader _driver moveInDriver _vehicleSpawn;

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message

vcson  



Posts: 5
Rank:


Level: Member

Country: se
Location:
Occupation:
Age: 21
In-game name:

 
#8 Posted at 2015-12-13 14:21        
     
I dont know if im doing something wrong.

Can you writte the script from the line //moving group to cargo and assigning driver.
I dont really know what to delete and what to leave. Sorry im really new to this as you probably can notice.

There are 3 different places where you assain cargo and driver. Here you have all of them.

//moving group to cargo and assigning driver.
{_x moveincargo _vehicleSpawn} foreach units _spawnGroup;
{_x assignascargo _vehicleSpawn} foreach units _spawnGroup;
_vehicleCrew = [_vehicleSpawn,_spawnGroup] call BIS_fnc_spawnCrew;

//moving group to cargo and assigning driver.
{_x moveincargo _BusVehicleSpawn} foreach units _spawnGroupBus;
{_x assignascargo _BusvehicleSpawn} foreach units _spawnGroupBus;
_BusVehicleCrew = [_BusVehicleSpawn,_spawnGroupBus] call BIS_fnc_spawnCrew;

//moving group to cargo and assigning driver.
{_x moveincargo _vehicleSpawn} foreach units _spawnEnemyGroup;
_enemyVehicleCrew = [_vehicleSpawn,_spawnEnemyGroup] call BIS_fnc_spawnCrew;

Added 11 minutes later:

@F2kSel can I get the scripts you wrote? you deleted them.

This post was edited by vcson (2015-12-13 14:36, 730 days ago)


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#9 Posted at 2015-12-13 15:06        
     
I don't have what I originally posted but I did mess with the code you posted and it seems to work for me, just change the driver type in the code to what you require.

I did away with most of the assignas commands as they keep making units jump out of the vehicles.




Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#10 Posted at 2015-12-13 16:36        
     
I don't know how you're spawning vehicle, so all of that depends on where _vehicleSpawn is in script.
Say you just wrote _vehicleSpawn = .... bis_fnc_spawnVehicle; // or else but in this script because _vehicleSpawn is a local variable!
Same for _spawnGroup and all other local variables (vehicles or groups).
then:
{_x moveincargo _vehicleSpawn} foreach units _spawnGroup;
{_x assignascargo _vehicleSpawn} foreach units _spawnGroup;
_vehicleCrew = [_vehicleSpawn,_spawnGroup] call BIS_fnc_spawnCrew; // or just: createVehicleCrew _vehicleSpawn
deleteVehicle driver _vehicleSpawn;
_driver1 = [getPosatl _vehicleSpawn, civilian, ["CAF_AG_ME_CIV_02"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;
leader _driver1 moveInDriver _vehicleSpawn;

{_x moveincargo _BusVehicleSpawn} foreach units _spawnGroupBus;
{_x assignascargo _BusvehicleSpawn} foreach units _spawnGroupBus;
_BusVehicleCrew = [_BusVehicleSpawn,_spawnGroupBus] call BIS_fnc_spawnCrew;
deleteVehicle driver _vehicleSpawn;
_driver2 = [getPosatl _BusVehicleSpawn, civilian, ["CAF_AG_ME_CIV_02"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;
leader _driver2 moveInDriver _BusVehicleSpawn;


I'm not sure of what could be _vehicleSpawn here, probably the first vehicle if you're in the same script.
Change for _enemyVehicleSpawn (and create it of course!)
{_x moveincargo _enemyVehicleSpawn} foreach units _spawnEnemyGroup;
createVehicleCrew _enemyVehicleSpawn;
deleteVehicle driver _enemyVehicleSpawn;
_driver3 = [getPosatl _enemyVehicleSpawn, civilian, ["CAF_AG_ME_CIV_02"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;
leader _driver3 moveInDriver _enemyVehicleSpawn;

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message

vcson  



Posts: 5
Rank:


Level: Member

Country: se
Location:
Occupation:
Age: 21
In-game name:

 
#11 Posted at 2015-12-21 18:29        
     
Thanks I will try when I get back to my apartment.

F2kSel. The script you wrote when you said something like (this script will make all cargo the same character)I tried it out and it worked. But later I tried some other scripts and I did not save the one you wrote. So when I went back to the forum you had deleted it.


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#12 Posted at 2015-12-21 19:43        
     
Did you try the code posted in reply #9 that was working for me.