OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: jens198 on 03 Jun 2004, 20:32:02

Title: Problems with moving targets
Post by: jens198 on 03 Jun 2004, 20:32:02
Hi,

found this script in an old sniper-range mission (as far as I can remember it was made by Bremmer).
Tried this with OFP 1.96. Problem is, that it won't work.

Even the first two lines (which should hide the targets beneath the earth) don't do a damm thing.
Same with the moving targets down below.
Any ideas what's going wrong here?

Any help is welcome.

Thanks
Jens


--------------------------------------------------------------------------------
_targets = [tag_1,tag_2,tag_3,tag_4,tag_5,tag_6]
"_x setpos [getpos _x select 0, getpos _x select 1, -2]" foreach _targets

#select
? count _targets == 0 : Hint "All Targets destroyed"; exit
_random = random (count _targets)
_random = _random - _random % 1
_target = _targets select _random

_pos = getpos _target
_x = _pos select 0
_y = _pos select 1
_z = _pos select 2

_delta = 2
_increment = 0

#up
~0.01
_target setpos [_x,_y,_z + _increment]
_increment = _increment + 0.05
? getpos _target select 2 < _z + _delta : goto "up"

~(random 2) + 2

#down
~0.01
_target setpos [_x,_y,_z + _increment]
_increment = _increment - 0.05
? getpos _target select 2 > _z : goto "down"

? getdammage _target > 0.9 : _targets = _targets - [_target]
~(random 2) + 2

goto "select"
Title: Re:Problems with moving targets
Post by: Blanco on 03 Jun 2004, 21:50:09
Maybe a stupid Q...

Are you're targets named :
tag_1,tag_2,tag_3,tag_4,tag_5 and tag_6?

Title: Re:Problems with moving targets
Post by: jens198 on 03 Jun 2004, 22:21:57
 ;D Yep, names are ok.

Could be modifications like ECP (im using the Y2K3 Modification) cause such trouble?

Jens
Title: Re:Problems with moving targets
Post by: jens198 on 12 Jun 2004, 22:40:57
no ideas anyone? I know this script worked for me.

jens
Title: Re:Problems with moving targets
Post by: macguba on 14 Jun 2004, 13:59:57
"_x setpos [getpos _x select 0, getpos _x select 1, -2]" foreach _targets

Does this work if you substitute in one of the named targets manually?   It seems very odd that the first two lines don't work.     I take it they just sit on the ground with no error message.
Title: Re:Problems with moving targets
Post by: jens198 on 14 Jun 2004, 14:37:36
Hm, seems like I fixed it. But it's strange. I made my own targets and configured them as "tanks" (so that my tanks at the shooting range would shoot at them). Ingame they appear as EAST/OBJECTS and EMPTY/OBJECTS. If I put EAST-targets at the map, script won|t work. If I use the EMPTY/targets, everzthing goes smooth as anything can go...

Jens
Title: Re:Problems with moving targets
Post by: Terox on 14 Jun 2004, 18:38:31
just had a quick look at post

an empty vehicle / object isnt seen as being on a side, EAST, WEST etc

hope that helps
Title: Re:Problems with moving targets
Post by: Gnat on 17 Jun 2004, 16:19:54
Is this also a possible anti-cheat addition to the OFP game code ?
ie to stop players "hiding" in the ground, or others being forced into the ground .... ?
.... just a thought.
Title: Re:Problems with moving targets
Post by: macguba on 17 Jun 2004, 16:36:10
No, in general burying things is no problem.  The game code allows it.
Title: Re:Problems with moving targets
Post by: Wadmann on 17 Jun 2004, 19:04:20
The "anti-cheat code" was implemented in an earlier patch that prevents embedded map objects that are identified by an object id from being moved, but as mac stated it should not prevent editor placed objects from being moved.

                                                                 Wadmann
Title: Re:Problems with moving targets
Post by: Gnat on 20 Jun 2004, 15:50:31
what I was suggesting was that anything considered "alive" may not be able to be buried.