Forum Jump :

Author Message


Posts: 37
Rank:


Level: Member

Country: de
Location: Wuerzburg
Occupation: Liberation for all Mankind
Age: 38
In-game name: KingOfNuthin

 
#1 Posted at 2016-09-17 00:06        
     
Hi.. some of you scripting experts will see the mistake immediately. I bet.

cutText ["Click on your requested LZ.","PLAIN DOWN",1]; 
onMapSingleClick "_wp=heli1 addWaypoint [_pos, 0]; [heli1, 1] setwaypointtype ""UNLOAD"";  
onMapSingleClick ''; true"; 

Thanks for any hint.

This post was edited by ai-mods (2016-09-17 18:55, 818 days ago)

Liberty is never given free. Everybody has to stand for it. Not only in war. Also in everyday life. Not everybody is blessed with a good life. Please help people who need help!

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 58
In-game name: Kobayashi Maru

 
#2 Posted at 2016-09-17 17:48        
     
This should work. There is something else wrong with your waypoints and/or your helo.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 21
In-game name: Wak

 
#3 Posted at 2016-09-17 18:23        
     
Maybe actually use the _wp variable returned by addWaypoint?

onMapSingleClick {
    _wp = heli1 addWaypoint [_pos, 0];
    _wp setWaypointType "UNLOAD";  
    onMapSingleClick {};
    true
};

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 37
Rank:


Level: Member

Country: de
Location: Wuerzburg
Occupation: Liberation for all Mankind
Age: 38
In-game name: KingOfNuthin

 
#4 Posted at 2016-09-17 18:54        
     
Here is how I got it working:

titleText ["Press on map to set destination.", "PLAIN"];        
onMapSingleClick  
{  
 _m = createMarker ['destination_lz',_pos]; 
 _m setMarkerType 'mil_flag';  
 _m setMarkerColor 'ColorBlue';    
  
 _wp = (group heli1) addWaypoint [_pos,100,1]; 
 _wp setWaypointType 'TR UNLOAD'; 
 _wp setWaypointStatements ['true','']; 
 _wp setWaypointBehaviour 'CARELESS'; 

_pos1 = getMarkerPos "headquarter"; 
_wp2 = (group heli1) addWaypoint [_pos1, 0]; 
_wp2 setWaypointType "MOVE";

  
 onMapSingleClick ''; 
  
 [] spawn 
 { 
  sleep 5; 
  
  deleteMarker 'destination_lz'; 
 }; 
};

heli1 = my taxi heli
headquarter = a marker at my base

Liberty is never given free. Everybody has to stand for it. Not only in war. Also in everyday life. Not everybody is blessed with a good life. Please help people who need help!

Author Message


Posts: 1513
Rank:


Level: Member

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

 
#5 Posted at 2016-09-17 19:39        
     
What is the third variable in the first addwaypoint there is only two in the second.
Wiki addwaypoint only has info showing two variables.


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 58
In-game name: Kobayashi Maru

 
#6 Posted at 2016-09-18 19:15        
     
@F2kSel: optional!

@ ai-mods : The fact is you probably did the good choice creating a marker.
In your first attempt, without that, under onMapSingleClick scope, you have the special variable: _pos, probably becoming inconsistent after onMapSingleClick ' '.

On the other hand, when you created a marker, the result stays consistent.
Not sure but the fact is you must create something "solid" and "global" (what you want) before cancelling onMapSingleClick.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 37
Rank:


Level: Member

Country: de
Location: Wuerzburg
Occupation: Liberation for all Mankind
Age: 38
In-game name: KingOfNuthin

 
#7 Posted at 2016-09-19 10:13        
     
The 2nd number came from another script. You have to know, that sometimes I don't have a clue how it worked. Every hint and feedback is welcome.

So finally.. what does this number do?

@pierre: The script works excellent. So could it still be a problem? What will help? Creating an empty helipad?

The problem with this script is,that just me,but not my team get kicked out the chopper on reaching LZ. They wait for my order to disembark.

Liberty is never given free. Everybody has to stand for it. Not only in war. Also in everyday life. Not everybody is blessed with a good life. Please help people who need help!

Author Message

Tajin  



Posts: 433
Rank:


Level: Member

Country: de
Location: Bavaria
Occupation: Communications Designer
Age: 34
In-game name: Tajin

 
#8 Posted at 2016-09-19 13:57        
     
TRUnload only does that automatically if an AI is leading the group.
If a player is in charge, he has to do it manually.

You can include a command for it in your waypoint:
_wp setWaypointStatements ["true","(group this) leaveVehicle (vehicle this);"]



anyway, avoid using onMapSingleClick. That old command can potentially break other scripts that use this functionality. There is an eventhandler for it now.:

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#MapSingleClick

There are a lot of very capable people on this forum, willing to spend some of their time to help you out. So if you have a problem, it surely isn't too much to ask that you atleast take the time to describe it properly. Thanks.