Forum Jump :

Author Message


Posts: 7
Rank:


Level: Member

Country: hu
Location: Szeged
Occupation: student
Age: 27
In-game name:

 
#99102 Posted at 2011-02-26 19:51        
     
Hi there, guys. Using all the knowledge I gained in scripting (which is pathetically little) I tried to write a reinforcement script.
I used plenty of ideas from several scripts and examples and the bastard works, more or less.
Here is the file which contains the problem:


player removeAction actreinforcements;

unmarked = true;
hint "Mark a reinforcement point on your map";
onMapSingleClick "point setpos _pos; unmarked = false";
waitUntil {!unmarked};

_marker= createMarker ["rfpoint",getpos point];
_marker setMarkerPos getpos point;
_marker setMarkerColor "ColorBlue";
_marker setMarkerType "Flag";
_marker setMarkerText "Reinforcement point";
hint "Reinforcement point marked";

infantry= player addAction ["Requesting infantry","troops\infantry.sqf"];
armored= player addAction ["Requesting armored support","troops\armored.sqf"];
transport= player addAction ["Requesting transport","troops\transport.sqf"];
air= player addAction ["Requesting air support","troops\air.sqf"];



I guess I don't have to explain, but still:
Once I executed the action I have to mark a spot on the map, the marker appears, and I can go on bringing in reinforcements.


Now, for my problem:
Every time I use the action the first time, everything is fine. When I try executing it again, the marker just stays where it was.
The troops that arrive spawn where I clicked the second time, so it's only the marker itself that causes this issue.


Still, it would be great if the marker's position changed.

So, can anyone help me out with a solution?
As you can see, I am no expert, so go easy on me.


Thanks in advance

By the way, many thanks for Norrin's air taxi scripts, too, analysing them gave the first push to try something new (for me, at least).