setVehicleCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Added unloading examples per https://forums.bistudio.com/topic/191678-vehicle-in-vehicle-transport-feedback/page-5#entry3056397)
m (Text replacement - " +\]" to "]")
 
(45 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|1.62|= Game version
|version1= 1.62
____________________________________________________________________________________________


| Load cargo vehicle inside vehicle if possible, returns bool based on whether the vehicle was able to be loaded.  Can also be used to unload a specific loaded vehicle or all loaded vehicles. |= Description
|arg=
____________________________________________________________________________________________


| vehicle setVehicleCargo cargo |= Syntax
|eff= global


|p1= vehicle: [[Object]]  |= Parameter 1
|gr1= Vehicle in Vehicle Transport


|p2cargo: [[Object]] |= Parameter 2
|descr= Load cargo vehicle inside vehicle if possible, returns bool based on whether the vehicle was able to be loaded. Can also be used to unload a specific loaded vehicle or all loaded vehicles.


| [[Boolean]] - whether the vehicle was able to be loaded |= Return Value
|s1= vehicle [[setVehicleCargo]] cargo
____________________________________________________________________________________________
 
|p1= vehicle: [[Object]] - vehicle for carrying cargo, [[objNull]] to unload specific loaded cargo
 
|p2= cargo: [[Object]] - cargo to put/loaded in vehicle, [[objNull]] to unload all loaded cargo
 
|r1= [[Boolean]] - whether or not operation was a success


|x1= Blackfish with no vehicle cargo loaded
|x1= Blackfish with no vehicle cargo loaded
<code>_success = blackfish setVehicleCargo offroad; //true
<sqf>private _success = blackfish setVehicleCargo offroad; // true</sqf>
</code> |= Example 1
____________________________________________________________________________________________


|x2= Blackfish with full cargo already loaded
|x2= Blackfish with full cargo already loaded
<code>_success = blackfish setVehicleCargo offroad; //false
<sqf>private _success = blackfish setVehicleCargo offroad; // false</sqf>
</code> |= Example 2
__________________________


|x3= Unload specific loaded vehicle
|x3= Unload specific loaded vehicle (will paradrop if dropped from high altitude)
<code>_success = objNull setVehicleCargo offroad;  
<sqf>private _success = objNull setVehicleCargo offroad;</sqf>
</code> |= Example 3
____________________________________________________________________________________________


|x4= Unload all vehicles
|x4= Unload all vehicles (will paradrop if dropped from high altitude)
<code>_success = blackfish setVehicleCargo objNull;
<sqf>private _success = blackfish setVehicleCargo objNull;</sqf>
</code> |= Example 4
__________________________________________________________________


|mp= - |= Multiplayer Behaviour
|seealso= [[Arma 3: Vehicle in Vehicle Transport| Vehicle in Vehicle Transport]] [[canVehicleCargo]] [[enableVehicleCargo]] [[getVehicleCargo]] [[isVehicleCargo]] [[vehicleCargoEnabled]]
 
}}
| [[Arma_3_Vehicle_in_Vehicle_Transport| Vehicle in Vehicle Transport ]] [[canVehicleCargo]] [[enableVehicleCargo]] [[getVehicleCargo]] [[isVehicleCargo]] [[vehicleCargoEnabled]] |= See Also


{{Note
|user= ImperialAlex
|timestamp= 20160704184600
|text= <sqf inline>objNull setVehicleCargo _cargoVehicle</sqf> - will unload specific loaded vehicle, and <sqf inline>_trasportVehicle setVehicleCargo objNull</sqf> will unload all vehicles. The unloaded vehicles will be paradropped if the altitude is high enough. See: {{Link|link= https://forums.bistudio.com/topic/191678-vehicle-in-vehicle-transport-feedback/page-5#entry3056397|text= BIforums}}
}}
}}
<h3 style="display:none">Bottom Section</h3>
<!-- Appropriate categories go here -->
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on July 4, 2016 - 18:46 (UTC)</dd>
<dt class="note">[[User:ImperialAlex|ImperialAlex]]</dt>
<dd class="note">
From [https://forums.bistudio.com/topic/191678-vehicle-in-vehicle-transport-feedback/page-5#entry3056397 biforums]:
"objnull setVehicleCargo cargo vehicle - will unload specific loaded vehicle" and "transporting vehicle setVehicleCargo objnul - unload all vehicles"
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 19:15, 8 November 2023

Hover & click on the images for description

Description

Description:
Load cargo vehicle inside vehicle if possible, returns bool based on whether the vehicle was able to be loaded. Can also be used to unload a specific loaded vehicle or all loaded vehicles.
Groups:
Vehicle in Vehicle Transport

Syntax

Syntax:
vehicle setVehicleCargo cargo
Parameters:
vehicle: Object - vehicle for carrying cargo, objNull to unload specific loaded cargo
cargo: Object - cargo to put/loaded in vehicle, objNull to unload all loaded cargo
Return Value:
Boolean - whether or not operation was a success

Examples

Example 1:
Blackfish with no vehicle cargo loaded
private _success = blackfish setVehicleCargo offroad; // true
Example 2:
Blackfish with full cargo already loaded
private _success = blackfish setVehicleCargo offroad; // false
Example 3:
Unload specific loaded vehicle (will paradrop if dropped from high altitude)
private _success = objNull setVehicleCargo offroad;
Example 4:
Unload all vehicles (will paradrop if dropped from high altitude)
private _success = blackfish setVehicleCargo objNull;

Additional Information

See also:
Vehicle in Vehicle Transport canVehicleCargo enableVehicleCargo getVehicleCargo isVehicleCargo vehicleCargoEnabled

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
ImperialAlex - c
Posted on Jul 04, 2016 - 18:46 (UTC)
objNull setVehicleCargo _cargoVehicle - will unload specific loaded vehicle, and _trasportVehicle setVehicleCargo objNull will unload all vehicles. The unloaded vehicles will be paradropped if the altitude is high enough. See: BIforums