Home   Help Search Login Register  

Author Topic: local variable not working in setmarkerpos command!  (Read 530 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
local variable not working in setmarkerpos command!
« on: 02 May 2004, 17:17:50 »
Hi! I have this setmarkerpos command yeh? And I want a local variable as the marker name... which is quite screwy 'cause the markername have to be in qoutes. :-\ I've tried using the format command but no luck. What should I do?

"_marker" setmarkerpos getpos _GL
format ["%1" setmarkerpos getpos _GL, _marker]

Above are the two lines I've tried with.

:beat: *Gets Shot* :beat:

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:local variable not working in setmarkerpos command!
« Reply #1 on: 02 May 2004, 17:35:15 »
How are you setting the local variable as the marker name in the first place?

_marker = this select ?

or

_marker = mymarker

or how?

Presuming your marker is named mymarker.




Planck
I know a little about a lot, and a lot about a little.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:local variable not working in setmarkerpos command!
« Reply #2 on: 02 May 2004, 17:43:59 »
_marker = _this select 3

:beat: *Gets Shot* :beat:

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:local variable not working in setmarkerpos command!
« Reply #3 on: 02 May 2004, 17:50:39 »
Have you tried without the quotes then?

_marker setmarkerpos getpos _GL


Planck
I know a little about a lot, and a lot about a little.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:local variable not working in setmarkerpos command!
« Reply #4 on: 02 May 2004, 17:53:06 »
Yes, and the command requires qoutes. :-\

:beat: *Gets Shot* :beat:

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:local variable not working in setmarkerpos command!
« Reply #5 on: 02 May 2004, 17:54:23 »
errrm Armsty,

_marker is a local variable -> you're right

but:

"_marker" is a string called: "_marker"

When executing your script the line should look like that:

[whatever,whatever,whatever,"markername"] exec "script.sqs"

Now you can say in your script:

_marker = _this select 3

and now you can say:

_marker setMarkerpos getpos _gl

as _marker now represents: "markername"

:edit - btw - another way could have been (in case you wouldn't
execute the script with the markername between quotes);

_marker = format ["%1",_this select 3]

That way you could have put the markernames into quotes
too then.

~S~ CD
« Last Edit: 02 May 2004, 17:58:38 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:local variable not working in setmarkerpos command!
« Reply #6 on: 02 May 2004, 17:57:16 »
Oh right! Stupid me. Cheers guys!

I'll lock this when I've tried it out and I have seen that it works (I'm sure it will, just gonna be 100 % :) ).

:beat: *Gets Shot* :beat:

EDIT: #Locked. Puh! Just 20 scripts or so more and then I'm done with the backbone of the mission. ::)
« Last Edit: 02 May 2004, 18:03:05 by The real Armstrong »