Jump to content
Sign in to follow this  
XCess

Invisible Targets

Recommended Posts

If I remember correctly, there was an addon of invisible targets released quite a while back, I've searched everwhere I can think of, ofp.info, google, ofpbase, ofpfiles, but I can't find this addon anywhere?

Is my mind playing tricks on me? If not, does anyone know where I could find them?

Also, I thought there was a "missing addon" threa? Would have posted in there, but I didn't see it anywhere, maybe I'm just going blind crazy_o.gif

Share this post


Link to post
Share on other sites

There is some Awsome Invisable targets in this pack

BIS Thred 1

Edit:

Quote[/b] ]7). INVISIBLE Targets by Terox (Initial idea by BAS)

If you want ai manned aircraft to fire their cannons at infantry units or you want R.P.G’s to be fired at player infantry units, then using a suitable invisible target setposs’d above or to the side of them will get that effect

Share this post


Link to post
Share on other sites

I went to both sites for the invisible targets, and both are great! How would I attach an invisible target to a close spot near my unit? This is the pack that I'm using:

http://www.flashpoint1985.com/cgi-bin....t=53079

It says to setpos by a script, but doesn't give a full example of how to write it. I'm learning how to script as I go, so any help would be much appreciated. I also depboed the example mission to see what was needed and made a simple mission using the template....This is what I used to attach the invisible target to my unit....What am I missing?

EXAMPLE CODE SNIPPET:

                  #LOOP

                            _delay = random 30

                            ~ _delay

                            _unit = (code to randomly select a _unit)

                            _invis          = (invisible target)

                            _position    = [(getpos _unit select 0), (getpos _unit select 1),1.5]

                            ~5

                            _invis setpos _position

                            ~10

                            _invis setpos [0,0,0]

                  goto “LOOP†     

This was taken right from the readme....It's gonna show I'm a newbie with scripts....I tried naming the script with different names and it only attacks the target where I place it in the editor.

Goal...An airplane that will not engage the infantry(most planes don't anyway), but with this script/setup it will. Also will force the infantry(player) to move just a little bit faster through a battlefield for a certain time...

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0

_invisi = _this select 1

_grp = group _unit

_max = count _grp

_array = units _grp

_xP = 0

#loop

_xP = random _max

_aP = _array select _xP

_x = (random 10)-5

_y = (random 10)-5

_invisi setPos [(getPos _aP select 0)+_x,(getPos _aP select 1),0]

? hideInvisible : goto "hideInvisible"

? hideAndEnd : goto "hideEnd"

~(random 7)

goto"loop"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#hideInvisible

_invisi seetPos [0,0,0]

? continueInvisi : hideInvisible = false; goto"loop"

~1

goto"hideInvisible"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#hideEnd

_invisi setPos [0,0,0]

deleteVehicle _invisi

exit

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Execution: [unitName,inVisibleTargetName] exec"script.sqs"

There are three global boolean variables (true/false) that can hide the invisible target, delete the invisible target and end script, and continue the script if invisible target is hidden.

These are:

hideInvisible - This will hide the invisible target. It can still be returned.

continueInvisi -This will reset hideInvisible and continue the loop.

hideEnd - This will hide and destroy the invisible target. The script wil end

All of these variables can be changed in a trgger onActivation field or a script by the following:

variableName = true

NOTE: This script has not been tested, and I have just woken up, so it is possible the script could be riddled ith errors. Sorry if that is the case.

Share this post


Link to post
Share on other sites

I got the script to work in game without any errors so far, but I don't know if I got it right. 1 the AI still won't attack every time(only got it to work once) and 2 the invisible target won't follow me to keep up the attack. As in my last post I used the template to make sure everything was present. Then added 1 trigger to activate the sample script and made no changes to it except here:

#hideInvisible

_invisi seetPos [0,0,0]

? continueInvisi : hideInvisible = false; goto"loop"

~1

goto"hideInvisible"

-----------------------------

Where false it true.

Also does it matter where I put the invisible target? I put on the water very far away so the AI won't attack the placed invisible target in game. Thanks for your help, it's very much appreciated. If you want me to send you my small mission I can. It's just a small part to get the AI attacking a 4 man squad.

Share this post


Link to post
Share on other sites

_invisi setPos [(getPos _aP select 0)+_x,(getPos _aP select 1),0]

needs to be changed to

_invisi setPos [(getPos _aP select 0)+_x,(getPos _aP select 1)+_y,0]

Haven't looked through it thoroughly,but that error stood out.

**edit** I see the problem, I need to make the random number an intergar icon_rolleyes.gif I'll do that in a little while.

Share this post


Link to post
Share on other sites

Thank you for your help with this. I've got all the scripting info from OFPEC, but sometimes I get stuck. I'll check back later. Thanks again....Cheers!

Share this post


Link to post
Share on other sites

XCess,

I found another way to get the invisible target to follow me, but I don't know how to get the invisible target to be turned off for a certain amount of time, or deleted. I'm using a tow script that I found at OFPEC. I think it would be easier to do with a script though. I changed the line of code you told me about, and that caused an error with the script. Thanks for trying to help me.

Share this post


Link to post
Share on other sites

What was the error you got from the script BigBen, need that to be able to help you out wink_o.gif

Share this post


Link to post
Share on other sites
What was the error you got from the script BigBen, need that to be able to help you out wink_o.gif

Ok, here is what I've got so far.

_unit = _this select 0

_invisi = _this select 1

_grp = group _unit

_max = count _grp

_array = units _grp

_xP = 0

#loop

_xP = random _max

_aP = _array select _xP

_x = (random 10)-5

_y = (random 10)-5

_invisi setPos [(getPos _aP select 0)+_x,(getPos _aP select 1),0]

? hideInvisible : goto "hideInvisible"

? hideAndEnd : goto "hideEnd"

~(random 7)

goto"loop"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#hideInvisible

_invisi seetPos [0,0,0]

? continueInvisi : hideInvisible = false; goto"loop"

~1

goto"hideInvisible"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#hideEnd

_invisi setPos [0,0,0]

deleteVehicle _invisi

exit

===============================

Where this line of text:

_invisi setPos [(getPos _aP select 0)+_x,(getPos _aP select 1),0]

was changed to:

_invisi setPos [(getPos _aP select 0)+_x,(getPos _aP select 1)+_y,0]

================================

Now after I changed the code above the error message reads:

'_max = count: _grp|#|': Error count: Type Group, expected Array

================================

I have 1 trigger activated by the west side. I put this line in the on activation...

[unitName,inVisibleTargetName] exec"script.sqs"

This is what it looks like:

[p1,it1] exec"DGT.sqs"

================================

Problems:

1.) P1 has the invisible target attached to it with the script, but the enemy air will not engage the player's infantry.

2.) Not sure if the invisible target moves with the player by using the script, because of the 1st problem.

If you would like to see my basic set up I can send you what I have done through the editor. I also have a pic of the error if you would like to see it.

**edit**

My trigger is set to true, and this it the pic in game too.

http://img121.imagevenue.com/img.php?image=17040_error_122_429lo.jpg

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  

×