Jump to content
Sign in to follow this  
Guest

Scripting

Recommended Posts

Couldn't find this mentioned in the thread already, but having the following attachTo-related functions brought over from VBS2 would be invaluable: isAttached, attachedObject & attachedObjects.

Edit: Can this type of thing be put on the DH: Issue Tracker, even though it's a feature request?

Edited by JamesF1

Share this post


Link to post
Share on other sites

Vital Commands needed since OFP:

cansee - Example name of a command that would check LOS in a quick and efficient way that would nullify sheafs of user code to work around this missing element.

lockonto - force AI pilot to tab lock a target object. Does not need to be any object but rather legal configd enemy objects. There is no way to tell the AI to lock onto anything that it does not want to internally.

islockedonto -check to see if the lock on by AI pilot is complete.

fired event handler change- WE NEED THE PROJECTILE OBJECT in the returned array. Whenever we want to find the projectile "bullet" object we have to run a fast loop to scan for nearest objects and find a matching type. there is no built in way to find the projectile otherwise. While a clever method it is a resource pig and could get fouled up if another projectile of the same type happens to be in the list. If the mission is very resource hungry the checking method starts to fail which causes reliability issues and can kill the original idea entirely. Being able to track where projectiles go and land in scripting easily would be a godsend.

disableAI "" -needs more switches. Add "Rotate" since that has been changed.

"behaviour" cannot change from current

"combatmode" cannot change from current

So no default behaviour interferes with scripted AI ever again.

Please add scripting commands to drive all modules in scripts as well as in editor. I should have AI commands that work through the Med Modules and lets me tell the AI to drag/carry/heal as I wish. I cannot seem to add spawned units to modules but someone correct me if I am wrong.

First Module Commands:

docarry

dodrag

dofirstaid

commandcarry

commanddrag

commandfirstaid

Carry the same idea over to the other modules as well

This is a no brainer. Please somebody tell me this is a bad idea and why.

Make dofire absolute and do not deny the users wish to have the AI fire at a target just because someone at BIS has decided that the target is too far away. I have found the AI will engage over long ranges as long as one side of the party starts the ball rolling by firing at a distant enemy past the hard coded AI vision.

Fire command needs to stop making the units aim up in the air. They have done this since OFP. For all that is holy please make them stop doing that allready.

Thats all for now folks :)

Edited by TJ72

Share this post


Link to post
Share on other sites

BIS in their missions use a nice "wpgroup" trick, that helps declutter the editor screen greatly. Setup a unit (side determines side of joining group, so be careful) with this in is init: "wpgrpa = group this; deleteVehicle this". Now setup a patrol somehwere, and when something happens, you can simply tell that group to joinSilent wpgrpa, and they will start performing those waypoints. Means you can have whatever group is closest at the time join, instead of having all waypoints for all groups that would be potential candidates, and no switch trigger needed.

Always wanted a way to "select waypoint sets" easily, just in OFP DR, and it turns out we actually can. Just never realized this.

A small issue with this, the default group designation, i.e 1-1-A is maintained when switching groups like this. But not setGroupId. So when my setGroupId'd "Razor Team" reports in after having joined wpgrpa, sideChat will show up as "1-1-A" instead of "Razor Team".

So, we need to get a new getGroupId command, so we can transfer the Id from one set of waypoints to another. Or better yet, make it so that setGroupId actually stick to their internal group designation (1-1-A), as long as the group they join was empty or didn't have a groupId.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

Biki for setWaypointScript states that the executed script must be sqs. Would be beneficial to be able to use sqf. :)

Edit:

Another one, but this one is likely rather obscure.

Let's say I have something like [param1] execVM "somescript.sqf" and then in somescript.sqf, something like:

_param1 = _this select 0;
_param2 = _this select 1;
if (isNil "_param2") then {_param2 = somevalue};

Currently, at least in my limited experience, the _param2 is an "any" not a nil, so the conditional doesn't work. I kinda understand why, but it would be handy to have it regarded as a nil for a check like that. That way, if I'm running a script that has 1 required parameter, and then a bunch of optional ones, the isNil conditional can work to set the default values.

Granted, there is likely another way to do this, I just haven't found it. :)

Edited by TRexian

Share this post


Link to post
Share on other sites

One from me: The ability to exclude a stance for AI when in combat/stealth mode. Like if i wanted the AI in combat mode, but not to go prone while bounding. For example:

this excludeunitpos "DOWN";

Share this post


Link to post
Share on other sites

Agreed, except on the implementation of a new command. Could have been done using setUnitPos "NOTDOWN", "NOTMIDDLE", and "NOTUP", all implying "AUTO" otherwise. Also I would further like to have "HALTUP", "HALTMIDDLE", and "HALTDOWN" (as long as combat.fsm doesn't kick in), meaning that when a unit is not on the move he will take the suggested position. It feels to lame dealing with halting units (waiting for waypoint to complete) standing up when you're trying to make them appear cautious.

Share this post


Link to post
Share on other sites

The following 2 commands search by type and classname. I'd like the filter to include an array of units. eg:

_array_group_player = units (group player);

getPos player nearestObject _array_group_player;

// returns closest unit in the players group to the player

nearestObjects [player, _array_group_player, 100]; 

// returns units in players group ordered by distance within 100m

Share this post


Link to post
Share on other sites
The following 2 commands search by type and classname. I'd like the filter to include an array of units. eg:

_array_group_player = units (group player);

getPos player nearestObject _array_group_player;

// returns closest unit in the players group to the player

nearestObjects [player, _array_group_player, 100]; 

// returns units in players group ordered by distance within 100m

IMHO stuff like this is much too specific to be usefull as native command (and this makes any language fugly as hell and finally a nightmare to use). Simply write yourself a function that filters nearestObjects "Man" for units that meet some condition (beeing in a certain group). And voila. Problem solved.

And if you need such a filter function, here you got one:

/*
  Author:
   rübe

  Description:
   returns a filtered list, not touching the original one,
   by means of a custom filter. 

  Parameter(s):
   _this select 0: list (array)
   _this select 1: filter (code)
                   - the filter gets passed the current item
                   - the filter has to return boolean:
                     - true: keep
                     - false: discard

  Returns:
   array
*/

private ["_filtered", "_i"];

_filtered = [];
_i = 0;

{
  if (_x call (_this select 1)) then
  {
     _filtered set [_i, _x];
     _i = _i + 1;
  };
} forEach (_this select 0);

_filtered

Thus - assuming we've compiled that function to RUBE_arrayFilter - you might write something like:

_nearestUnit = objNull;
_nearestUnits = [
  // input to be filtered
  (nearestObjects [player, ["Man"], 200]),
  // filter function
  {
     if ((group _this) == (group player)) exitWith { true };
     false
  }
] call RUBE_arrayFilter;

if ((count _nearestUnits) > 0) then
{
  _nearestUnit = _nearestUnits select 0;
};

Share this post


Link to post
Share on other sites

Arma needs complete scripting engine redesign( or use external scripting engine...lua), it has so much flaws (missing commands, not logics statments,etc.). I can not complete 3/4 of my ideas, because of missing commands,.... like getWaypointType(i need to implement my own waypoint "system"), a lots of information missing, lowlevel aiming, lowlevel path finding heuristics manipulation,...

Edited by PJani

Share this post


Link to post
Share on other sites

sory for bad english.

I meant function, statement format is not strict.

like

x atan2 y, why is not atan2 [x,y], because x is not object.

if i completely understand language structure. if some variable is before "function" then function is method of that variable(object).

x atan2 y is like x.atan2 y but this doesnt make any sense, because x is not object.

it would be nice if unit data would be accessable via arrays(maybe readonly data).

the dot between object and method would make language more readable!

Share this post


Link to post
Share on other sites

A command to remove individual weapons/items from weapon cargo; right now you've got to remove all of 'em or nothing.

Share this post


Link to post
Share on other sites
Arma needs complete scripting engine redesign( or use external scripting engine...lua), it has so much flaws (missing commands, not logics statments,etc.). I can not complete 3/4 of my ideas, because of missing commands,.... like getWaypointType(i need to implement my own waypoint "system"), a lots of information missing, lowlevel aiming, lowlevel path finding heuristics manipulation,...

Yes. YES.

I suggested this a year ago or more and i got flamed by retarded fanboys.

This engine is not great, switch to Lua, PAWNO, Squirrel or almost anything else.

Seriously. I am a programmer and this scripting engine defies everything we've learned up until now. It goes against every natural instinct a real scripter/programmer might have.

Plus Lua would allow people to write modules to expand the scripting engine themselves, to, i dunno, use MySQL or an unlimited amount of other ideas.

Share this post


Link to post
Share on other sites

Lua, my loved lua.

I had never before know how to script or such, never done it before. But when i tried OFP:DR and tested Lua, i learned quick and it was easy to script with it. But OFP:DR Did suck alot, and had maximum of 60 players in editor or so. Would love if they had Lua in Arma 2, or as an option or so.

Share this post


Link to post
Share on other sites

Read and Write to text file. So that information can be stored for future purposes (like campaign dynamics, mission variables, statistics board)

Share this post


Link to post
Share on other sites

Maybe you can fill the empty seat with a game logic? Or just kick any unit out that is occupying a seat it shouldnt have.

Share this post


Link to post
Share on other sites
Lua, my loved lua.

I had never before know how to script or such, never done it before. But when i tried OFP:DR and tested Lua, i learned quick and it was easy to script with it. But OFP:DR Did suck alot, and had maximum of 60 players in editor or so. Would love if they had Lua in Arma 2, or as an option or so.

lua ? c++ in FSM !! :P

why not pythoon ? anybody loves pythoon?

why not tcl ?

or erlang ?

p.s.

3rd-party stuff in product - "bad thing" and last-resort move. like LUA.

Share this post


Link to post
Share on other sites
why not pythoon ? anybody loves pythoon?

Don't know whether or not you're joking, but I would actually support Python for object oriented scripting.

Python is awesome.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×