Jump to content
Sign in to follow this  
eegore

Teleport Game Logic to Destroyed vehicle

Recommended Posts

I have an example mission that lays out what I am looking for, it is only one minute long. It just needs some small adjustments so playing it through a few times would be best so you can see the screw up.

If at all possible I would like the 3 crew members to be spread around the helo wreck and not all stacked up right next to the Game Logic. A little searching around the wreck for the dear crew would be good, I just don't know how to script that.

I have a helo that I am using a trigger to Setdamage .9 on and then when the helo drops below 15m it blows up. (Player can then witness the rotor failure and crash) Sometimes the helo hits a tree and explodes before the height trigger is activated and the crew/game logic will not teleport since the helo is gone. Also the Game Logic spawns in the air not on the ground. If I set the height higher than trees the helo will not spin out showing the rotor failure.

I can not figure out how to adjust this command to work in a trigger.

GameLogicName setposATL (getposATL helo select 0, getposATL helo select 1,0]

Mission:

http://www.sendspace.com/file/4y2gy3

Thanks

Edited by eegore

Share this post


Link to post
Share on other sites

uh1 setDamage 1;
wreck attachto [uh1,[0,-4,0]];
null=[] spawn { waituntil {speed uh1 < 0.1 }; 
sleep 1;
{
_x setposatl (uh1 modelToWorld [(random 30)-15,(random 30)-15,0]);
} foreach [pilot1,pilot2,crew1]; 
};    

attach the gl/flames to uh1 so they always are together

waituntil speed is almost zero then wait a second or two before positioning crew randomly around the wreck.

A better way would be to use sqf file. and spawn the crew

place this in the trigger

null=[uh1,["USMC_Soldier_Pilot","USMC_Soldier_Pilot","USMC_Soldier_Light"],11] execvm "burning.sqf";

save as burning

// null=[uh1,["USMC_Soldier_Pilot","USMC_Soldier_Pilot","USMC_Soldier_Light"],11] execvm "burning.sqf";  

_veh = _this select 0;// destroyed vehicle
_crew = _this select 1;// type of bodies
_rad = _this select 2;// radius of dead

_veh setDamage 1;

_wreck = createVehicle ["HeliHEmpty",getpos _veh,[], 0, "can_collide"] ;

handle=[_wreck,7,time,false,false] spawn BIS_Effects_Burn;

_wreck attachto [_veh,[0,-4,0]];

waituntil {speed _veh < 0.1 }; 

sleep 1;
{
_pilots =  group _veh createunit [_x,getpos _veh,[],_rad,"none"];
_pilots setdamage 1;
} foreach _crew ;

Edited by F2k Sel

Share this post


Link to post
Share on other sites

I tried the first php code in the height activated trigger but the crew doesn't always get teleported to the crash site. Also the helo hits trees and the trigger wont activate.

I didn't spawn in the crew originally because I want them to be weaponless and I am placing documents on them the player can recover. I don't know how to spawn in units like that. I am just placing this in the AI crew init: removeallweapons this; this addweapon "EvMap"; this works well and I can use distance to the Wreck game logic to activate other events.

Also the "burning" script works well except for one problem: Its activated by the height trigger so the trigger doesn't always activate because the helo will hit a tree and disappear thus never activating the script. The only workaround I know is to raise the activation height, but then the effect isn't the same, the helo doesn't show rotor failure and appear as if it might land safe.

Is there a workaround to making sure the crew is spawned or teleported to the crash site? Maybe something with the speed command.

Edited by eegore

Share this post


Link to post
Share on other sites

I didn't have those issue but it two games are never alike.

this and getpos uh1 select 2 < 15 or damage uh1 > 0.9

see if that helps when it hits a tree or other object the damage should increase so it may help it trigger the trigger.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Yeah that will help I believe.

Would canmove or speed work as well?

uh1 speed < 1

uh1 canmove false

Just as trig conditions maybe.

Share this post


Link to post
Share on other sites

I changed it to damage as speed was being it set off at mission start . canmove won't work as damage 0.9 triggers it.

Share this post


Link to post
Share on other sites

Yeah I hear you on the speed thing. I lost my old missions but I did have one where the trigger had two conditions at one time. A UH1 would explode after picking up civilians that the player directed into the helo. (joingrp then joingrp null) The helo was grouped to a trigger that would activate only if the UH1 was inside of it. This allowed for either a height or speed detonation even if the UH1 was meeting those conditions elsewhere on the map.

Unfortunately I lost that mission and can't recall how the trigger was setup, maybe like this:

CON: this && (getPosATL (helo select 2) < 5)

I also had a speed trig but I think this is wrong:

CON: this && uh1 speed 50

Canmove doesn't work, it says " missing ; "

uh1 canmove false

Share this post


Link to post
Share on other sites

this and getpos uh1 select 2 < 15 or damage uh1 > 0.9

this and getpos uh1 select 2 and speed uh1 <5

this and getpos uh1 select 2 or speed uh1 <5

this and getpos uh1 select 2 or !canmove uh1

a few things you could try.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×