Jump to content

Sign in to follow this  
Harnu

Tracking the shot?

Recommended Posts

Does anyone know of as script or could write one that tracks where a shot goes?

I wan't to practice artillery in the mission editor. Just to see if it's possible so in MP maybe I could do some fire support lol.

I need a script that will either just show where the shot lands, or where it's traveling AND where it lands.

I tried writing my own but I really don't know what to do lol.

Share this post


Link to post
Share on other sites

Anything with more than 1 script in it makes Harnu go crazy.gifcrazy.gif

lol. Anyway, Can you explain one little other thing about scripting to me.

x0 = _this select 0

x1 = _this select 1

x2 = _this select 2

x3 = _this select 3

x4 = _this select 4

I think 0 is the actual player. What are 1,2,3,4 and all the other ones that are always used in the beginning scripts?

Share this post


Link to post
Share on other sites

I guarantee that every question you will ask is at OFPEC. smile.gif

Ill be nice and give another link. smile.gif

http://www.ofpec.com/editors/script_view.php?id=304

Here is the actuall article:

Submitted by: Credits: Careybear

What the hell is _this?

The object _this varies depending on the context. It is applicable to scripts and eventHandlers.

In a script, the object _this refers to the parameters passed to the script.

eg: [player, "helloworld"] exec "script.sqs"

in this case, the object _this refers to the array - ie:

_this = [player, "helloworld"]

so by standard array referencing:

_this select 0 = player

_this select 1 = "helloworld"

with eventhandlers, _this is a specific array containing predefined information. The "killed" eventHandler _this object, for example, contains the dead unit & the killing unit. The "GETIN" _this object contains the vehicle, the location ("driver", "gunner", "commander" or "cargo") and the unit that boarded.

Actually answering your question:

The simple technique for examining any data you want to know the structure of is to place a line like this in the script (or 'command string' in the case of eventhandlers) which goes like:

hint format ["%1", _this]

In the example above, you'll get a little hint box which reads something like:

[Alpha Black 1(CareyBear), "helloworld"]

Hope that helps.

Notes:You cannot refer to a unit by it's universal ID (ie: Alpha Black 1). You have to assign it to a global variable and then refer to the variable. For eventhandler, each eventhandler is different, suggest you try the one you want to use with the hint technique to find out exactly what it returns. Eventhandlers only apply to version 1.85 and above

Submitted on: December 10, 2002, 00:10

Share this post


Link to post
Share on other sites

A little bit offtopic:

We make always some "arty" support, with m2... mostly me (as a black-op) hiding in the bushes, with a binocular... the other guy sitting in the m2 turret, fires one... i tell him how to adjust, then he fires a few in a very small circle... (3-7) after this he doesn't moves the turret, and i can tell him how to adjust next time, to make a killer shot...

if the area is clear, you can go to get the enemy flag, or move away, etc. wink.gif

CU.

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  

×