Home   Help Search Login Register  

Author Topic: whats wrong with this script?  (Read 713 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
whats wrong with this script?
« on: 09 Jan 2003, 00:26:47 »
ok, the following script is executed using this line:

[group1, marker1] exec "marker.sqs"

and there is a marker called marker1 and a west squad, with the leaders init field reading:

group1 = group this

and heres the script:

Code: [Select]
_group = _this select 0
_marker = _this select 1

#loop1

"_marker" setMarkerColor "Green"

"_marker" setmarkerpos (getpos (leader _group))

? west countside units _group < 7 : goto "loop2"

~0.5

goto "loop1"


#loop2

"_marker" setMarkerColor "Yellow"

"_marker" setmarkerpos (getpos (leader _group))

? west countside units _group < 1 : goto "loop3"

~0.5

goto "loop2"


#loop3

"_marker" setMarkerColor "Red"

exit

ok, so what should happen is that the placed marker follows the leader of the group - it will then change colour depending on the state of the squad (how many men are left alive)

the problem is, that it doesnt even move to the leader to start with - it just stays in posistion.
Proud Member of the Volunteer Commando Battalion

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:whats wrong with this script?
« Reply #1 on: 09 Jan 2003, 00:29:50 »
da marker should b string :P

u have 2 flip everything like dat

[group1, "marker1"] exec "marker.sqs"

and everywere else use

_marker

should work  ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:whats wrong with this script?
« Reply #2 on: 09 Jan 2003, 00:41:46 »
aaah, works fine...

one more question - i have like 6 squads which i want to use this script with -and of course it only works with one at a time - now, can i make this script into a sqf file and have several groups use the same one?
Proud Member of the Volunteer Commando Battalion

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:whats wrong with this script?
« Reply #3 on: 09 Jan 2003, 00:43:53 »
well, at least I know that several units CAN use the same scroll, mezzy, so why not yers?!  :)

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:whats wrong with this script?
« Reply #4 on: 09 Jan 2003, 00:51:05 »
i dunno - what happends is that the second placed marker just sits there, tomby... the scroll doesnt handle 2 markers...

maybe its because im using the same init line to execute them?

i dunno, ya think u cud work summy out?

:thumbsup:
Proud Member of the Volunteer Commando Battalion

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:whats wrong with this script?
« Reply #5 on: 09 Jan 2003, 01:13:12 »
as much as i c - da script should work right :P

just

[group this,"markername"] exec "scriptname.sqs"

in da init of 1 of da soldiers shold do da trick

LCD OUT
« Last Edit: 09 Jan 2003, 01:14:26 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline mcnorth

  • Members
  • *
Re:whats wrong with this script?
« Reply #6 on: 11 Jan 2003, 23:56:27 »
Looks to me like you should be able to use the same script more than once at the same time. My guess is that it boils down to local variables and yours look to be all local. Initiating it the second time would have to be be with something like [group2, marker2] exec "whatever.sqs"