Jump to content
Sign in to follow this  
-NHS- Snip

Need some help: many script needed

Recommended Posts

Hello all,

I've just finish a TDM sniper (at least the background), but i'm stuck with some missing script.

What i whish is:

1) Sniper don't start and respawn with nade, but with NV. DONE

2)if a guy go out of the map limit, he will die, with a small message saying he was trying to go out.DONE

3)if a guy cross the middle of the map, he will die, with a small message saying he was trying to cross.DONE

4)From the menu, before starting, i would like to have the choice between night and day. DONE

5) The big question: is it possible to change the distance? I mean the two camp are between 200M/250M, i wish from the menu also having the choice like:

200M and Day

200M and night

300M and Day

300M and night

Thanks to give me some help.

Ps: sorry for my crap english

Edited by [NHS] Snip

Share this post


Link to post
Share on other sites
Snip;1362521']Hello all' date='

I've just finish a TDM sniper (at least the background), but i'm stuck with some missing script.

What i whish is:

1) Sniper don't start and respawn with nade, but with NV.

2)if a guy go out of the map limit, he will die, with a small message saying he was trying to go out.

3)if a guy cross the middle of the map, he will die, with a small message saying he was trying to cross.

4)From the menu, before starting, i would like to have the choice between night and day.

5) The big question: is it possible to change the distance? I mean the two camp are between 200M/250M, i wish from the menu also having the choice like:

200M and Day

200M and night

300M and Day

300M and night

Thanks to give me some help.

Ps: sorry for my crap english[/quote']

For 2. Use triggers, placed in a square, activated by anyone, and sex axis A to 5 and axis B to 1000 or 2000. And then, set one at 0 angle, 90, 0 and 90. So you will have 4 triggers, around the area you want to limit.

For 3. One trigger, same thing, A=5, B=2000 or whatever and activated by anyone.

In both cases, on activation do something like :

player setDamage 1;player globalChat "I died because I tried to cheat.";

Share this post


Link to post
Share on other sites
Snip;1362521']

4)From the menu' date=' before starting, i would like to have the choice between night and day.[/quote']

I'm also doing that and from what I've gathered, you do something like this in the description.ext (I use the second option):

titleParam2 = "COMBAT SITUATION";
valuesParam2[] = {1, 2, 3, 4, 5, 6};
defValueParam2 = 3;
textsParam2[] = {"RAINY, DAY", "RAINY, NIGHT", "DAY", "NIGHT", "SUNRISE", "SUNSET"};

And then in init.sqf presumably you use if isServer and switch for the value while setting the weather situation.

But I havent actually gotten that far yet though so I dont know if it works that way lol.

Late edit: Oh wait I just remembered that in Domination, weather is clearly local... So maybe one dont need the isServer check.

Edited by Murklor

Share this post


Link to post
Share on other sites

titleParam2 = "COMBAT SITUATION";
valuesParam2[] = {1, 2, 3, 4, 5, 6};
defValueParam2 = 3;
textsParam2[] = {"RAINY, DAY", "RAINY, NIGHT", "DAY", "NIGHT", "SUNRISE", "SUNSET"};

I've put it in my description, i can select it from the menu, but in game it still the same.

Can you tell me more about the init?

thx

Share this post


Link to post
Share on other sites

i think i've done something wrong because i die when the mission start because of one trigger. When i take it away it's ok.

OnLoadMission = "TDM-Sniper-Casttle-Rock";
OnLoadIntro = "Don't cross border!!!";
OnLoadIntroTime = False;
OnLoadMissionTime = False;
respawn=3;
respawndelay=5;
titleParam1 = "Time limit:";
valuesParam1[] = {0, 300, 600, 900};
defValueParam1 = 900;
textsParam1[] = {"Unlimited", "10 min", "20 min", "30 min", };
disabledAI = true
titleParam2 = "Weather:";
valuesParam2[] = {1, 2, 3, 4};
defValueParam2 = 3;
textsParam2[] = {"RAINY, DAY", "RAINY, NIGHT", "DAY", "NIGHT"};
class Header
{
gameType = TDM;            
minPlayers = 2;          
maxPlayers = 16;          
};

Share this post


Link to post
Share on other sites
Snip;1363022']I've put it in my description' date=' i can select it from the menu, but in game it still the same.

Can you tell me more about the init?

thx[/quote']

Well if you ONLY put this in description it wont do much, you'll only see the options ;)

I've tried a switch in my init.sqf but couldnt get it to work... So I simply use ifs instead:

(in init.sqf, or any other script you call at the start)

if (Param2 == 1) then {
0 setOvercast 1.0;
};

In there you can also change the fog with 0 setFog X.X (1.0 is full fog I think). The 0 at the front is transition time, at the start of a mission you obviously want it to be 0.

Share this post


Link to post
Share on other sites

i'm not in the trigger area, at least 200M.

what is a init.sqf?

edit: I put one trigger activated by east, and a second one wich is activated by west.

it seem to be ok

Edited by [NHS] Snip
trigger resolve

Share this post


Link to post
Share on other sites

init.sqf is just a script file that always run at mission start (ie where you set mission parameters, preset variables, launch other "boot" script files, etc etc). Create it in the mission folder (its a regular txt file, just name it .sqf) and make something like hint "hello world!"; in it to test, hehe.

You can use triggers too of course, but I'm still trying to understand them myself.

Edited by Murklor

Share this post


Link to post
Share on other sites

ok i see for the init.sqs

i will try to find something to launch this code:

titleParam1 = "Time limit:";
valuesParam1[] = {0, 300, 600, 900};
defValueParam1 = 900;
textsParam1[] = {"Unlimited", "10 min", "20 min", "30 min", };

titleParam2 = "Weather:";
valuesParam2[] = {1, 2, 3, 4};
defValueParam2 = 3;
textsParam2[] = {"RAINY, DAY", "RAINY, NIGHT", "DAY", "NIGHT"};

Share this post


Link to post
Share on other sites
Snip;1363387']ok i see for the init.sqs

i will try to find something to launch this code:

titleParam1 = "Time limit:";
valuesParam1[] = {0, 300, 600, 900};
defValueParam1 = 900;
textsParam1[] = {"Unlimited", "10 min", "20 min", "30 min", };

titleParam2 = "Weather:";
valuesParam2[] = {1, 2, 3, 4};
defValueParam2 = 3;
textsParam2[] = {"RAINY, DAY", "RAINY, NIGHT", "DAY", "NIGHT"};

Note' date=' I have an init.sqf and a description.ext and I have the time of day/ weather functional now :

description.ext

// Mission setup.
titleParam1 = "COMBAT SITUATION";
valuesParam1[] = {1, 2, 3, 4, 5, 6, 7};
defValueParam1 = 3;
textsParam1[] = {"RAINY, DAY", "RAINY, NIGHT", "DAY", "NIGHT", "SUNRISE", "SUNSET", "DAY, FOG"};

init.[b']sqf[/b]

// Use the params set in the description.ext
// {"RAINY, DAY", "RAINY, NIGHT", "DAY", "NIGHT", "SUNRISE", "SUNSET", "DAY, FOG"};
combatStatus = Param1;

switch ( combatStatus ) do
{
case 1:
{
	skipTime (12 - daytime + 24 ) % 24;
	1 setOvercast 1;
	1 setRain 1;
};
case 2:
{
	skipTime (21 - daytime + 24 ) % 24;
	1 setOvercast 1;
	1 setRain 1;
};
case 3:
{
	skipTime (12 - daytime + 24 ) % 24;
};
case 4:
{
	skipTime (21 - daytime + 24 ) % 24;
};
case 5:
{
	skipTime (7 - daytime + 24 ) % 24;
};
case 6:
{
	skipTime (18.5 - daytime + 24 ) % 24;
};
case 7:
{
	skipTime (12 - daytime + 24 ) % 24;
	1 setFog 0.6;
};
};

Share this post


Link to post
Share on other sites

you're great, it work.

And I prefere more rain, like a storm. Do you think it's possible? I must change:

1 setOvercast 1 or 1 setRain 1 ?

Share this post


Link to post
Share on other sites
switch ( combatStatus ) do

Why so complicated. This works too:

switch (param1) do

1 setOvercast 1; 1 setRain 1; is a thunderstorm.

Share this post


Link to post
Share on other sites
Why so complicated. This works too:

switch (param1) do

1 setOvercast 1; 1 setRain 1; is a thunderstorm.

sorry, but this doesn't work

Share this post


Link to post
Share on other sites

Whats the error?

And maybe you sould try param2, cause this is your weather in the description^^

Share this post


Link to post
Share on other sites

the param it's ok , i've change it. The error, it seem that it didn't take the weather at all now. When i take the night, it's sunny day

Share this post


Link to post
Share on other sites
Snip;1364480']you're great' date=' it work.

And I prefere more rain, like a storm. Do you think it's possible? I must change:

1 setOvercast 1 or 1 setRain 1 ?[/quote']

Np problem ;)

According to the wiki, if you want to make sure it rains, you have to put 1 setRain 1;

Using 1 setOvercast 1 will only make sure the sky is filled with clouds. The rain come and goes while you play.

Share this post


Link to post
Share on other sites
Snip;1364687']so' date=' no possibility to have like a storm?[/quote']

Has I said, it come and goes. Last night, I used the "DAY, RAINY" option and I saw a couple of lightning strikes and lots of rain. There was a lot of wind also at some point because the smoke from wrecks was almost parallel to the ground.

Share this post


Link to post
Share on other sites

sorry i just want to be sure i understood well :). Thank again

Share this post


Link to post
Share on other sites

thanks but my english not so good.

Still to find the point one and five (not sure it's possible that one) and to fixe that trigger^^

Share this post


Link to post
Share on other sites
Snip;1364729']thanks but my english not so good.

Still to find the point one and five (not sure it's possible that one) and to fixe that trigger^^

What is you language ?

For point 5. Try to replace, in the description.ext , the param1 by this :

titleParam1 = "Camp distance:";
valuesParam1[] = {300, 600, 1200};
defValueParam1 = 600;
textsParam1[] = {"300 meters","600 meters","1200 meters"};

Then, in you mission, make sure you have 8 markers :

west_respawn

westBase_300

westBase_600

westBase_1200

east_respawn

eastBase_300

eastBase_600

eastBase_1200

Place the west_respawn and east_respawn at the same place you put the westBase_600 and eastBase_600

Now, in the init.sqf:

campDistance = Param1;
switch ( campDistance ) do
{
   case 300:
   {
       west_respawn setPosition [getPos westBase_300 select 0, getPos westBase_300 select 1];
       east_respawn setPosition [getPos eastBase_300 select 0, getPos eastBase_300 select 1];
   };

   case 600:
   {
       west_respawn setPosition [getPos westBase_600 select 0, getPos westBase_600 select 1];
       east_respawn setPosition [getPos eastBase_600 select 0, getPos eastBase_600 select 1];
   };


   case 1200:
   {
       west_respawn setPosition [getPos westBase_1200 select 0, getPos westBase_1200 select 1];
       east_respawn setPosition [getPos eastBase_1200 select 0, getPos eastBase_1200 select 1];
   };
};

That might work. Again, can't test it right now but it seem possible !

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  

×