Jump to content
Sign in to follow this  
AlexVestin

PMC Campaign - Scripted SUV fold-out/in animation. What's it called?

Recommended Posts

Like the title says. I think this is the right forum section.

In one of the missions in the PMC campaign, right at the beginning you see your SUV halted infront of a US checkpoint. Then the hatch ontop of the SUV flings open and your gunner folds out the minigun and aims it.

I've still yet to see any other mission where that happens. The moment I saw it happen was the moment I realised I could make my own mission and script it to open/close on command whenever you're inside of that SUV.

Having the possibillity to open/close the hatch yourself would make you less exposed while just cruising.

I've been trying to find out how to script it myself for some time now. The problem is I don't know the name of the animation.

Not sure if there is a "close" animation, but there sure is one for opening the hatch.

Any thoughts?

All help is appreciated.

Share this post


Link to post
Share on other sites

The config lists some animations:

http://browser.six-projects.net/cfg_vehicles/ArmoredSUV_PMC/config?version=58

Try this in a radio trigger with the "ArmoredSUV_PMC" named car1:

Close

car1 animate ["HideGun_01", 1];car1 animate ["CloseCover1", 1];car1 animate ["CloseCover2", 1];

Open:

car1 animate ["HideGun_01", 0];car1 animate ["CloseCover1", 0];car1 animate ["CloseCover2", 0];

Edited by PELHAM

Share this post


Link to post
Share on other sites

That helped alot, thank you!

Now I just want the script to hide the gunner once the hatches closes.

Otherwise he stands through the roof. I will look into it myself, but I'm unsure if I'll figure it out.

--------------------------------------------------------------------------------------------

This is the SUVs init line, to make it be closed as it spawns:

this addAction ["Open m134 hatch", "scripts\PMCSUVopen.sqf"];
this addAction ["Close m134 hatch", "scripts\PMCSUVclose.sqf"];
pmcsuv1 animate ["HideGun_01", 1];
pmcsuv1 animate ["CloseCover1", 1];
pmcsuv1 animate ["CloseCover2", 1];

I also added the two options to open/close the hatch if you're near or in the SUV.

This is my open script:

pmcsuv1 animate ["HideGun_01", 0];
pmcsuv1 animate ["CloseCover1", 0];
pmcsuv1 animate ["CloseCover2", 0];

This is my Close script:

pmcsuv1 animate ["HideGun_01", 1];
sleep 1;
pmcsuv1 animate ["CloseCover1", 1];
pmcsuv1 animate ["CloseCover2", 1];

There's a delay (sleep) in between there cause the hatch closed too fast, through the m134.

--------------------------------------------------------------------------------------------

If you know a good way how, please do tell anyway :)

Edited by AlexVestin

Share this post


Link to post
Share on other sites

Gunner solution, tricky for something so simple isn't it!!?:

Car named car3.

Turn in, (radio trigger):

man3 = gunner car3; man3 action ["moveToCargo", car3,2]; car3 animate ["HideGun_01", 1] ;car3 animate ["CloseCover1", 1]; car3 animate ["CloseCover2", 1];

Turn out:

car3 animate ["HideGun_01", 0] ;car3 animate ["CloseCover1", 0]; car3 animate ["CloseCover2", 0]; man3 action ["moveToTurret", car3,[0]];

(The turn in / turn out actions don't work for this vehicle)

Move AI into an empty vehicle with this in the gunners init:

this moveInGunner car3;
Edited by PELHAM
moveToTurret more suitable

Share this post


Link to post
Share on other sites

You know what. It worked. I only have to remove the init lines that makes it close at spawn, cause that's the only time it bugged.

(get in as gunner displayed you through the roof if you have't opened/closed the hatch once)

I'm making it work for a multiplayer map, where you spawn at your FOB in two small groups, and you get to choose what to drive out of there.

This added one more kind of vehicle, thank you once again! :) Just need to fix some problems regarding who gets the gunner pos, when several people tries to use it.

EDIT:

I tried to do something like this for the close hatch script:

(gunner pmcsuv1) action ["moveToCargo", pmcsuv1,2];

pmcsuv1 animate ["HideGun_01", 1];
sleep 1;
pmcsuv1 animate ["CloseCover1", 1];
pmcsuv1 animate ["CloseCover2", 1];

It works great, except for AI, wheter I use "this assignAsGunner pmcsuv1;" or not in their init line.

Here's something I'd like to have. When I use the close hatch script, I want to make the gunner position locked.

So after the hatch is closed and the gunner that was there has been moved to the backseat, you can't get in the SUV as a gunner.

Then I want to make that position unlocked again once you use the open hatch script.

To make it easier to help for anyone I'll just post what the scripts all are so far again:

--------------------------------------------------------------------------------------------

Here's the init script for the SUV now:

this addAction ["Open m134 hatch", "scripts\PMCSUV1open.sqf"];this addAction ["Close m134 hatch", "scripts\PMCSUV1close.sqf"];

--------------------------------------------------------------------------------------------

This is my close hatch script (PMCSUV1open.sqf): This close script needs something to lock the gunner position.

(gunner pmcsuv1) action ["moveToCargo", pmcsuv1,2];

pmcsuv1 animate ["HideGun_01", 1];
sleep 1;
pmcsuv1 animate ["CloseCover1", 1];
pmcsuv1 animate ["CloseCover2", 1];

--------------------------------------------------------------------------------------------

This is my open hatch script (PMCSUV1open.sqf): This open script needs something to unlock the gunner position.

pmcsuv1 animate ["HideGun_01", 0];
pmcsuv1 animate ["CloseCover1", 0];
pmcsuv1 animate ["CloseCover2", 0];

--------------------------------------------------------------------------------------------

Possible? :)

Edited by AlexVestin

Share this post


Link to post
Share on other sites

Car init:

nul = [this] execVM "turLock.sqf";

private ["_unit","_veh"];
  _veh = _this select 0;
while {true} do {
   waitUntil {(_veh animationPhase "HideGun_01")==1};
     _unit = _veh turretUnit [0];
if (!(isNull _unit)) then {
   _unit action ["getOut", _veh];
      hint "locked";
};
sleep 1;
};

Has to be a script as

lock locks the entire vehicle and

lockTurret only lock it from the outside, you can still move from driver to gunner.

(changed the above post #4 as "moveToTurret" seems to work better)

Edited by PELHAM

Share this post


Link to post
Share on other sites

You've been very helpful. That last bit of code worked. I appreciate the help me you've given me. All works like it should now :D

EDIT:

About the MoveToTurret.

I just kept as if you close the hatch, you get moved to cargo. Then if you open the hatch, you can manually get in as gunner again.

As there's supposed to be around 8 players coop, and no one really has the 'gunner' role.

Edited by AlexVestin

Share this post


Link to post
Share on other sites

i have a question in pmc mission transportation we see the armord suv preforming the script above and a man executing an animation where he open the hatches and takes the gun up. what is the name of that animation

-Regards

---------- Post added at 10:05 PM ---------- Previous post was at 09:51 PM ----------

i have a question in pmc mission transportation we see the armord suv preforming the script above and a man executing an animation where he open the hatches and takes the gun up. what is the name of that animation

-Regards

Share this post


Link to post
Share on other sites

Hey uhhh do I make a new car named car3?

---------- Post added at 17:19 ---------- Previous post was at 17:15 ----------

Hey uhhh do I make a new car named car3?
Ya uhh nvm xD I found out that you dont use the first post but use the one with man3 in it

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  

×