Jump to content
Sign in to follow this  
wero

how to make a script

Recommended Posts

Hey Wero,

Lets start with a tool you will need first:

Armaedit:

http://www.armaholic.com/page.php?id=1455&highlight=ARMAEDIT

Install it, and then when you run it, there are various types of scripts depending on what you want to do in the game.

you have

-SQF and SQL scripts that have various functions, those I really can go into, theres members that would know more then I.

-Briefing scripts for briefings

-Descriptio.ext scripts for mp

-Init scripts and I could go on.

References:

Mission Editing and Scripting Information

http://forums.bistudio.com/showthread.php?78089-Mission-Editing-and-Scripting-Information-Links-only-NO-Discussion

Scripting Commands by Functionality

http://community.bistudio.com/wiki/Scripting_Commands_by_Functionality

This may help you:

Basic Scripting Tutorial

http://www.armaholic.com/page.php?id=838&highlight=SCRIPTING%2BTUTORIAL

Scripting

http://community.bistudio.com/wiki/Scripting

Examples of scripts you can try out, and make yourself:

Script Examples

http://www.kylania.com/ex/?page_id=72

I would have to say in my opinion that understanding the editor and knowing how to create a basic mission properly,

and implement codes, and then be able to apply scripts, is to learn how to use the editor, this would help you get a clearer picture of how the scripts work ingame.

Mission Editor

http://community.bistudio.com/wiki/Mission_Editor

Mission editing Newbie FAQ

http://www.armaholic.com/forums.php?m=posts&q=6751

Armed Assault Editing Guide - Deluxe Edition - English version

http://www.armaholic.com/page.php?id=4847&highlight=MR-MURRAY

Theres alot of members here that can really help you in various directions that know how to create scripts and such,

but as i said really all depends on what you are looking to do.

hope that helps.

Share this post


Link to post
Share on other sites

ok thank u

---------- Post added at 23:23 ---------- Previous post was at 23:21 ----------

would it let me make rpg type scripts?

Share this post


Link to post
Share on other sites

You can make any type of script you want, provided you have an idea, or know how.

I would hope that some of the scripting masters around here would see the thread here and

further help you as my knowledge is limited in script building especially from scratch.

A good way to learn as been said by numerous scripters, and reg people alike on the forums here, is to find a script, or something that does what

you want and then open it up and see how its done, learn by example.

Share this post


Link to post
Share on other sites

OK, let's say you have an enemy vehicle placed on the editor. That vehicle is a Shilka. Let's say you also want it to respawn at the same place it was before, and you only want it to respawn 5 times and 5 minutes after it has been destroyed.

So place your shilka in the editor and in the init line write the following:

nul = [this, 5, 300] execVM "spawnshilka.sqf";

You'll understand what is written inside the brackets (array) later so i recommend you to download Notepad ++ from the web first.

As soon as you've installed notepad ++ create a new file. Now next you need to pass the arguments of what you written inside the brackets of the init line of the shilka to the script. So you need to use the select command. It allows you to select arguments from the array that is calling the script:

_veh = _this select 0;
_lives = _this select 1;
_delay = _this select 2;
_type = (typeOf _veh);
_dir = (getdir _veh);
_position = (getpos _veh);

So now you've selected arguments from the calling array and got extra assigned variables to be able to use BIS_fnc_SpawnVehicle. It will spawn a crewed vehicle. See here:

http://community.bistudio.com/wiki/BIS_fnc_spawnVehicle

Let's keep going with our script:


private ["_veh","_lives","_delay","_type","_dir","_position"];

_veh = _this select 0;
_lives = _this select 1;
_delay = _this select 2;
_type = (typeOf _veh);
_dir = (getdir _veh);
_position = (getpos _veh);


_loop = true;
while {_loop} do {
 if (!alive _veh) then {
   if (_lives == 0) then {
     _loop = false;
   } else {
     _lives = _lives - 1;
     sleep _delay;
     deletevehicle _veh;
     _veh = [_position, _dir, _type, EAST] call BIS_fnc_spawnVehicle; 
   };
 };
 sleep 1;
};

Ok if you want to learn, take a look at the script, and take a look here :

http://community.bistudio.com/wiki/Category:Scripting_Commands

Browse through the commands i'm using in the script i wrote, and try to understand what is going on. Feel free to post your doubts and questions.

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  

×