Forum Jump :

Author Message


Posts: 9
Rank:


Level: Member

Country: at
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-05-30 01:35        
     
hey there,

i have improved in scripting lately, but that doesn't really mean i am good at it now...
which brings me to my new problem.

i am working on a coop mission atm and i just can't get the group markers to work the way i want them to.

i try to make different group markers visible for different units.

lets say i have the units "lead", "alead", "a1lead" and "a2lead"
i would like to have a marker that follows the unit "alead" and is only visible for the unit "lead", a marker that follows "a1lead" and one for "a2lead", both visible only for "alead".
it should run on a dedicated server (if that's important (i still haven't fully figured out when that is important and when it isn't)), it should also work for jip players and if possible the markers should disappear if the unit is unconsious (ACE) and should re-appear when the unit is either respawned or healed.

i already tried severel own ideas and stuff i found in the internet, but as is said, nothing works the way i would like it to work.

once more, help is very much appreciated! ;)


Author Message


Posts: 9
Rank:


Level: Member

Country: at
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2013-10-15 13:39        
     
sorry to dig this up.
i thought i found a solution, but then it didn't work out as i wanted it.

her is what i got so far:

from the init.sqf i start a script called "markers.sqf"
the code of that script is:


it works as long as s3 and s4 are present. but they might not be used during a coop mission (or the player for that position will join in progress later) and also the ai is disabled. then i get an script error which stays the whole time.


Advertisement


Author Message


Posts: 48
Rank:


Level: Member

Country: fr
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2013-10-15 18:14        
     
It all looks good. If you want to make sure that s3 and s4 exist you can do something like that :
if(!isNull s3) then {
code
};

I would also recommand that you change the conditions of your while loop as follow:
while {alive s1} do {
...
};

All in all it would look like this :

if ( "s1" == vehicleVarName player ) then { 
   if(!isNull s3) then {
      _hvt1m = createMarkerLocal ["HVT1", position s3 ];
      _hvt1m setMarkerTypeLocal "b_air";
      _hvt1m setMarkerColorLocal "Colorblue";
      _hvt1m setMarkerText "Skywalker 1";
   };

   if(!isNull s4) then {
      _hvt2m = createMarkerLocal ["HVT2", position s4 ];
      _hvt2m setMarkerTypeLocal "b_air";
      _hvt2m setMarkerColorLocal "Colorblue";
      _hvt2m setMarkerText "Skywalker 2";
   };

   while{alive s1} do {
      if(!isNull s3) then {
         "HVT1" setMarkerPosLocal getPos s3;
      };
      if(!isNull s4) then {
         "HVT2" setMarkerPosLocal getPos s4;
      };
      sleep 3;
   };

};


Author Message


Posts: 9
Rank:


Level: Member

Country: at
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2013-10-15 20:30        
     
thanks a lot!
it's not completly working tough...

if i use that code and diable ai for "s4", i get a scipting error for the " if(!isNull s4) then {" line in the loop.
it tells me "not defined variable s4"

no idea why, as i don't get that error for the line at the beginning of the script...


Author Message


Posts: 635
Rank:


Level: Member

Country: uk
Location: N.W.
Occupation:
Age: 32
In-game name: big_wilk

 
#5 Posted at 2013-10-16 08:00        
     
try this at the top of your script

s4 = [];


Author Message


Posts: 9
Rank:


Level: Member

Country: at
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2013-10-16 10:40        
     
well that gives me another erorr:

Error isNull: Type Array, expected Object,Group,Display(dialog),Control,Task,Location

also i am using dac for this and dac also tells me pretty much the same error message.