Home   Help Search Login Register  

Author Topic: Changing MarkerType  (Read 874 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Changing MarkerType
« on: 15 Nov 2004, 22:30:40 »
By looking in the mission.sqs I have seen that a marker has several properties.  Two are relevant here:
Type and MarkerType

Type = "Dot" for a dot; "Empty" for invisible etc. (interestingly it = "Flag" for an Objective and "Flag1" for a Flag)

MarkerType = "ELLIPSE" for an ellipse; = "RECTANGLE" for a rectangle and is undefined for the Icon Markers.

The instruction setMarkerType actually changes the Type property not the MarkerType property.

Does anyone know how I can change the MarkerType propery from within a script?


What I am actually trying to do is to have an elliptical marker that is not visible at the start of the mission, but is made visible sometime later.
« Last Edit: 15 Nov 2004, 22:33:01 by THobson »

RED

  • Guest
Re:Changing MarkerType
« Reply #1 on: 15 Nov 2004, 22:48:16 »
You can use setmarkertext, setmarkersize, and setmarkerpos to do what you want, setmarkertype can also be used:

"Markername" setmarkertype "EMPTY"

RED

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Changing MarkerType
« Reply #2 on: 16 Nov 2004, 01:14:04 »
If I have a marker that is created as an ellipse
Quote
"Markername" setmarkertype "EMPTY"
does not appear to do anything.  It still stays on the map.  If it were an Icon marker then it would become invisible.

setMarkerText, setMarkerSize and setMarkerPos I am OK with.  It is the type I am having problems with when the marker is not an Icon.

It is late,  the wine has flowed, (is flowing) and I leave on a business trip early tomorrow.  When I get back on Saturday I will try a wrokaround (blame the wine) that involves setting the marker to be under the bloody ground, or even of zero size until I want it to show.
« Last Edit: 16 Nov 2004, 01:17:49 by THobson »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Changing MarkerType
« Reply #3 on: 16 Nov 2004, 11:45:25 »
setmarkerpos it like -10000 or something untill you need it then. Will that work?

:beat: *Gets Shot* :beat:

Offline KTottE

  • Former Staff
  • ****
Re:Changing MarkerType
« Reply #4 on: 16 Nov 2004, 12:10:02 »
It's probably easier to just change the size, that's what I do when I need to hide/show elliptical and square markers.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Changing MarkerType
« Reply #5 on: 16 Nov 2004, 22:47:48 »
I will try the size thing when I get back.  Thanks all

Kammak

  • Guest
Re:Changing MarkerType
« Reply #6 on: 18 Nov 2004, 00:13:38 »
What are you guys talking about - OFP or VBS?  There is no setMarkerText in OFP.


Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Changing MarkerType
« Reply #7 on: 18 Nov 2004, 03:47:21 »
I am talking OFP.  

The problem is: setMarkerType doesn't.

That is it doesn't change the MarkerType of a marker it changes the Type of the marker.

I am not surprised people are confused.
« Last Edit: 18 Nov 2004, 03:48:31 by THobson »

Kammak

  • Guest
Re:Changing MarkerType
« Reply #8 on: 18 Nov 2004, 03:54:26 »
Yeah I understand that issue, I've encountered it myself and just change the size.

What I'm asking about are the references to setMarkerText.  There is no setMarkerText in OFP - how can you "...be OK with"?  Why is RED talking about it as a function in OFP?


RED

  • Guest
Re:Changing MarkerType
« Reply #9 on: 18 Nov 2004, 08:33:06 »
Yes I made a mistake, there is no such function.

RED

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Changing MarkerType
« Reply #10 on: 19 Nov 2004, 03:33:36 »
Actually I was trying to say in a polite and inoffensive way that the response had not answered my question.  I did not check that the named functions existed - they seemed logical to me.

What precisely is the point you are making?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Changing MarkerType
« Reply #11 on: 19 Nov 2004, 04:20:55 »
I think they have solved your problem without you knowing it  ;D
for icon markers use setmarkertype "empty"
for elliptical and rectangular markers use setmarkersize [0,0]
and that will make them dissappear, so if you want to change an elliptical marker to an icon marker, i would say have one of each at the same spot, and simply make them appear when you want the certain kind of marker
ex.:
you want an objective marker to turn into a rectangal marker (don't know why you would want that but its just an example  :))
start with the objective marker there and the rectangle marker set at the size 0,0
when you want them to change, you set the objective marker to empty and set the size of the rectangle marker to whatever you want

in fact, this would be nearly impossible to notice even by opening up the mission in the editor, except that you have the script that changes it...  :P
« Last Edit: 19 Nov 2004, 04:21:29 by Triggerhappy »

Kammak

  • Guest
Re:Changing MarkerType
« Reply #12 on: 19 Nov 2004, 15:38:18 »
What precisely is the point you are making?

I was trying to figure out what you guys were talking about.  You both mentioned a powerful scripting fuction, setMarkerText, that is not available in OFP, but IS available in VBS.

That you both threw it about so casually made me think - 1) you  were talking about VBS and not OFP, or 2) I had missed a HUGE update to OFP and was now missing out on all the fun.  :)

setMarkerText would make several scripting issues much simpler to address, and I REALLY want it in OFP...so I perked up when I saw it mentioned.

RE: The original Q, I think TriggerHappy summed it up perfectly.



Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Changing MarkerType
« Reply #13 on: 23 Nov 2004, 08:30:40 »
Kammak:  Yeh, sorry.  I was being a bit lazy in my reply.  Apologies for unnecessarily raising your interest.  My mission is about at the point where I would need a 'setMarkerText'.  Now I know it doesn't exist I will do it differently.

Triggerhappy: Good summary thanks.

Anyway - thanks everybody.  To close this:

As far as we all know it is not possible to change the 'MarkerType' property of a marker from within a script.

setMarkerType changes the 'Type' property of the marker not the 'MarkerType' property.    

As a consequence:
To hide an Icon marker - change the 'Type' property using setMarkerType to "empty".

To hide a non-Icon marker (ie a rectangle or an ellipse) - set the size to [0,0].

This feels a bit like one of those  don't-knock-it-it-works situations.


Now - does anyone know how to change the colours?  I am looking for something that is much paler/transparent than any of the standard options.  (I don't mean setMarkerColor - I mean creating new colours as you can with text)