createVehicle – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "KillZone Kid mentions ' ''"vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", pos, [], 0, "NONE"]'' ' but this is not entirely true. I belie...")
 
m (Text replacement - " <dd class="notedate">" to " <dt><dt> <dd class="notedate">")
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
KillZone Kid mentions ' ''"vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", pos, [], 0, "NONE"]'' '
KillZone Kid mentions ' ''"vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", pos, [], 0, "NONE"]'' '
but this is not entirely true. I believe it should read: "vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", [pos select 0, pos select 1, 0], [], 0, "NONE"]
but this is not entirely true. I believe it should read: "vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", [pos select 0, pos select 1, 0], [], 0, "NONE"] --[[User:Zectbumo|Zectbumo]]
::Why? You say you "believe" it should read that way. Why do you believe that? Please explain. Why does selecting pos's X and Y values, but not it's Z value make it faster? You are still passing a number as the third position array parameter. If anything your example should be slower because you are using the [[select]] command twice. --[[User:Benargee|Benargee]] ([[User talk:Benargee|talk]]) 01:48, 28 November 2015 (CET)
::::I think he is suggesting that the non-array createVehicle syntax will always create vehicles at ground level whereas the array syntax won't necessarily (aka, he's talking about equivalent behaviour rather than speed). I can't verify off the top of my head if that's the case, but in response to the original question: for demonstrative purposes it is assuming the position is at ground level. --[[User:SilentSpike|SS]] ([[User talk:SilentSpike|talk]]) 14:47, 28 November 2015 (CET)
::::::Parsing of array of params to the command always takes longer than a single argument. Other than that commands seem identical.[[User:Killzone Kid|Killzone Kid]] ([[User talk:Killzone Kid|talk]]) 14:56, 28 November 2015 (CET)
::I only wrote "believe" because I could be wrong just like Killzone Kid believed what he said was to be true. The only way to be sure is to see the source code for the createVehicle function. From what I experienced I see that the two syntax versions are not the same. The short version ignores the pos Z value and creates vehicles at ground level (Z=0) while the long version does not. Re: your question of being faster, I actually wrote that it's slower. Two selects will most likely be slower unless some compiler optimization happens in the future. --[[User:Zectbumo|Zectbumo]] ([[User talk:Zectbumo|talk]]) 17:29, 1 December 2015 (CET)
::Maybe my confusion was I interpreted Killzone Kid's "the same" as "the same function" instead of "the same speed". I'll add a new entry focusing on equivalence.--[[User:Zectbumo|Zectbumo]] ([[User talk:Zectbumo|talk]]) 17:34, 1 December 2015 (CET)
 
== Historic notes ==
<dt><dt>
<dd class="notedate">Posted on Oct 18, 2009 - 05:42</dd>
<dt class="note">'''[[User:Canukausiuka|Canukausiuka]]'''<dd class="note">
As of Arma2, this command cannot be used to create game logics [http://forums.bistudio.com/showthread.php?t=81964 (source)].  Use [[createUnit]] instead.
<dt><dt>
<dd class="notedate">Posted on August 13, 2006 - 12:18</dd>
<dt class="note">'''[[User:Raedor|raedor]]'''<dd class="note">
Using main syntax of this command sets the created vehicle not exactly at the given position, you have to [[setPos]] it there, if accuracy counts.
<dt><dt>
<dd class="notedate">Posted on Jan 20, 2006 </dd>
<dt class="note">'''[[User:bdfy|bdfy]]'''<dd class="note">
Using main syntax of this command sets the created vehicle in the nearest ''possible'' position. You can create a dozen of tanks with it - they will appear side by side.

Revision as of 01:28, 6 April 2021

KillZone Kid mentions ' "vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", pos, [], 0, "NONE"] ' but this is not entirely true. I believe it should read: "vehclass" createVehicle pos is the same if not faster than createVehicle ["vehclass", [pos select 0, pos select 1, 0], [], 0, "NONE"] --Zectbumo

Why? You say you "believe" it should read that way. Why do you believe that? Please explain. Why does selecting pos's X and Y values, but not it's Z value make it faster? You are still passing a number as the third position array parameter. If anything your example should be slower because you are using the select command twice. --Benargee (talk) 01:48, 28 November 2015 (CET)
I think he is suggesting that the non-array createVehicle syntax will always create vehicles at ground level whereas the array syntax won't necessarily (aka, he's talking about equivalent behaviour rather than speed). I can't verify off the top of my head if that's the case, but in response to the original question: for demonstrative purposes it is assuming the position is at ground level. --SS (talk) 14:47, 28 November 2015 (CET)
Parsing of array of params to the command always takes longer than a single argument. Other than that commands seem identical.Killzone Kid (talk) 14:56, 28 November 2015 (CET)
I only wrote "believe" because I could be wrong just like Killzone Kid believed what he said was to be true. The only way to be sure is to see the source code for the createVehicle function. From what I experienced I see that the two syntax versions are not the same. The short version ignores the pos Z value and creates vehicles at ground level (Z=0) while the long version does not. Re: your question of being faster, I actually wrote that it's slower. Two selects will most likely be slower unless some compiler optimization happens in the future. --Zectbumo (talk) 17:29, 1 December 2015 (CET)
Maybe my confusion was I interpreted Killzone Kid's "the same" as "the same function" instead of "the same speed". I'll add a new entry focusing on equivalence.--Zectbumo (talk) 17:34, 1 December 2015 (CET)

Historic notes

Posted on Oct 18, 2009 - 05:42
Canukausiuka
As of Arma2, this command cannot be used to create game logics (source). Use createUnit instead.
Posted on August 13, 2006 - 12:18
raedor
Using main syntax of this command sets the created vehicle not exactly at the given position, you have to setPos it there, if accuracy counts.
Posted on Jan 20, 2006
bdfy
Using main syntax of this command sets the created vehicle in the nearest possible position. You can create a dozen of tanks with it - they will appear side by side.