Jump to content
Sign in to follow this  
JonasE

About Night Missions

Recommended Posts

Hello! I have a couple of questions about night missions that i'm making. The main problem is light. I've added NV to the weapon crates in the spawn zone of the missions, but when the players respawn, they respawn without NV so they're bacisally too blind to find the crates. How do i make it so that dead players respawn with NV?

Another question i have is how i make a searchlight turned on from the mission start. I don't want a soldier controlling them, i just want them to be turned on. I'm guessing there's a simple init command for it, i just haven't been able to find it.

If anyone can help out with this, i sure would appreciate it!

/J

Share this post


Link to post
Share on other sites

It's not probably the answer your after?

But a quick solution is to have a lit fire by the ammo crates,so they can find em easily? confused_o.gif

Till one of the clever peeps tell ya!

Share this post


Link to post
Share on other sites

Try this JonasE

in the init field for each playable unit call a script to add equipment when a player dies and is respawn. this is an example form one of my missions:

nul = [this] execVM "pinit.sqf"

pinit.sqf then loops waiting for the player to die and respawn.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> while {TRUE} do

{

waitUntil {not (alive player)};

sleep 1;

waitUntil {(alive player)};

removeAllWeapons player;

player addWeapon "NVGoggles";

player addWeapon "Binocular";

player addMagazine "30Rnd_9x19_MP5SD";

player addMagazine "30Rnd_9x19_MP5SD";

player addMagazine "30Rnd_9x19_MP5SD";

player addMagazine "30Rnd_9x19_MP5SD";

player addMagazine "30Rnd_9x19_MP5SD";

player addMagazine "30Rnd_9x19_MP5SD";

player addWeapon "MP5SD";

player addMagazine "15Rnd_9x19_M9SD";

player addMagazine "15Rnd_9x19_M9SD";

player addMagazine "15Rnd_9x19_M9SD";

player addMagazine "15Rnd_9x19_M9SD";

player addMagazine "15Rnd_9x19_M9SD";

player addWeapon "M9SD";

player addMagazine "PipeBomb";

player addMagazine "PipeBomb";

player addMagazine "PipeBomb";

};

The mission is a nighttime stealth mission and I wanted the players to respawn with their full equipment load. The init seems to be called by the system each time the player respawns which runs the script in the execVM command.

Once the player spawns the code sits in the first wait until the player buys the farm then the second wait hangs execution until the player respawns which removes all default equipment and rearms them. The second wait is needed because you don't want the code adding and removing from a body that hasn't yet entered the world.

I've tried it in multiplayer coop and nobody complained so it should work.

Hope this helps.

Share this post


Link to post
Share on other sites
Quote[/b] ]Another question i have is how i make a searchlight turned on from the mission start. I don't want a soldier controlling them, i just want them to be turned on. I'm guessing there's a simple init command for it, i just haven't been able to find it.

Create a gamelogic unit and to it's init field write:

this moveInGunner searchLightsName;

But I've noticed OPFOR units attacking gamelogic controlled searchlights.

I created a test mission with one civilian as player, a searchlight and OPFOR basic squad. When gamelogic enters the light OPFOR start shooting it. When I changed the OPFOR squad to BLUEFOR no-one attacked the searchlight. Anyone has idea why this happens?

EDIT: Tested a bit more and noticed that executing

gameLogicsName action ["getout",searchLightsName];

stops the OPFOR firing. But I don't still get why OPFOR attacks but not BLUEFOR. (RACS is set to friendly to all and I checked that searclights side is 'LOGIC'.)

EDIT2: This should work.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

gl1 moveInGunner sl1;

sleep 5;

gl1 setDamage 1;

deleteVehicle gl1;

OPFOR won't attack sl1 after gl1 is deleted and human players can get in as gunners later on.

Share this post


Link to post
Share on other sites

Its probally because the only side that has a searchlight is BLUEFOR so being the ai they cant see the diffrence between a neutral one and a hostile one.

got no clue why bis only added the searchlight for bluefor and not for the other sides they arent that expansive right?

Share this post


Link to post
Share on other sites
Try this JonasE

in the init field for each playable unit call a script to add equipment when a player dies and is respawn.  this is an example form one of my missions:

nul = [this] execVM "pinit.sqf"

pinit.sqf then loops waiting for the player to die and respawn.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">  while {TRUE} do

 {

    waitUntil {not (alive player)};

    sleep 1;

    waitUntil {(alive player)};

    removeAllWeapons player;

    player addWeapon "NVGoggles";

    player addWeapon "Binocular";

    player addMagazine "30Rnd_9x19_MP5SD";

    player addMagazine "30Rnd_9x19_MP5SD";

    player addMagazine "30Rnd_9x19_MP5SD";

    player addMagazine "30Rnd_9x19_MP5SD";

    player addMagazine "30Rnd_9x19_MP5SD";

    player addMagazine "30Rnd_9x19_MP5SD";

    player addWeapon "MP5SD";

    player addMagazine "15Rnd_9x19_M9SD";

    player addMagazine "15Rnd_9x19_M9SD";

    player addMagazine "15Rnd_9x19_M9SD";

    player addMagazine "15Rnd_9x19_M9SD";

    player addMagazine "15Rnd_9x19_M9SD";

    player addWeapon "M9SD";

    player addMagazine "PipeBomb";

    player addMagazine "PipeBomb";

    player addMagazine "PipeBomb";

 };

The mission is a nighttime stealth mission and I wanted the players to respawn with their full equipment load.  The init seems to be called by the system each time the player respawns which runs the script in the execVM command.

Once the player spawns the code sits in the first wait until the player buys the farm then the second wait hangs execution until the player respawns which removes all default equipment and rearms them.  The second wait is needed because you don't want the code adding and removing from a body that hasn't yet entered the world.  

I've tried it in multiplayer coop and nobody complained so it should work.

Hope this helps.

Tanks a bundle! This worked! I'm gonna use this on prolly all my maps. biggrin_o.gif

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  

×