OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: pazuzu on 17 Aug 2005, 23:52:57

Title: marker to object
Post by: pazuzu on 17 Aug 2005, 23:52:57
Is it possible to command a marker to position over object?

I cant seem to get it to work...

I've tried the setMarkerPos command and the setpos command and also tried a couple scripts that make markers follow units, groups or vehicles but they don't work for this(at least the way I tried).

I have an ammo crate being dropped by chopper & I want a marker to appear when its dropped, showing where it is.

Thanks.
Title: Re:marker to object
Post by: macguba on 17 Aug 2005, 23:55:12
setMarkerPos should work.   You're probably making one of these daft little errors that we all make, like you think the ammo crate is named ammocrate1 but in fact its named ammmocrate1.

Tell us exactly what you did and what happened.   How do you know it didn't work?
Title: Re:marker to object
Post by: bdfy1985 on 18 Aug 2005, 00:14:01
2pazuzu
you need to post ammodop  script ... Are you camcreating this ammobox ?
Title: Re:marker to object
Post by: pazuzu on 18 Aug 2005, 02:25:56
No this is an ammo crate already created.

I'm using:

Transporting and para-dropping objects script. By David Berka.

I created a marker named "crate" and named the crate "ammo". I then made a test trigger activated by radio.

In activation field I put: "crate" setMarkerPos getMarkerPos "ammo"

The crate is from the Acat nh90 addon.

I ended up just puting an empty marker to setpos visible marker which puts it in general area of where crate is dropped but I'd rather it be right on crate.

Maybe your right macguba I might have mispelled something so I'll test it more & check back.

Thanks for the help.
 
Title: Re:marker to object
Post by: Pilot on 18 Aug 2005, 02:50:52
Ok, I may be totally misunderstanding this thread, but why don't you name the ammo crate:
ACrate

then use the following code:
"crate" setmarkerpos getpos ACrate

Why wouldn't that work? ???

-Student Pilot
Title: Re:marker to object
Post by: funkster on 18 Aug 2005, 02:57:44
Maybe I dont know what Im talking about (probably  :-\ ),
but dont you have to put:

Code: [Select]
"crate" setMarkerPos {getMarkerPos "ammo"}

??
Title: Re:marker to object
Post by: Pilot on 18 Aug 2005, 04:12:11
Not unless you want to place the marker over another marker (or this is some special function with which I am not familiar with ::)).  If you want to place the marker over the ammo crates you will have to use my code:
"crate" setmarkerpos getpos ammo

Make sure the marker is named crate and the ammo boxe is named ammo.

-Student Pilot
Title: Re:marker to object
Post by: pazuzu on 18 Aug 2005, 04:20:21
Ok, if thats how its done, then I must have just typed something wrong...

Thanks.
Title: Re:marker to object
Post by: Dubieman on 18 Aug 2005, 04:43:29
Student Pilot is right. Though I thought you needed a pair of ()'s?

"crate" setmarkerpos (getpos ammo)

But I don't know if it matters... ::)
Title: Re:marker to object
Post by: pazuzu on 18 Aug 2005, 05:04:59
To teleport a unit, vehicle or object I always typed it out like this:

"unit" setMarkerPos getMarkerPos "markername"

Title: Re:marker to object
Post by: pazuzu on 18 Aug 2005, 06:14:24
Your right GuiltyRoachKillar I needed those ()'s

Problem solved.

Thanks again.
Title: Re:marker to object
Post by: macguba on 18 Aug 2005, 09:11:27
It seems to have worked but even so it is very bad practice to name name anything "ammo".    ammo is a command which makes it a reserved variable:   if it works you've just been given a lucky break because you should get an error message.    However the game is not robust when it comes to things like this and you can get weird stuff happening.

Change it to ammo1 or something.