Home   Help Search Login Register  

Author Topic: call compile format...  (Read 1786 times)

0 Members and 1 Guest are viewing this topic.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
call compile format...
« on: 05 Jan 2009, 08:01:56 »
Code: [Select]
call compile format["""Marker_%1"" = createMarker [""Dot"", position player ]",_i];
Get error about missing ';' :dunno:

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: call compile format...
« Reply #1 on: 05 Jan 2009, 09:18:29 »
Have you tried

Code: [Select]
call compile format["""Marker_%1"" = createMarker [""Dot"", position player ];",_i];
?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: call compile format...
« Reply #2 on: 05 Jan 2009, 13:52:44 »
Code: [Select]
call compile format["createMarker [""Marker_%1"", position player ];""Marker_%1"" setMarkerType ""Dot""",_i];

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: call compile format...
« Reply #3 on: 05 Jan 2009, 14:30:35 »
 :dry:

Cheers...

Somehow I misread "String = createMarker ["name", position]" for "String = createMarker [type, position]" ::)

That's what you get for sitting late trying to script... :blink:

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: call compile format...
« Reply #4 on: 05 Jan 2009, 19:15:02 »
Or, avoiding dynamic code entirely (always a good plan!):
Code: [Select]
_marker = createMarker ["Marker_" + str _i, position player];
_marker setMarkerType "Dot";
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: call compile format...
« Reply #5 on: 05 Jan 2009, 20:46:20 »
Hmm indeed...

I've got to learn all these new functions they've added...some are quite useful :D