Forum Jump :

Author Message

wom  



Posts: 9
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name: wom

 
#1 Posted at 2013-03-09 17:10        
     
I am developing mission where in the end player has to move to extraction zone from where MH-9 will pick him up.

I have trigger that is launced (I see debug hint text) but helicopter is not being spawned. Tried to figure out what is wrong in my approach. Maybe it is wrong vehicle id in createVehicle or something else.

This is the script that is run:

hint "Spawning MH-9?"

// Get our spawn marker
_spawnPos = markerPos (_this select 0);

// Spawn MH-9 and assign waypoints to it

heco = createVehicle ["MH-9", _spawnPos select 0, [], 0, "FLY"];


Is there list of available vehicle IDs somewhere. Would be nice reference. Also list of available units would be perfect.

Thanks for all the help and suggestions :)


Author Message

R3  



Posts: 5
Rank:


Level: Member

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

 
#2 Posted at 2013-03-10 11:43        
     
Hi,

Yes your helo className is incorrect. For the MH-9 it should be "B_MH9_F". I didn't find a list available on the net but you can easily check classnames yourself using this method:

1. Place a vehicle into the map in the editor
2. Into the initialization field of this vehicle write:
hint format ["%1",typeOf this];
3. Click on "Preview" and you will see the correct className at the hint area. Use it for one vehicle at a time.

Now coming back to your code, there are a few other things I should point out:

1. Your hint "Spawning MH-9?" line is missing ; at the end
2. Make sure the marker name you are getting for markerPos here: _spawnPos = markerPos (_this select 0); is valid (defined and string format).
3. Your heco variable should be defined as local as well (_heco = createVehicle ... instead of heco = createVehicle ...)
4. In your createVehicle you are selecting the first element of the position array. This is not correct, the function needs the whole position array (x,y,z). It should be: _spawnPos instead of _spawnPos select 0
5. You are currently spawing the helo as "FLY" mode. However your helo hoes not have a pilot in it to keep it flying (it will just crash). Perhaps you should spawn it as "NONE" until you figure out how to put a pilot in there and make it follow waypoints :)

So covering all that I would suggest starting simple with the following:
hint "Spawning MH-9?";
_spawnPos = markerPos "nameOfMyMarker"; // Get our spawn marker (manually typing the name)
_heco = createVehicle ["B_MH9_F", _spawnPos, [], 0, "NONE"]; // Spawn MH-9
..and then start changin it once this part works and a helo is actually spawned :)


Advertisement


Author Message

wom  



Posts: 9
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name: wom

 
#3 Posted at 2013-03-10 15:55        
     
# R3 : Hi,

Yes your helo className is incorrect. For the MH-9 it should be "B_MH9_F". I didn't find a list available on the net but you can easily check classnames yourself using this method:

1. Place a vehicle into the map in the editor
2. Into the initialization field of this vehicle write:
hint format ["%1",typeOf this];
3. Click on "Preview" and you will see the correct className at the hint area. Use it for one vehicle at a time.

Now coming back to your code, there are a few other things I should point out:

1. Your hint "Spawning MH-9?" line is missing ; at the end
2. Make sure the marker name you are getting for markerPos here: _spawnPos = markerPos (_this select 0); is valid (defined and string format).
3. Your heco variable should be defined as local as well (_heco = createVehicle ... instead of heco = createVehicle ...)
4. In your createVehicle you are selecting the first element of the position array. This is not correct, the function needs the whole position array (x,y,z). It should be: _spawnPos instead of _spawnPos select 0
5. You are currently spawing the helo as "FLY" mode. However your helo hoes not have a pilot in it to keep it flying (it will just crash). Perhaps you should spawn it as "NONE" until you figure out how to put a pilot in there and make it follow waypoints :)

So covering all that I would suggest starting simple with the following:
hint "Spawning MH-9?";
_spawnPos = markerPos "nameOfMyMarker"; // Get our spawn marker (manually typing the name)
_heco = createVehicle ["B_MH9_F", _spawnPos, [], 0, "NONE"]; // Spawn MH-9
..and then start changin it once this part works and a helo is actually spawned :)

Thank you very much for the help. Very much appreciated. I managed to get around this by placing helicopter on the island and using hold waypoint with switch trigger.

However this information will help a lot in my next mission. I just uploaded my new mission called "Who is the bad guy?" and it is waiting now for approval.


Author Message

wom  



Posts: 9
Rank:


Level: Member

Country: fi
Location:
Occupation:
Age:
In-game name: wom

 
#4 Posted at 2013-09-04 21:25        
     
I revisited my mission to make it work in beta. Also made helo extraction nicer. Here it is if anyone happen to need similar thing.

_spawnPos = markerPos "helo1_spawn_marker"; 

_creation = [_spawnPos, -90, "B_HELI_TRANSPORT_01_CAMO_F", WEST] call bis_fnc_spawnvehicle;
//_creation = [_spawnPos, -90, "B_HELI_LIGHT_01_F", WEST] call bis_fnc_spawnvehicle;

heloGroup = _creation select 2;
helo = _creation select 0;

_waypoint1 = heloGroup addWaypoint [ (markerPos "helo1_wp_1"), 12];
_waypoint1 setWayPointBehaviour "CARELESS";
_waypoint1 setWayPointSpeed "NORMAL";
_waypoint1 setWayPointType "LOAD";
_waypoint1 setWayPointCombatMode "WHITE";
_waypoint1 setWaypointStatements ["true","helo land 'LAND';"];

waitUntil {player in helo};

_waypoint2 = heloGroup addWaypoint [ (markerPos "helo1_wp_2"), 12];
_waypoint2 setWayPointBehaviour "CARELESS";
_waypoint2 setWayPointSpeed "NORMAL";
_waypoint2 setWayPointType "MOVE";
_waypoint2 setWayPointCombatMode "WHITE";


Author Message


Posts: 484
Rank:


Level: Member

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

 
#5 Posted at 2014-01-05 12:40        
     
Hello,

What would you need to put in a trigger to get this to work ?
And what would need to be changed to make this work with none players, i thinking this waitUntil {player in helo}; would need to be changed to AI names but i do not know how to go about it..

So basically When player gets the the 4 pows to were is needed sets of the trigger for the helli to come and you tell them to get in and helli leaves and drops them of some were else.

Thanks..

This post was edited by AsRock_SD (2014-01-05 12:49, ago)

Specialdetachment.org
Asus Maximus Formula \ E8400 Wolfdale 3.0GHz \Xigmatek HDT-S1283\ G.Skill 2x2GB \ AxeRam 2GB 1200+ \ XFX 4890 1000\1100 \ 3xWDYS250GIG Raid5\ 3xWDKS250GIG Raid5 \ Liteon163 DVD \ GCE-8400B (8MB) \ Samsung DVDRW \ TOSHIBA 40" 1080p LCD HDTV \ PC Power & Cooling 750 Quad CF Edi

Author Message


Posts: 635
Rank:


Level: Member

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

 
#6 Posted at 2014-01-05 14:48        
     
This will do what you want if you name your POWs "pow1" and "pow2" .. 3 .. 4:

    _spawnPos = markerPos "helo1_spawn_marker"; 
    _creation = [_spawnPos, -90, "B_HELI_TRANSPORT_01_CAMO_F", WEST] call bis_fnc_spawnvehicle;
    //_creation = [_spawnPos, -90, "B_HELI_LIGHT_01_F", WEST] call bis_fnc_spawnvehicle;
     
    heloGroup = _creation select 2;
    helo = _creation select 0;
     
    _waypoint1 = heloGroup addWaypoint [ (markerPos "helo1_wp_1"), 12];
    _waypoint1 setWayPointBehaviour "CARELESS";
    _waypoint1 setWayPointSpeed "NORMAL";
    _waypoint1 setWayPointType "LOAD";
    _waypoint1 setWayPointCombatMode "WHITE";
    _waypoint1 setWaypointStatements ["true","helo land 'LAND';"];
     
    waitUntil {player in helo} AND {(pow1 in helo) or (!alive pow1)} AND {(pow2 in helo) or (!alive pow2)};
     
    _waypoint2 = heloGroup addWaypoint [ (markerPos "helo1_wp_2"), 12];
    _waypoint2 setWayPointBehaviour "CARELESS";
    _waypoint2 setWayPointSpeed "NORMAL";
    _waypoint2 setWayPointType "MOVE";
    _waypoint2 setWayPointCombatMode "WHITE";

If you dont know how to put things into scripts these will teach you how:

http://www.youtube.com/playlist?list=PLDuFcVmU4yHbUp64E7xYzp7ezbGem_Ebn

This post was edited by big_wilk (2014-01-05 15:08, ago)


Author Message


Posts: 484
Rank:


Level: Member

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

 
#7 Posted at 2014-01-08 15:50        
     
Thank You...

How would i go about giving it a name and dding this command to it pow = ["p1,p2,p3,p4","succeeded"]; which removes the AI from your squad ?.

Specialdetachment.org
Asus Maximus Formula \ E8400 Wolfdale 3.0GHz \Xigmatek HDT-S1283\ G.Skill 2x2GB \ AxeRam 2GB 1200+ \ XFX 4890 1000\1100 \ 3xWDYS250GIG Raid5\ 3xWDKS250GIG Raid5 \ Liteon163 DVD \ GCE-8400B (8MB) \ Samsung DVDRW \ TOSHIBA 40" 1080p LCD HDTV \ PC Power & Cooling 750 Quad CF Edi

Author Message


Posts: 635
Rank:


Level: Member

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

 
#8 Posted at 2014-01-09 19:21        
     
Something like:

pow = [p1,p2,p3,p4];

{[_x] join grpNull;} foreach units pow;

This post was edited by big_wilk (2014-01-09 23:33, ago)


Author Message


Posts: 484
Rank:


Level: Member

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

 
#9 Posted at 2014-01-09 23:26        
     
Were would i add that under ? waitUntil {player in helo} AND {(pow1 in helo) or (!alive pow1)} AND {(pow2 in helo) or (!alive pow2)};

Specialdetachment.org
Asus Maximus Formula \ E8400 Wolfdale 3.0GHz \Xigmatek HDT-S1283\ G.Skill 2x2GB \ AxeRam 2GB 1200+ \ XFX 4890 1000\1100 \ 3xWDYS250GIG Raid5\ 3xWDKS250GIG Raid5 \ Liteon163 DVD \ GCE-8400B (8MB) \ Samsung DVDRW \ TOSHIBA 40" 1080p LCD HDTV \ PC Power & Cooling 750 Quad CF Edi

Author Message


Posts: 635
Rank:


Level: Member

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

 
#10 Posted at 2014-01-10 02:28        
     
If you wanted them out of your group once they are in the chopper yes.

This post was edited by big_wilk (2014-01-11 02:53, ago)


Author Message


Posts: 484
Rank:


Level: Member

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

 
#11 Posted at 2014-01-11 00:54        
     
Thank You, i will have to try it when i have time.. How do i go about the helli name ?.. As it checks it for the pows to complete the OBJ..

Specialdetachment.org
Asus Maximus Formula \ E8400 Wolfdale 3.0GHz \Xigmatek HDT-S1283\ G.Skill 2x2GB \ AxeRam 2GB 1200+ \ XFX 4890 1000\1100 \ 3xWDYS250GIG Raid5\ 3xWDKS250GIG Raid5 \ Liteon163 DVD \ GCE-8400B (8MB) \ Samsung DVDRW \ TOSHIBA 40" 1080p LCD HDTV \ PC Power & Cooling 750 Quad CF Edi

Author Message


Posts: 635
Rank:


Level: Member

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

 
#12 Posted at 2014-01-11 02:10        
     
Whats with all the ... ... ... ... ... lol is this a new thing I've missed...?

The script names the helicopter "_creation" which is local... Then he gave it a global name as well "Helo" either refers to the the helicopter...

Change it to this...:
heloGroup = _creation select 2;
    helo = _creation select 0;
     
    _waypoint1 = heloGroup addWaypoint [ (markerPos "helo1_wp_1"), 12];
    _waypoint1 setWayPointBehaviour "CARELESS";
    _waypoint1 setWayPointSpeed "NORMAL";
    _waypoint1 setWayPointType "LOAD";
    _waypoint1 setWayPointCombatMode "WHITE";
    _waypoint1 setWaypointStatements ["true","helo land 'LAND';"];
     
    waitUntil {player in helo} AND {(pow1 in helo) or (!alive pow1)} AND {(pow2 in helo) or (!alive pow2)};
     
MyObjectiveComplete = true;
publicVariable "MyObjectiveComplete";

    _waypoint2 = heloGroup addWaypoint [ (markerPos "helo1_wp_2"), 12];
    _waypoint2 setWayPointBehaviour "CARELESS";
    _waypoint2 setWayPointSpeed "NORMAL";
    _waypoint2 setWayPointType "MOVE";
    _waypoint2 setWayPointCombatMode "WHITE";



Now you can have a trigger in the game with the condition: MyObjectiveComplete;

That will fire when the units are in the helicopter....

Added 1 minute later:

or just put the objective complete code under the waituntil command

Added 52 seconds later:

.... ;)

This post was edited by big_wilk (2014-01-11 02:54, ago)


Author Message


Posts: 484
Rank:


Level: Member

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

 
#13 Posted at 2014-01-23 06:33        
     
Sorry for the delay, Thanks for time and effort and it's all working how it should now.

Specialdetachment.org
Asus Maximus Formula \ E8400 Wolfdale 3.0GHz \Xigmatek HDT-S1283\ G.Skill 2x2GB \ AxeRam 2GB 1200+ \ XFX 4890 1000\1100 \ 3xWDYS250GIG Raid5\ 3xWDKS250GIG Raid5 \ Liteon163 DVD \ GCE-8400B (8MB) \ Samsung DVDRW \ TOSHIBA 40" 1080p LCD HDTV \ PC Power & Cooling 750 Quad CF Edi

Author Message

Melbo  



Posts: 1
Rank:


Level: Member

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

 
#14 Posted at 2014-01-24 02:00        
     
Thanks for this script guys. Is there a way to keep the helicopters engine on after he lands and waits for the units to get in? Here's what I'm using at the minute.

	_spawnPos = markerPos "helo1_spawn_marker"; 
    _creation = [_spawnPos, -90, "B_Heli_Transport_01_camo_F", WEST] call bis_fnc_spawnvehicle;
     
    heloGroup = _creation select 2;
    helo = _creation select 0;
     
    _waypoint1 = heloGroup addWaypoint [ (markerPos "helo1_wp_1"), 12];
    _waypoint1 setWayPointBehaviour "CARELESS";
    _waypoint1 setWayPointSpeed "NORMAL";
    _waypoint1 setWayPointType "LOAD";
    _waypoint1 setWayPointCombatMode "WHITE";
    _waypoint1 setWaypointStatements ["true","helo land 'LAND';"];
	_heligroup engineOn true;
     
    waitUntil {VIP in helo} ;
     
    _waypoint2 = heloGroup addWaypoint [ (markerPos "helo1_wp_2"), 12];
    _waypoint2 setWayPointBehaviour "CARELESS";
    _waypoint2 setWayPointSpeed "NORMAL";
    _waypoint2 setWayPointType "MOVE";
    _waypoint2 setWayPointCombatMode "WHITE";

Also, is there a way to prevent the AI inside the heli from taking damage? I know about using allowDamage false but that only applies to the heli, not the AI inside. Thanks again lads.


Author Message


Posts: 635
Rank:


Level: Member

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

 
#15 Posted at 2014-01-25 18:45        
     
Engines On:

http://community.bistudio.com/wiki/land

No damage to your VIP

waitUntil {VIP in helo} ;
VIP allowdamage false;