Jump to content
Sign in to follow this  
War_Duck

Help with scripts. Paradrop mission

Recommended Posts

Hello! I'm making a MP night paradrop mission wich I want that looks like this:

I'll give you what I got so far:

Since it's a night paradrop, I'm trying to put a lightin system: the plane will start with an red light on cargo. Near the dropzone, the side doors will open and at the dropzone, the light turns green and the players jumps off, one by one. I already got the red light working. I took a building lighting script from somewhere and modified to attach to my c130 instead of the house.

I got the soldiers attached to the plane as well. I have one a the side door and a collum of about 6 behind him. Even open, the side doors are solid and the player can't walk through it. So I'm trying to at least simulate that. I attached a wood palet outside the plane, near the door, and make it invisible. Then, when the c130 pass through the trigger waypoint, the player is detached of the plane, attached to the palet and then detached again. As the one player jumps off, the other take the door position, and so on. Until now, only 2 players jumps (as test). Works fine.. until the second one hits the ground. He's teletransported back to the plane! I have no idea why and I'm not sure if it happends all the time.

Now, the questions:

1- When I trigger the green light script it goes on, but I don't know how to stop the red light script.. so I have kind of an orange light. How do I fix it?

2- Is there anyway that I can time the jumps? Example: Every 1 second, a player jumps and other take the door position.

3- Is there any "walk" or "step foward" animation? I want to make units play it when they are changing positions.

4- How can I make the player peform a action before he gets teletransported to the outside (before he jumps)?

Notes:

I'm doing all the script in waypoints.. I really newbie at real scripting and don't know much about it.

I don't have the OA.

That's it for now.

Sorry for my bad english..

Thank you.

Edited by War_Duck
looks like the video is not showing..

Share this post


Link to post
Share on other sites

Fixed "the second soldier that hits the ground being teletransported back to the plane".

Cmmon guys! Anyone? Any Questions? I really need your help.

EDIT: Is my question too complicated?

Edited by War_Duck

Share this post


Link to post
Share on other sites
I don't have the OA.

It's on sale, get it. :)

You should be able to deleteVehicle the lightpoint object to get rid of it to turn off the red light.

Forcing players to do animations is never a good thing. While the realism of what you're trying to do is admirable, most players will just want to get off the plane and not wait while animations and lights play and they shuffle forward waiting when they could be shooting things.

You might want to take a look at this script, it's similar to what you want to do.

Share this post


Link to post
Share on other sites

Thanks for the reply.

Yeah, I think you're right, the animations aren't realy good idea.

Thanks for the script

I'll use it in future missons, but in this one I want them to jump through the side doors.

I tried the deletvehicle action several times.. And the didn't worked. The only diference is that when I try the "deletvehicle", the green light doesn't even turn on.

And some more questions:

Would be a problem to use the "attach, detach, attach, detach" thing in multiplayer?

What is the action that delay the script actions? (something happens, 2 seconds later another thing happens.)

Share this post


Link to post
Share on other sites

Here's what I used to create a light, then used deleteVehicle to remove it.

light = "#lightpoint" createVehicle [1,1,1];
light setLightBrightness 0.05;
light setLightAmbient[.9, .9, .6];
light setLightColor[.9, .9, .6];
light lightAttachObject [this, [0,0,10]];
varname = "obsLight";
light setVehicleVarName varname;
light Call Compile Format ["%1=_This ; PublicVariable ""%1""",VarName];

Then deleted it with deleteVehicle obsLight.

sleep or waitUntil can be used for pauses. Sleep can't be used in things like triggers though.

sleep 5;

_later = time + 5;
waitUntil {time > _later};
hint "It's been 5 seconds";

Share this post


Link to post
Share on other sites

DeletVehicle not working.. Let me show how I'm doing it

The red light:

_lamp1 = createVehicle ["Misc_Wall_lamp", [1,1,1], [], 0, "NONE"];


_lamp1 attachto [c130,[-1.5,-3,-2.5]];
_lamp1 setDir 270;


{
_light = "#lightpoint" createVehicle [0,0,0];
_light setLightBrightness 0.7;
_light setLightAmbient[.100, .0, .0];
_light setLightColor[.100, .0, .0];
_light lightAttachObject [_x, [0,-0.1,0]];
} forEach [_lamp1,_lamp2,_lamp3,_lamp4];

hint "Lights on!";
varname = lr; 

When it turns green:

deletevehicle lr
_lamp2 = createVehicle ["Misc_Wall_lamp", [1,1,1], [], 0, "NONE"];


_lamp2 attachto [c130,[-1.5,-3,-2]];
_lamp2 setDir 270;


{
_light = "#lightpoint" createVehicle [0,0,0];
_light setLightBrightness 0.5;
_light setLightAmbient[.0, .100, .0];
_light setLightColor[.0, .100, .0];
_light lightAttachObject [_x, [0,-0.1,0]];
} forEach [_lamp1,_lamp2,_lamp3,_lamp4];

hint "Lights on!"; 

If I put deletvehicle like that, the script don't change the color of the light nor delet it, but it shows the "jump" hint.

Share this post


Link to post
Share on other sites

It's not turning green since you're missing a ; after the deletevehicle so the rest of that script isn't running.

It's not deleting since it has no idea what lr is since you're never really declaring it. varname = lr; is meaningless to the script, that's just setting one non-existant object to another. :) If you used the rest of my example you'd be setting "lr" to be the object name for the light object which then would be able to be deleted in the other script.

varname = [color="#FF0000"]"[/color]lr[color="#FF0000"]"[/color];
_lamp1 setVehicleVarName varname;
_lamp1 Call Compile Format ["%1=_This ; PublicVariable ""%1""", varname];

Share this post


Link to post
Share on other sites

Thanks, I'll try that later.

Sorry, I was so excited about get it working that I didn't read the whole thing. I'll pay more atention from now on. :p

Share this post


Link to post
Share on other sites
Here's what I used to create a light, then used deleteVehicle to remove it.

light = "#lightpoint" createVehicle [1,1,1];
light setLightBrightness 0.05;
light setLightAmbient[.9, .9, .6];
light setLightColor[.9, .9, .6];
light lightAttachObject [this, [0,0,10]];
varname = "obsLight";
light setVehicleVarName varname;
light Call Compile Format ["%1=_This ; PublicVariable ""%1""",VarName];

Then deleted it with deleteVehicle obsLight.

sleep or waitUntil can be used for pauses. Sleep can't be used in things like triggers though.

sleep 5;

_later = time + 5;
waitUntil {time > _later};
hint "It's been 5 seconds";

Thanks for this script, this is what I was looking for ^^

Share this post


Link to post
Share on other sites

Hello! Again, I need help with scripting but this time its not about lighting.

As I said, I attached the troopers in the cargo of the c130. There is one facing the side door and the others are making a collum from his left.

I noticed that just writing the situation down is kind of hard to you to understand, so I asked to my good friend Van Gogh to drawn it for you guys. Here it is:

jumpld.jpg

And here's what I trying to do:

When the dropzone is reached the red guy is attached to the blue square (wich is a pallet that I attached to the plane), and then detached. A parachute is created at the pallet location and, after I detach the red guy, I move him as driver in the parachute. Meanwhile, the blue guy takes the position of the red guy, the yellow guy takes the position of the blue guy, the grey guy takes position of the yellow guy and so on. After 2 seconds, the whole process is repeated.

I'm trying to do this using this script that I wrote myself:

_player1 = _this select 0;
_player2 = _this select 1;
_player3 = _this select 2;
_player4 = _this select 3;
_player5 = _this select 4;
_plane = _this select 5;
_holder = _this select 6;

detach _player1;
_player1 attachto [_holder,[0,0,0]];
par1 = createVehicle ["ParachuteC", position _holder, [], 0, "none"];
par1 setdir 270;
_player1 moveindriver par1;

detach _player2;
detach _player3;
detach _player4;
detach _player5;
_player2 attachto [_plane,[-0.8,-2.5,-4.5]];
_player2 setdir 270;
_player3 attachto [_plane,[-0.8,-1,-4.5]];
_player3 setdir 180;
_player4 attachto [_plane,[-0.8,1,-4.5]];
_player4 setdir 180;
_player5 attachto [_plane,[-0.8,2,-4.5]];
_player5 setdir 180;
sleep 2;
_player2 attachto [_holder,[0,0,0]];
par2 = createVehicle ["ParachuteC", position _holder, [], 0, "none"];
par2 setdir 270;
_player2 moveindriver par2;

detach _player3;
detach _player4;
detach _player5;
_player3 attachto [_plane,[-0.8,-2.5,-4.5]];
_player3 setdir 270;
_player4 attachto [_plane,[-0.8,-1,-4.5]];
_player4 setdir 180;
_player5 attachto [_plane,[-0.8,1,-4.5]];
_player5 setdir 180;
sleep 2;
_player3 attachto [_holder,[0,0,0];
par3 = createVehicle ["ParachuteC", position _holder, [], 0, "none"];
par3 setdir 270;
_player3 moveindriver par3;

detach _player4;
_player4 attachto [_plane,[-0.8,-2.5,-4.5]];
_player4 setdir 270;
_player5 setdir 180;
_player5 attachto [_plane,[-0.8,-1,-4.5]];
sleep 2;
_player4 attachto [_holder,[0,0,0];
par4 = createVehicle ["ParachuteC", position _holder, [], 0, "none"];
par4 setdir 270;
_player4 moveindriver par4;

detach _player5;
_player5 attachto [_plane,[-0.8,-2.5,-4.5]];
_player5 setdir 270;
sleep 2;
_player5 attachto [_holder,[0,0,0]];
par5 = createVehicle ["ParachuteC", position _holder, [], 0, "none"];
par5 setdir 270;
_player5 moveindriver par5;

I really hope that you understand it.

The red and the blue guys jumps just fine, but the others don't. After the blue guy, the script seems to stop runing. Why?

Sorry for bother you again and, again, sorry for my bad english.

Thank you.

Share this post


Link to post
Share on other sites

Missing closing bracket at:

_player3 attachto [_holder,[0,0,0];

You really should run Arma2 with 'show script errors' enables (command line option: -showScriptErrors ), so you'll get a warning when something is wrong with your script.

Share this post


Link to post
Share on other sites

Thanks man, it works.

I didn't knew about the show script erros thing, will help me alot.

Now, one more problem: _player5 (orange guy) insists to face the north part of the plane.. nomater what I try.. here it is:

_player5 setdir 180; //Facing the south part of the plane
detach _player5;
_player5 attachto [_plane,[-0.8,-2.5,-4.5]];
_player5 setdir 270; //Facing the door (jump position)
sleep 0.6;
_player5 attachto [_holder,[0,0,0]];
detach _player5;
par5 = createVehicle ["ParachuteC", position _holder, [], 0, "none"];
par5 setdir 270;
_player5 moveindriver par5;

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  

×