Jump to content

Photo
- - - - -

how to make a script


  • Please log in to reply
4 replies to this topic
Thread Starter
wero
wero

    Private

  • Members
  • 10 posts

#1

Posted 15 April 2012 - 05:02

how do i make a script?

Gunter Severloh
Gunter Severloh

    Uber Compiler

  • Members
  • 7059 posts

#2

Posted 15 April 2012 - 05:31

Hey Wero,
Lets start with a tool you will need first:
Armaedit:
http://www.armaholic...hlight=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.bistud...y-NO-Discussion

Scripting Commands by Functionality
http://community.bis...y_Functionality

This may help you:
Basic Scripting Tutorial
http://www.armaholic...IPTING+TUTORIAL

Scripting
http://community.bis.../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.bis.../Mission_Editor

Mission editing Newbie FAQ
http://www.armaholic...?m=posts&q=6751

Armed Assault Editing Guide - Deluxe Edition - English version
http://www.armaholic...light=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.

WarMod Series - A Massive Addon & Mod Customizable Compilation mod for Arma1, Arma2,CO & Arma3 IFA3 - (IFA3WarMod)
Mission Repository - Hosting Missions & Files for Iron Front: Liberation 1944
WW2Epic - A Compilation Archive of Photos, Music, Videos, & References of WW2
AI Compilation List of Addons/Mods/Scripts & Misc for Arma3


Thread Starter
wero
wero

    Private

  • Members
  • 10 posts

#3

Posted 15 April 2012 - 06:23

ok thank u

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

would it let me make rpg type scripts?

Gunter Severloh
Gunter Severloh

    Uber Compiler

  • Members
  • 7059 posts

#4

Posted 15 April 2012 - 06:52

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.

WarMod Series - A Massive Addon & Mod Customizable Compilation mod for Arma1, Arma2,CO & Arma3 IFA3 - (IFA3WarMod)
Mission Repository - Hosting Missions & Files for Iron Front: Liberation 1944
WW2Epic - A Compilation Archive of Photos, Music, Videos, & References of WW2
AI Compilation List of Addons/Mods/Scripts & Misc for Arma3


CarlosTex
CarlosTex

    Master Sergeant

  • Members
  • 763 posts

#5

Posted 15 April 2012 - 14:49

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.bis...nc_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.bis...ipting_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.
Arma 3 and xAItment.

1 Sentence. 1 Erection. 1 Jizz.

Please vote for this:

http://dev-heaven.net/issues/13606