Jump to content
Sign in to follow this  
GoreZiad

Can you help me?

Recommended Posts

Hello there.

I'm kinda new to ArmA.

I have a question I would gladly appreciate some answers to.

When I script something, where shall I put it?

I've made a map in the Editor. Named attack. I can find that name in Documents>Arma other profiles>name>MPMissions>Attack.sara

Here's my map file located, mission.sqm

It contains alot of text. I can see it's all that I put in the map.

Scripting is simply typing things in there, wich will have effect ingame, correct?

I want to make a plan/briefing for the map. I can't do that in the game, so scripting is needed.

I have this little program, called ArmA Edit. Wich apparently should make my scripts for me.

I typed a plan/briefing for my map, and the program edited it to script or whatever.

Now is the question, where shall I put that text? I tried putting it in my map file,

but it just gives me a crash to desktop, and an error when I try to load the map.

I use EditPlus to edit text.

Many thanks.

Share this post


Link to post
Share on other sites

Scripts must be created as seperate files in that folder. If you want a script to launch from the start of your mission, call it init.sqs or init.sqf, depending on whether you want to use SQS or SQF scripts. I would reccomend learning SQF.

You can find some help here.

Share this post


Link to post
Share on other sites

I recommend opening some released missions and see what's inside them and how those things affect the outcome. That's how I learned most of what I know. In my opinion at the beginning it's best to copy the scripts and things others made to achieve what you want from your missions and make fine adjustments as need arises.

Share this post


Link to post
Share on other sites

Thank you.

But I don't understand much from that site you linked to.

As seperate files? You mean my script shall be saved next to my map file?

Let's say I would launch it from the start. What should I name init.sqs/sqf and where to put it?

Share this post


Link to post
Share on other sites

init will run at mission start as a hardcoded feature.

There are others that are listed in the COMFREF over at OFPEC or at the biki.

In arma you see the missions directory in the Arma dir that is in My Documents. Go to the missions directory that has directories in it with your editor mission names on them +.sara or .intro. Scripts go into these folders for the missions using them. If you save your mission as another name in editor, you will have to copy over scripts to the newly created mission folder. Its easier to just copy the whole directory in windows explorer then load the mission in editor. Alt-tab is used alot in my editing process.

The scripts all go in the mission folder for that mission

missions/mission1.intro/init.sqs

you can nest directories in the mission folder

/mission1.intro/scripts/radio.sqs

then the init in the root will get to that script by:

this exec "scripts/radio.sqs"

Share this post


Link to post
Share on other sites

Basicly a arma mission folder is where you dump all your files for the mission.

You got your mission.sqm that is what you made in the editor normally you just leave that alone.

You can add a briefing.html in here to make your briefing.

Your folder can also have .sqs or .sqf files these are the scripts, you call these by the exec and execvm commands in the editor.

Another ting you can make for your mission is a stringtable basicly this is for translating radiomessages for the localized versions of the game.

The last ting is a description file, here you can set respawn, put in the data for a dialog and probally alot more that i aint aware of.

Here is some info about writeing a briefing, If you would want me to post a basic template I can do that tomorrow for you.

For the Briefing

The program you talked about ArmA script edit is a script editor made by one of the arma fans, it basicly is a text editor with some functions that will help you create your own scripts.

You do have to type all the codeing your self for scripting but there are some good tutorials about scripting, someone els can probally direct you to one.

It takes time to learn the editing just take your time and you will end with a great mission evantually just be patience and dont be afraid to ask.

The Unknown

Share this post


Link to post
Share on other sites

Thanks man. I'd gladly have a basic template. I don't understand a thing in all this.

The only thing I need for now is to make my plan/briefing. Not description.

It's unneccesarily complicated.

Share this post


Link to post
Share on other sites

init will run at mission start as a hardcoded feature.

So that answers your question of:

Quote[/b] ]Let's say I would launch it from the start. What should I name init.sqs/sqf and where to put it?

with: YES a script named init.sqs/sqf will run at mission start.

And then your asking

Quote[/b] ]You mean my script shall be saved next to my map file?

So you have confused the map files with the folders they are located in.

So in Mydocuments/Arma/missions/ are those folders where the mission files are located. Im just making sure you understand the difference between mission.sqm and the folder it is in.

Then in your first post:

Quote[/b] ]Here's my map file located, mission.sqm

It contains alot of text. I can see it's all that I put in the map.

Scripting is simply typing things in there, wich will have effect ingame, correct?

No. You do not paste anything into that mission file. At least not for this purpose. You put the .sqs files that YOU CREATE into the same directory where that mission file is. If the script is named init it will run at the start of the mission because the game is hardcoded to do so. So init, incidentally, is usually for declaring global variables and starting other connected scripts that your mission is using.

My further point was that you can make folders in that specific mission folders and then in your scripts you can point to those folders with this exec "scriptsfolder1/radio.sqs"

This is a later point that will keep your mission folder neat and allow you to merge the mission with other script missions more easily. If its confusing you, just ignore this point because its more general info.

P.S. Youre welcome....

Share this post


Link to post
Share on other sites

Thanks. But I don't understand it. I need to create a .sqs file, but how? With ArmA Edit? And put it beside my mission.sqm?

Share this post


Link to post
Share on other sites

you make a notepad document and rename the extension

so init.txt changes to .sqs

or .sqf

If you cant see the extensions on your notepad file then you need to change your view options in Windows

OR

you can copy someones .sqs file and rename...

If you download my mission in my sig (try it out in the editor as well)

you can copy one of my sqs files and then rename it.

Share this post


Link to post
Share on other sites

Okay, I wrote a plan in ArmA Edit. Saved it. Pasted it in a notepad document, saved it has crap.sqf, put the document beside my mission.sqm file.

Nothing. Sorry for my stupidity.

Share this post


Link to post
Share on other sites

If you want to write a briefing, click HERE

Very cool and easy to use briefing generator.

Share this post


Link to post
Share on other sites

EDITED

okay so for this test change the crap.sqf to init.sqs

then inside the init.sqs file type

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

hint "this is an init.sqs file...."

~2

exit

delete everything else

save and load the mission. And see what happens....

OR leave the file named "crap.sqs"

in the editor put a trigger and onact field put:

set trigger to radio alpha

this exec "crap.sqs"

in mission activate radio command and see what happens

OR in the trigger onact field put [0,1,2] exec "crap.sqs"

in crap.sqs after the hint message and the ~2 put

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

hint format ["%1",_this]

~2

exit

then go back in the mission and hit the radio trigger in your menu....

Share this post


Link to post
Share on other sites

Ooh now we're talking.

Delete eveything else, and paste excatly this?

hint "this is an init.sqs file...."

~2

exit

Share this post


Link to post
Share on other sites

Nothing will happen untill you either rename the file as init.sqs

or exec the action with the radio trigger.

Sorry I made my post too quick and I edited it so read back and try again.

Were gonna get you scripting buddy dont worry....

Share this post


Link to post
Share on other sites

I saved: hint "this is an init.sqs file...."

~2

exit

Beside mission.sqm.

Nothing confused_o.gif

Share this post


Link to post
Share on other sites

IF

the file is named init.sqs

AND

it is in the same folder as the mission.sqm is in

AND

it has that text in it exactly as:

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

hint "this is an init file"

~2

exit

AND

you are in the correct mission in the editor

THEN

it has to work. If its not working go back and check every condition above because something is wrong in that list.

Once that works change or copy the script to crap.sqs and try the trigger version.

feel free to PM me for anything else, just make sure you have everything exactly as above.

Share this post


Link to post
Share on other sites

I got my briefing text on screen, finally. by some html file saved in the map folder. So that's wohoo.

Now I have another problem. I can't get soldiers to cycle a waypoint. Only move.

I've tried everything, but the soldier will only move, if the waypoint is set to MOVE. Not cycle, no matter what i try.

Thanks.

Share this post


Link to post
Share on other sites

Heres the template.

Just open up frontpage or even better Notepad, Copy past it write your briefing and save it as.

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

There are a couple of extra commands you need to know.

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

ends the line so if you put 2 behind each other you get a empty line in your briefing.

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

Now Bla will show up in blue mabey they changed the colour in arma but I know it works.

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

<body>

<p><a name="plan"></a>

Write your mission planning here.

</p><hr>

<h6><a name="main"></a>

This is your notes section

</h6><hr>

<p><a name="obj_1"></a>

Objective 1

</p><hr>

<p><a name="obj_2"></a>

Objective 2

</p><hr>

</body>

</html>

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  

×