Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //TRIGGER EXAMPLE
- //Spawn a tree, vanilla
- //Because we are calling vanilla objects, their textures
- //and materials are already in-game, no need to change them
- //define a position, close to player
- //trees spawn below ground, so we also move it up by 8 m after spawning it
- pos = player getRelPos [15, 0];
- tree = createSimpleObject ["a3\plants_f\Tree\t_PinusP3s_F.p3d", pos];
- tree setPos [pos select 0, pos select 1,8];
- /*
- ---------------------------
- ALL EXAMPLES BELOW THIS POINT ARE DESIGNED FOR USE IN SCRIPTS.
- Using them in triggers may result in errors.
- ---------------------------
- */
- //Spawn a tree, vanilla
- //Because we are calling vanilla objects, their textures
- //and materials are already in-game, no need to change them
- _pos = player getRelPos [15, 0]; //define a position, close to player
- _tree = createSimpleObject ["a3\plants_f\Tree\t_PinusP3s_F.p3d", _pos];
- _tree setPos [_pos select 0, _pos select 1,8]; //trees spawn below ground, so we move it up by 8 m
- //spawn a bush, covers up the tree base
- _pos = player getRelPos [13, 0.2];
- _bush = createSimpleObject ["a3\plants_f\Bush\b_NeriumO2d_F.p3d", _pos];
- _bush setPos [_pos select 0, _pos select 1,2.1]; //we move it by 2.1 m up
- //Spawn a road part, vanilla
- _pos = player getRelPos [5, 0];
- _road = createSimpleObject ["a3\roads_f\Roads\city_W10_A7_639_R75.p3d", _pos];
- _road setPos [_pos select 0, _pos select 1,2];
- //spawn a vanilla bridge, rotate it slightly
- _pos = player getRelPos [30, 0];
- _brdg = createSimpleObject ["a3\structures_f\Bridges\Bridge_Concrete_F.p3d", _pos];
- _brdg setPos [_pos select 0, _pos select 1,7.5]; //each model has different height
- _brdg setDir 35;
- //spawn a non-animated head and place it on a metal shelf called "shelf"
- _pos = getpos shelf;
- _sol = createSimpleObject ["a3\characters_f\heads\m_greek_01.p3d", _pos];
- _sol setPos [_pos select 0, _pos select 1, 1.3];
- _sol setdir direction shelf;
- //spawn a vehicle (not interactive, immobile)
- _pos = getpos player;
- _posX = _pos select 0;
- _posY = _pos select 1;
- _sol = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\APC_Tracked_01_aa_F.p3d", _pos];
- _sol setPos [_posX, _posY, 5.8];
- //spawn a custom model (in this case, a vest)
- //you NEED description.ext for this to work. Even an empty file.
- _pos = shelf getRelPos [0,1];
- _obj = createSimpleObject
- [(str missionConfigFile select [0, count str missionConfigFile - 15]) //path to mission folder
- + "A3_vest_example.p3d", _pos]; //name of the object itself, position
- //set the object's texture and material, I used in-game data
- _obj setObjectTexture [0,"a3\characters_f\BLUFOR\data\armor1_co.paa"];
- _obj setObjectMaterial [0,"a3\characters_f\BLUFOR\data\armor1.rvmat"];
- _obj setPos _pos; //make sure the object is in the right place
- //The video also included a quick showcase of all different types of objects,
- //these objects were spawning in a row and each one was rotating around as it spawned to demonstrate that the objects
- //can be operated with commands, just like any static object. The script is down below,
- //but it is more like an extra fancy example, not necessarily what needs to be done each time you want to spawn something.
- _array = [
- "a3\structures_f\households\addons\i_Garage_V1_F.p3d",
- "a3\structures_f\walls\Mil_WiredFenceD_F.p3d",
- "a3\structures_f_bootcamp\Civ\SportsGrounds\GymBench_01_F.p3d",
- "a3\structures_f\mil\fortification\HBarrierTower_F.p3d",
- "a3\armor_f_beta\apc_tracked_01\APC_Tracked_01_crv_F.p3d",
- "a3\rocks_f\Decal_rock_dark.p3d",
- "a3\rocks_f\StoneSharp_Wall.p3d",
- "a3\plants_f\Bush\b_Thistle_Thorn_Green.p3d",
- "a3\plants_f\Tree\t_poplar2f_dead_F.p3d",
- "a3\roads_f\Test_RoadsA\road_W10_A18_007_R35.p3d",
- "a3\structures_f\Bridges\Bridge_Asphalt_F.p3d",
- "a3\data_f\ParticleEffects\Universal\Explosion_4x4.p3d",
- "a3\data_f\ParticleEffects\Universal\GlassShards.p3d",
- "a3\boat_f_epc\Submarine_01\Submarine_01_F.p3d"
- ];
- _n = count _array;
- _j = 200;
- for "_i" from 0 to (_n - 1) step 1 do {
- _pos = logic getRelPos [_j, 0];
- _obj = createSimpleObject [_array select _i, _pos];
- _obj setPos [_pos select 0, _pos select 1,25];
- _j = _j - 15;
- for "_xx" from 0 to 360 step 1 do {
- _obj setDir _xx;
- sleep 0.05;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement