Jump to content

Photo
- - - - -

Scripting Discussion (dev branch)

branch development disscussion scripting

  • Please log in to reply
748 replies to this topic
Thread Starter
Dwarden
Dwarden

    BI Developer

  • 9647 posts
  • LocationBrno, Czech Republic

Posted 31 July 2013 - 14:55 #1

Next to already revealed an known https://community.bi...g_Commands_List

There are more script commands now :)

+ New scripting function: magazinesExt (tho it shall be soon to be renamed into magazinesAmmo)
command <vehicle> returns an array of subarrays with type names and ammo left of all the vehicle's magazines
example: magazinesExt player
... sneaky little great script command evaded the changelog


[magazinesExt] has been renamed to [magazinesAmmo] since ver.108360 so take my apology in a situation when this change corrupted your scripts ;)

the second thing: [magazinesAmmo] does NOT return already loaded magazines (e.g. magazine in handgun, etc.)
just because we don't want that behavior for this command. If you need to get info about actually loaded magazines,
you can simply use [weaponsItems](since 108367) or
[primaryWeaponMagazine],[secondaryWeaponMagazine] and [handgunWeaponMagazine]

and the last thing: we are trying to do our best in supporting community
that's why we have decided to create one magazines command in addition named [magazinesAmmoFull] with this output format:

// output format
// ["AmmoClassName"
// ,26 /*ammo count*/
// , true /*currently loaded*/
// , 0 /* 1 = primary mag, 2 = handgun, 4 = secondary, 0 = grenade */
// , "vest"("uniform","backpack") /*stored in ...*/ or "muzzleName" (when currently loaded)]

this command will be available since 108423


+ fixed http://feedback.arma...ew.php?id=12324

+

new commands were added in DEV. 108561: addMagazineGlobal, removeMagazineGlobal, addWeaponGlobal, removeWeaponGlobal




only discussion related to new or changed Arma 3 Beta/Dev Scripting allowed

Edited by Dwarden, 05 August 2013 - 14:06.

RealTimeChat ~ARMA2 in Your browser (w/o Java), RealTimeChat ~ARMA3 in Your browser (w/o Java),
irc.GameSurge.net/ARMA2 (external IRC clients) irc.GameSurge.net/ARMA3 (external IRC clients)
ARMA 3 Feedback Tracker: http://feedback.arma...y_view_page.php
~100k fans @STEAM ARMA 2 + ARMA 2: OA + ARMA 3: + ~2k @XFIRE A2:OA
Follow my Twitter: http://twitter.com/FoltynD or my Facebook http://facebook.com/FoltynD


andro2
andro2

    Newbie

  • Members
  • 1 posts

Posted 31 July 2013 - 21:10 #2

Here for starter




only discussion related to new or changed Arma 3 Beta/Dev Scripting allowed


Hello, this looks like a very useful addition to the API. For some context, I recently submitted the following
request ticket that relates to this type of functionality: http://feedback.arma...ew.php?id=12121
The magazinesAmmoFull function looks like it would address several of the problems that seem to exist in the current API, so this addition would be much appreciated. :yay:

There is probably more that could be said on this topic, but it would be useful to know a little more about some of the underlying design decisions and/or limitations that affect the semantics of the relevant functions.
Is there for example a specific reason for why many of the inventory related functions return class names rather than giving access to the inventory item objects?

andro2

Edited by Dwarden, 31 July 2013 - 22:13.


Zonekiller
Zonekiller

    Gunnery Sergeant

  • Members
  • 494 posts

Posted 31 July 2013 - 21:14 #3

the addMagazineCargoGlobal ect makes life much easier any chance of getting a -- addActionGlobal as well :)

also addUniform and addVest are not global and would be much better if they were.

ProGamer
ProGamer

    Warrant Officer

  • Members
  • 2042 posts

Posted 03 August 2013 - 22:25 #4

The scripting commands: this addMagazine "Magazine Classname";this addWeapon "Weapon Classname"; which allowed you to add weapons from one vehicle to another is broken in Arma 3. It worked in Arma 2 but appears broken in Arma 3.
Made a ticket here: http://feedback.arma...ew.php?id=12324
Running Vault mod: http://forums.bistud...nning-Vault-Mod
Spoiler

SQB-SMA
SQB-SMA

    Staff Sergeant

  • Members
  • 387 posts

Posted 04 August 2013 - 05:59 #5

Erm... so who reported the Dwarden's post? Perhaps they misunderstood the meaning of the thread...

Thread Starter
Dwarden
Dwarden

    BI Developer

  • 9647 posts
  • LocationBrno, Czech Republic

Posted 04 August 2013 - 11:12 #6

Erm... so who reported the Dwarden's post? Perhaps they misunderstood the meaning of the thread...


there was typo in the tittle :) way too many s :)

RealTimeChat ~ARMA2 in Your browser (w/o Java), RealTimeChat ~ARMA3 in Your browser (w/o Java),
irc.GameSurge.net/ARMA2 (external IRC clients) irc.GameSurge.net/ARMA3 (external IRC clients)
ARMA 3 Feedback Tracker: http://feedback.arma...y_view_page.php
~100k fans @STEAM ARMA 2 + ARMA 2: OA + ARMA 3: + ~2k @XFIRE A2:OA
Follow my Twitter: http://twitter.com/FoltynD or my Facebook http://facebook.com/FoltynD


japapatramtara
japapatramtara

    BI Developer

  • 8 posts

Posted 04 August 2013 - 12:35 #7

The scripting commands: this addMagazine "Magazine Classname";this addWeapon "Weapon Classname"; which allowed you to add weapons from one vehicle to another is broken in Arma 3. It worked in Arma 2 but appears broken in Arma 3.


should be fixed now.. see proper feedback tracker thread

Edited by Dwarden, 04 August 2013 - 13:12.


twisted
twisted

    Warrant Officer

  • Members
  • 2695 posts

Posted 04 August 2013 - 23:00 #8

Any more info onBIS_fnc_nearestRoad available? It seems it could be very useful in laying mints, roadblocks etc by script.

afp
afp

    Gunnery Sergeant

  • Members
  • 468 posts

Posted 05 August 2013 - 04:48 #9

Since Java support is on pending, I think its a good idea to add "break" and "continue" keywords to sqf loops, if possible. Some time ago, going through the code written for some mods I found out that most people, even professional guys, were in need of such statements. The code use to shift too much to the right and became hardly readable.

I use to use a trick like bellow to avoid it, still those statements would add a bit of extra power to sqf.

for "_i" from 0 to (count Units - 1) do
{
	if (true) then
	{
               _unit = Units select _i;

               if (!(alive _unit)) 
                         exitWith{}; // skip dead units                

               if (speed _unit > 70) 
                         exitWith{}; // also skip fast units

               process _unit; // code not shifted 8 screens any more
                ....
	};
};


ProGamer
ProGamer

    Warrant Officer

  • Members
  • 2042 posts

Posted 05 August 2013 - 05:14 #10

I was wonder if it was possible to get a command to set the visibility underwater? The visibility underwater can be affected by hundreds of things. http://feedback.arma...ew.php?id=10577 Since visibility can be set on land, why not in water?
Running Vault mod: http://forums.bistud...nning-Vault-Mod
Spoiler

japapatramtara
japapatramtara

    BI Developer

  • 8 posts

Posted 05 August 2013 - 13:53 #11

new commands were added in DEV. 108561: addMagazineGlobal, removeMagazineGlobal, addWeaponGlobal, removeWeaponGlobal

kylania
kylania

    Lieutenant Colonel

  • Members
  • 8281 posts

Posted 05 August 2013 - 15:49 #12

new commands were added in DEV. 108561: addMagazineGlobal, removeMagazineGlobal, addWeaponGlobal, removeWeaponGlobal


The effects of those base commands were already global so what's the difference between addWeapon and addWeaponGlobal?

japapatramtara
japapatramtara

    BI Developer

  • 8 posts

Posted 06 August 2013 - 08:28 #13

well.. not exactly.. when you use player addWeapon "className", all would be fine and the new weapon will be distributed around, but when u use non-local-player addWeapon "className", so weapon will be added only to a instance of non-local player on your client and after few MP engine simulations server returns a correct weaponsList depends on a station where "non-local-player" is local. With addWeaponGlobal you are able to add a weapon to all players even those who are non-local. And vice versa with addMagazineGlobal, etc.. For deeper description of usage, please ask Zonekiller :) He wanted these "Global" commands

gossamersolid
gossamersolid

    Second Lieutenant

  • Members
  • 4459 posts
  • LocationOntario, Canada

Posted 06 August 2013 - 10:54 #14

well.. not exactly.. when you use player addWeapon "className", all would be fine and the new weapon will be distributed around, but when u use non-local-player addWeapon "className", so weapon will be added only to a instance of non-local player on your client and after few MP engine simulations server returns a correct weaponsList depends on a station where "non-local-player" is local. With addWeaponGlobal you are able to add a weapon to all players even those who are non-local. And vice versa with addMagazineGlobal, etc.. For deeper description of usage, please ask Zonekiller :) He wanted these "Global" commands


Very nice, now we can assign weapons/ammo from the server-side and use BE Filters to prevent any clients from executing those commands.
logo.png
ArmA 3 - GWAR3
ArmA 2 - PCDF | Gossamer's Warfare
PC - i5 3570K | EVGA GTX 780 ACX | 16GB DDR3

ProGamer
ProGamer

    Warrant Officer

  • Members
  • 2042 posts

Posted 06 August 2013 - 23:14 #15

When I use the setObjectTexture command, its does not work on some of the vehicles: http://feedback.arma...ew.php?id=12463

I put this into the vehicle init: this setObjectTexture [0,"texture2.jpg"]; this setObjectTexture [1,"texture2.jpg"];
And some vehicles work with it and others don't for some odd reason.
Running Vault mod: http://forums.bistud...nning-Vault-Mod
Spoiler

Larrow
Larrow

    Master Gunnery Sergeant

  • Members
  • 1322 posts

Posted 08 August 2013 - 14:26 #16

Ill quote a quick rant i had in a scripting thread

I wish there was a general listAllVariables command that you can use on objects and namespaces, would make tracking things down so much easier than trying to pull BIS scripts apart then using watch window to see what their global BIS_ variables are doing/set to. We get a nice handy function window but all their variables that they use just seem hidden away and frustratingly painful to track.
Plus their extra debug tools/addon would be good thought i saw a reference to it in the UI files was it @default or @debug.


So any chance of a listAllVariables command. Just to make clear im looking for something that will return a list of all Key/Value pairs from an object/namespace, maybe even with a search criteria e.g[table="width: 500, class: grid"]
[tr]
[td]var name[/td]
[td]var value[/td]
[/tr]
[tr]
[td]LAR_player_money[/td]
[td]100[/td]
[/tr]
[tr]
[td]LAR_random_var[/td]
[td]"whatever"[/td]
[/tr]
[tr]
[td]LAR_player_score[/td]
[td]5[/td]
[/tr]
[tr]
[td]LAR_player_rank[/td]
[td]"Corporal"[/td]
[/tr]
[/table]
_playerVars = player listAllVariables ["LAR_player_"]
//_playerVars = [["LAR_player_money",100],["LAR_player_score",5],["LAR_player_rank","Corporal"]]
I would find this useful for both mission scripting and for debugging.

______________________

Seeing as there is now Physx in the game, does it produce any useful resources to constraints or is there access through the engine without modeling. So we can attach things via joints? e.g
_myConstraint1 = attachConstraint [[object1,pos/offset/memoryPoint],[object2,pos/offset/memoryPoint],"BallAndSocket"];
_myConstraint1 setConstraintLimits ["cone",[axis_x, axis_y, axis_z], angle, [shaft_x, shaft_y, shaft_z], friction];
//axis is a vector specifying cone orientation relative to object1 modelspace, angle at the base of the cone, shaft is a vector specifying shafts orientation relative to object2 modelspace, shaft is constrained to stay within the cones limits??

Im thinking heli lifts where the object your lifting is not statically tied to the bottom of your helo.
Vehicle towing were the line behind you twists rather than a static line of attached vehicles that raise in the air/clip through the floor on the lead vehicles gradient changes.

Only asking :P "hinge" type would be useful aswell :D

Edited by Larrow, 08 August 2013 - 14:44.


kremator
kremator

    Major

  • Members
  • 7529 posts

Posted 08 August 2013 - 23:20 #17

A fully articulated lorry is a dream :)

Thread Starter
Dwarden
Dwarden

    BI Developer

  • 9647 posts
  • LocationBrno, Czech Republic

Posted 09 August 2013 - 13:45 #18

New scripting command for creating crew for given vehicle:
createVehicleCrew

RealTimeChat ~ARMA2 in Your browser (w/o Java), RealTimeChat ~ARMA3 in Your browser (w/o Java),
irc.GameSurge.net/ARMA2 (external IRC clients) irc.GameSurge.net/ARMA3 (external IRC clients)
ARMA 3 Feedback Tracker: http://feedback.arma...y_view_page.php
~100k fans @STEAM ARMA 2 + ARMA 2: OA + ARMA 3: + ~2k @XFIRE A2:OA
Follow my Twitter: http://twitter.com/FoltynD or my Facebook http://facebook.com/FoltynD


NeoArmageddon
NeoArmageddon

    First Sergeant

  • Members
  • 826 posts

Posted 09 August 2013 - 13:56 #19

New scripting command for creating crew for given vehicle:
createVehicleCrew


Woho! Great new scripting commands! This comes in handy!

Varanon
Varanon

    Master Gunnery Sergeant

  • Members
  • 1292 posts

Posted 14 August 2013 - 19:18 #20

I just noticed that in the latest dev build, fadeSound doesn't seem to work anymore. Is that intentional ?

Correction: fadeSound does not fade ambient sound, only shots fired, steps etc... the crickets and environment sounds remain...

Edited by Varanon, 14 August 2013 - 19:21.

Posted ImagePosted Image
Missions: FHQ Arma 3 Coop missions | FHQ Coop Pack Arma 2: #1 #2
Join CUP for a unified Arma2 asset porting: Forum Website



Also tagged with one or more of these keywords: branch, development, disscussion, scripting