Jump to content
Sign in to follow this  
failtolawl

How do I activate Init.sqf?

Recommended Posts

Hey guys I have Init.sqf in my mission folder, in it it says

execVM "briefing.sqf";

Breifing is all set up.

In game it does not show up, so where do I need to activate Init.sqf?

Edited by failtolawl

Share this post


Link to post
Share on other sites

Are you trying this from the editor?

If so hold Shift and press preview to view then briefing in the editor.

Share this post


Link to post
Share on other sites

was doing in multiplayer editor, and it doesn't show up with or without shift preview.

Share this post


Link to post
Share on other sites
Are you sure that your Init.sqf is a SQF file?

http://www.tech-recipes.com/rx/1269/vista_show_unhide_file_extensions/

For multilayer mission you need to put this line on the very top of your Init.sqf:

waitUntil {(isDedicated) || !(isNull player)};

Without it, sometimes clients "skip" the init.sqf file.

Ok, added that line, and it is an SQF file.

here is what is in my init now:

waitUntil {(isDedicated) || !(isNull player)};

execVM "briefing.sqf";

Here is my briefing (quite large):

{

case WEST:

{

player createDiaryRecord["Diary", ["Info", "<br/>Author - Failtolawl<br/>Version 0.5<br/>"]];

player createDiaryRecord["Diary", ["Enemy forces", "Large forces of VC and NVA are swarming bases along Saigon and the northern front.

So far we have had reports of a large force going south of the DM zone dangerously close to our FOP's positioned around <marker name=USBASE'>Khe Sanh Airbase</marker>.]];

player createDiaryRecord["Diary", ["Friendly forces", "<br/>Our forces will start in <marker name=USBASE'>Khe Sanh Airbase</marker>, we will need to position them around firebases in order to hold off invasion force.]];

player createDiaryRecord["Diary", ["Mission", "<br/>Our forces have to defend <marker name=USBASE'>Khe Sanh Airbase</marker> from all enemey attacks. Then, we must find and destroy the NVA operating base.]];

player createDiaryRecord["Diary", ["Yesterday, the US embassy at Saigon was overrun with suicide bombers. <br/>

The Commies are planning a full fledged invasion of <marker name=USBASE'>Khe Sanh </marker> gentlemen. <img image='Generals.jpg'/> <img image='soldiers.jpg'/&gt]];

tskWestObj2 = player createSimpleTask["Destroy NVA FOB"];

tskWestObj2 setSimpleTaskDescription["If we can hold them off, we need to make sure they are clear out of South Vietnam", "Destroy NVA FOB", "Destroy NVA FOB"];

//>---------------------------------------------------------<

tskWestObj1 = player createSimpleTask["Defend Khe Sanh"];

tskWestObj1 setSimpleTaskDescription["", "Defend Khe Sanh", "Defend Khe Sanh"];

tskWestObj1 setSimpleTaskDestination (getMarkerPos "USBASE");

player setCurrentTask tskWestObj1;

};

Is there something I need to add to the briefing perhaps?

Edited by failtolawl

Share this post


Link to post
Share on other sites

Found some problems... fixed them for you. See red stuff.

[color="Red"][b]switch (side player) do {[/b][/color]
case WEST: {
	player createDiaryRecord["Diary", ["Info", "<br/>Author - Failtolawl<br/>Version 0.5<br/>"]];
	player createDiaryRecord["Diary", ["Enemy forces", "Large forces of VC and NVA are swarming bases along Saigon and the northern front. So far we have had reports of a large force going south of the DM zone dangerously close to our FOP's positioned around <marker name='USBASE'>Khe Sanh Airbase</marker>."]];
	player createDiaryRecord["Diary", ["Friendly forces", "<br/>Our forces will start in <marker name='USBASE'>Khe Sanh Airbase</marker>, we will need to position them around firebases in order to hold off invasion force."]];
	player createDiaryRecord["Diary", ["Mission", "<br/>Our forces have to defend <marker name='USBASE'>Khe Sanh Airbase</marker> from all enemey attacks. Then, we must find and destroy the NVA operating base."]];
	player createDiaryRecord["Diary", ["Yesterday[color="Red"][b]", "[/b][/color]the US embassy at Saigon was overrun with suicide bombers. <br/> The Commies are planning a full fledged invasion of <marker name='USBASE'>Khe Sanh </marker> gentlemen. <img image='Generals.jpg'/> <img image='soldiers.jpg'/>"]];



	tskWestObj2 = player createSimpleTask["Destroy NVA FOB"]; 
	tskWestObj2 setSimpleTaskDescription["If we can hold them off, we need to make sure they are clear out of South Vietnam", "Destroy NVA FOB", "Destroy NVA FOB"];
	//>---------------------------------------------------------<
	tskWestObj1 = player createSimpleTask["Defend Khe Sanh"]; 
	tskWestObj1 setSimpleTaskDescription["", "Defend Khe Sanh", "Defend Khe Sanh"];
	tskWestObj1 setSimpleTaskDestination (getMarkerPos "USBASE");
	player setCurrentTask tskWestObj1;
};
};

Please take a look at your RPT file for errors. You can also start your game with the -showScriptErrors parameter to see errors. (Just for the next time :D its working like that now)

Edited by sxp2high

Share this post


Link to post
Share on other sites

ok, added new line into brieifing, still not there, getting no errors from error reporter, do I have to activate the Init.sqf through my description.ext?

Share this post


Link to post
Share on other sites

add a hint to your init.sqf, something like

hint "yay init.sqf works";

to see whether there is still a problem with your briefing.sqf or with your init.sqf.

In the latter case I have the suspicion that you (better said, your windows) actually created a init.sqf.txt, but hide out the .txt (check out the link sxp2high posted).

Share this post


Link to post
Share on other sites

yay init.sqf works!

hint did appear :p

So in my description.ext do I have to put something that activates the briefing?

I have seen it in some example missions where it says that.

Edit: added

debriefing=true;

briefing=true;

no errors, however, briefing still does not work.

Edited by failtolawl

Share this post


Link to post
Share on other sites

oh yea sorry, tried that as well.

I have no idea why nothing is working.

---------- Post added at 07:50 PM ---------- Previous post was at 07:08 PM ----------

here is a link to the folder I am using, see if you guys can see the problem by yourself.

Try not to do anything drastic. thanks

http://www.gamefront.com/files/20363850/Khe%2520Sahn.lingor+-+Copy.rar

also might want to remvoe the "copy" part.

Share this post


Link to post
Share on other sites

Downloaded your file. Your briefing.sqf is not right.... check your opening and closing brackets.

switch (side player) do [b]{[/b]

case WEST: [b]{[/b]

           ....your code
           ....your code

[b]}[/b];

[b]}[/b];

Share this post


Link to post
Share on other sites
Downloaded your file. Your briefing.sqf is not right.... check your opening and closing brackets.

switch (side player) do [b]{[/b]

case WEST: [b]{[/b]

           ....your code
           ....your code

[b]}[/b];

[b]}[/b];

Ok, edited, still not working. going to try and make it a bit more simple to see if maybe something in the codes is effecting it.

edit: no it doesn't seem to work with simple codes either. can any of you guys get it working when you put it on?

Edited by failtolawl

Share this post


Link to post
Share on other sites

Yes...break it down into small pieces and use "hint" to track progress.

EDIT: I tried loading the mission but then realised besides Lingor... I need a whole bunch of other stuff! ..so didn't get too far there I'm afraid!

Share this post


Link to post
Share on other sites

ah crap sorry, I forgot this uses UNS (a vietnam mod).

I have no idea what to do. :(

Edited by failtolawl

Share this post


Link to post
Share on other sites

Your init.sqf looks fine..... your description.ext looks fine.... so I'm guessing there's something wrong in briefing.sqf.

I've seen in some posts that you might need a briefing.html in the folder as well. But then some people say you don't need it anymore. Worth a try.

---------- Post added at 03:52 PM ---------- Previous post was at 03:46 PM ----------

EDIT: You need a briefing.html in your folder. Then it works! Just tested it on Utes. If you need the demo mission I can post it for you.

Share this post


Link to post
Share on other sites

Not true, the briefing.html only defines the text which is being shown at debriefing. It's optional.

Are your playable units on west side?

Are you using multiple sides for the playable units?

If not, you can delete the switch side case stuff. Maybe that's just the problem...

Im talking about the red stuff:

[color="Red"]switch (side player) do {

case WEST: {[/color]

[color="SeaGreen"]// only keep this content[/color]
[color="Red"]
};

};[/color]

Edited by sxp2high

Share this post


Link to post
Share on other sites

Mission here.... if I take out the briefing.html it doesn't work. I used his code!

If I go to any of my missions with a briefing.html and take it out they dont work!

I suggest he try it!

Edited by twirly
Fixed link

Share this post


Link to post
Share on other sites

Ok, I have it working, it is just delayed when you look at the map screen for some reason. Thanks a lot guys. I will come here often for troubleshooting.

Edited by failtolawl

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  

×