Jump to content
Sign in to follow this  
toadlife

Scripting command request

Recommended Posts

I small request for the BIS guys - The following command would be nice to have (to return handguns):

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

tertiaryWeapon vehicle

Operand types:

vehicle: Object

Compatibility:

Version 1.?? required.

Type of returned value:

String

Description:

Returns name of vehicle's tertiary weapon (empty string if none).

Example:

tertiaryWeapon player<span id='postcolor'>

Thanks!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (GAMEER_77 @ Dec. 03 2002,11:57)</td></tr><tr><td id="QUOTE">Another could be getheaddir and setheaddir wink.giftounge.gif<span id='postcolor'>

Hmm, howzabout "obj setDir heading" and "getDir obj"?

But what I truly wish for are the commands for setting pitch and bank of objects. That's the one major thing missing.

Share this post


Link to post
Share on other sites

what we REALLY need is to be able to name a unit which has been created by createUnit and that it doesn't need a group:

_bob = "soldierWMedic" createUnit [(getMarkerPos "spawn")]

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Spitfire @ Dec. 04 2002,16:31)</td></tr><tr><td id="QUOTE">But what I truly wish for are the commands for setting pitch and bank of objects. That's the one major thing missing.<span id='postcolor'>

Seconded.

Prospero.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Spitfire @ Dec. 04 2002,16:31)</td></tr><tr><td id="QUOTE">But what I truly wish for are the commands for setting pitch and bank of objects. That's the one major thing missing.<span id='postcolor'>

I agree on this one, but in a different manner:

getNormal object

returns the normal vector of an object

getNormal [X, Y]

returns the normal vector of terrain at [X, Y]

object setNormal [X, Y, Z]

sets the normal vector of an object

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Skumball @ Dec. 04 2002,17:23)</td></tr><tr><td id="QUOTE">what we REALLY need is to be able to name a unit which has been created by createUnit and that it doesn't need a group:

_bob = "soldierWMedic" createUnit [(getMarkerPos "spawn")]<span id='postcolor'>

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierWB" createUnit [getMarkerPos marker1, groupAlpha, "bob=this"]<span id='postcolor'>

Works fine for naming a unit (little pbs for local variables, but can be sorted out).

About the group, it would definatively make things easier.

But this 2 points can ben sorted out currently :

What I do is create a dummy unit f the desired side, let's say dummyEast.

When I create a unit, I put it in dummyEast's group, then immediatly remove dummyEast from the group (dummyEast join grpNull)

It's like creating a unit in its own group.

And for the name, I use a generic name in the init field in the createUnit command (newEast=this), and then associate a local variable (_b=newEast) so that other instance of the script do not interfere.

Whis'

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (toadlife @ Dec. 03 2002,05:34)</td></tr><tr><td id="QUOTE">I small request for the BIS guys - The following command would be nice to have (to return handguns):

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

tertiaryWeapon vehicle

Operand types:

   vehicle: Object

Compatibility:

   Version 1.?? required.

Type of returned value:

   String

Description:

   Returns name of vehicle's tertiary weapon (empty string if none).

Example:

   tertiaryWeapon player<span id='postcolor'>

Thanks!<span id='postcolor'>

I was going to post something about handguns when I saw your thread. What is exactely this supposed to do? Sorry but I fail to understand this script. sad.gif

What I miss is the following:

Having your main gun on your back makes your behaviour mode to be "SAFE" and when you grab it in your hands, player's behaviour is automatically set in "AWARE" mode. That's cool because with a simple script line, AI units are able to identify this movement as a menace and can give proper reaction. Then if a policeman sees you walking by with an M16 he won't care about this fact wow.gif , but if you addopt combat position he will try to shoot you.

Unfortunately this is not true for handguns. It makes no difference either having them on your back or in your hand. It would be very useful for covert mission design if having the pistol on hand sets unit behaviour in "AWARE" instead of leaving it in "SAFE"

Regards

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Holy Smoke @ Dec. 10 2002,05:07)</td></tr><tr><td id="QUOTE">I was going to post something about handguns when I saw your thread. What is exactely this supposed to do? Sorry but I fail to understand this script. sad.gif

What I miss is the following:

Having your main gun on your back makes your behaviour mode to be "SAFE" and when you grab it in your hands, player's behaviour is automatically set in "AWARE" mode. That's cool because with a simple script line, AI units are able to identify this movement as a menace and can give proper reaction. Then if a policeman sees you walking by with an M16 he won't care about this fact wow.gif , but if you addopt combat position he will try to shoot you.

Unfortunately this is not true for handguns. It makes no difference either having them on your back or in your hand. It would be very useful for covert mission design if having the pistol on hand sets unit behaviour in "AWARE" instead of leaving it in "SAFE"

Regards<span id='postcolor'>

It has nothing to do with behavor or detecting weather or not a unit has his weapon drawn.

In 1.75 the great folks at BIS added two very usefull commands, "primaryweapon", and "Secondaryweapon".

primaryweapon will return the weapons a vehicle has in its primary weapons slot, and secondayweapon will return weapons in the secondary weapons slot like.

For example If a soldier named "dude" has and m16 and a law launcher, the command primaryweapon dude will return "m16"

the command secondaryweapon dude will return "LAWLauncher"

If dude has a beretta there is no command that will return that weapon.

Hence my asking for a tertiaryweapon command.

For now I can extract the handgun a unit is carrying by doing this workaround:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_tertiaryweapon = (weapons dude - [Secondaryweapon dude,Primaryweapon dude]) select 0<span id='postcolor'>

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (toadlife @ Dec. 11 2002,18:37)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_tertiaryweapon = (weapons dude - [Secondaryweapon dude,Primaryweapon dude]) select 0<span id='postcolor'><span id='postcolor'>

Doesn't look like it is very painful to add that line for a mission designer. confused.gif NOrmally people ask for features when the workaround is difficult or impossible. wink.gif

But of course it would be logical to have a proper command for it... smile.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Dec. 11 2002,17:06)</td></tr><tr><td id="QUOTE">Doesn't look like it is very painful to add that line for a mission designer. confused.gif NOrmally people ask for features when the workaround is difficult or impossible. wink.gif

But of course it would be logical to have a proper command for it... smile.gif<span id='postcolor'>

Actually I has just thought of the workaround, and tested it 5 minutes before I posted it. tounge.gif I probably should have thought of it before, but still - having the command wouldnt hurt.

Share this post


Link to post
Share on other sites

I'd like a continuation of the create commands. We've got createvehicle and createunit now I'd like a createobject command or for more objects to be supported by createvehicle. I'd like to see a way to place trees, bushes, and walls without resorting to an addon.

thanks,

Plaz

Share this post


Link to post
Share on other sites

I'd love to see the following commands:

MagazinesInCargo <ammo-crate>

WeaponsInCargo <truck>

WeaponsInCargo <Weaponholder>

...

or has anybody found a workaround to get information about weapons/ammo in Cargo?

I'll even tried the weaponpool, but this only seem to work in campains confused.gif

Share this post


Link to post
Share on other sites

Another lovely thing would be ingame-dialogs, by this I mean dialogs which don't disable the movement keys. They are espescially useful to display information, which are permanent on the screen, but can be changed like Aktive Text through scripts.

Share this post


Link to post
Share on other sites

I would like to see something like "disableUnit" and "enableUnit". Disabling an unit disable everything related to it (make it disappear, disable all AI code, etc.) and enabling it would bring it back to life.

This would make it alot easier to make huge battles that wouldnt run 1fps, creating units with createUnit is very rather slow and alot of work. Instead, I could just put all the units, waypoints, etc. in the mission editor and put "disableUnit this" in the initlines of those which are very far away from players. Then, put a trigger around the area, which would enable the units when the player is nearby.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">This would make it alot easier to make huge battles that wouldnt run 1fps, creating units with createUnit is very rather slow and alot of work<span id='postcolor'>

This not solve the loading problem, try to put 1000 units on a map and look at the loading time.

But the idea is good, or do the "asleep" in the editor so the unit or group is not load...

We need something like that, it's sure.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Another lovely thing would be ingame-dialogs<span id='postcolor'>

How know where you are in the game or the dialog? With the mouse position, but the mouse command direction of the dude..

Or a control or alt key, when you press it you are in the dialog, else in the game, possible and not a lot of scripting (for us biggrin.gif )

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Dschulle @ Jan. 03 2003,09:09)</td></tr><tr><td id="QUOTE">I'd love to see the following commands:

MagazinesInCargo <ammo-crate>

WeaponsInCargo <truck>

WeaponsInCargo <Weaponholder>

...

or has anybody found a workaround to get information about weapons/ammo in Cargo?

I'll even tried the weaponpool, but this only seem to work in campains confused.gif<span id='postcolor'>

Hi,

I had suggested a different approach to this some time ago, never got any feedback on it, but maybe it is still in Sumas head somewhere. wink.gif

What I had in mind is for the group commander to have a kind of vehicle information tab. With all vehicles occupied by his men, appropriate vehicle specs like carry capacity, cargo load capacity, towing weight-(j/k), and how full the cargo load is, possibly with what equipment. Oh and fuel, damamage status would be ok also. (I know that cargo equipment list is actually realistic, not most of the rest)

I did not think of scripting functions, but I think it would be good to have parallel script access to everything available in such an informational tab.

Voicing my suggestion that's all.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Kegetys @ Jan. 07 2003,10:46)</td></tr><tr><td id="QUOTE">This would make it alot easier to make huge battles that wouldnt run 1fps, creating units with createUnit is very rather slow and alot of work.<span id='postcolor'>

Let EnemyStack do the work for you. wink.gif Actually that is a good idea, but how to implement it is beyond me. The conditions... not every unit that is far should be treated like this, actually which ones should be? There are more problems to this than meets the eye for sure. confused.gif

EDIT: Ah, you want to control this manually... probably enableUnit will be as painful/slow as createUnit. wink.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Jan. 07 2003,21:05)</td></tr><tr><td id="QUOTE">EDIT: Ah, you want to control this manually... probably enableUnit will be as painful/slow as createUnit.  wink.gif<span id='postcolor'>

Well, at least for me its alot easier to use the mission editor to place units in different places, give waypoints to them and so on... doing all this from scripts is alot more work

Share this post


Link to post
Share on other sites

But how do you chose when to re-activate and re-deactivate them. You will have to do some substantial trigger or distance work.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Jan. 07 2003,21:53)</td></tr><tr><td id="QUOTE">But how do you chose when to re-activate and re-deactivate them.  You will have to do some substantial trigger or distance work.<span id='postcolor'>

That kindof depends on the mission, but for example one simple way would be to make a loop, which checks for player distance to to all the disabled unit groups and sets a variable if the player is close to a group. Then a trigger would get launched which would enable those units.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Kegetys @ Jan. 07 2003,15:13)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ Jan. 07 2003,21:53)</td></tr><tr><td id="QUOTE">But how do you chose when to re-activate and re-deactivate them. You will have to do some substantial trigger or distance work.<span id='postcolor'>

That kindof depends on the mission, but for example one simple way would be to make a loop, which checks for player distance to to all the disabled unit groups and sets a variable if the player is close to a group. Then a trigger would get launched which would enable those units.<span id='postcolor'>

Well, that's not so bad... and there is a use for the command depending on the type of mission/goal you are looking for.

For instance, I would not be satisfied with the command, as the forces I want to deal with, I would not even want to place on the map. (up to thousands of possible troops for an ongoing battle or a whole campaign)

I'm sure if it's reasonably easy to implement then it will be looked at as usual. smile.gif

Share this post


Link to post
Share on other sites

TypeOf variable

For intercept errors

Associate a script to a dialog.

_ok = createDialog ["RscDisplayGame","RscDisplayGame.sqs"]

For the moment I can't use CT_OK, cause sometime the dialog is close before the script and controls returns -1. So I need to use simple button and manage it.

More

_Before = _This select 0

_During = _this select 1

_After = _this select 2

Or

_ok = createDialog ["RscDisplayGame","ScriptDuring.sqs","ScriptBefore.sqs","ScriptAfter.sqs" ]

The same for controls

A script when you are in and a second out

Or

? ControlInUse 100 : goto "100"

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  

×