OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Berghoff on 20 Feb 2004, 15:32:49

Title: Moving a object to a diff position
Post by: Berghoff on 20 Feb 2004, 15:32:49
Hi all,
I need to know something.

Here is my question:
How do you move a object (Empty Tank in my case) to a position where a marker in on the map ?

So, the empty tank needs to teleport to a position (marker) when a objective is completed.

 :) Hope some1 can help.
Title: Re:Moving a object to a diff position
Post by: macguba on 20 Feb 2004, 15:47:27
tank1 setPos getMarkerPos "tankMarker1"

or

tank1 setPos getPos GL_1
Title: Re:Moving a object to a diff position
Post by: Berghoff on 20 Feb 2004, 16:24:59
tank1 setPos getMarkerPos "tankMarker1"

or

tank1 setPos getPos GL_1


Perfect thx, now to add a little fun, I need to know the following:

I have 5 markers where to tank can teleport towards, and a script needs to select 1 of those 5 location at random. How do I do that ? ;)
Title: Re:Moving a object to a diff position
Post by: macguba on 20 Feb 2004, 16:32:31
Something like this, this is just a sketch not a script

_rand = random 6

? _rand < 1: tank1 setpos getpos GL1
? _rand < 2: tank1 setpos getpos GL2

etc