Home   Help Search Login Register  

Author Topic: Init lines Tutorial  (Read 2738 times)

0 Members and 1 Guest are viewing this topic.

Offline Northgarden

  • Members
  • *
Init lines Tutorial
« on: 20 Jun 2006, 14:19:04 »
How to Init v1.0


This is just a small document of lines you can put in the Init lines of units/vehicles/waypoints or triggers.
I take no credit for making them. All I did was find them or learn them from others.
Good luck with creating exciting missions.

Storm of the community 6thSense.eu (Share the Spirit)

-------------------------------------------------------------------------------------------------------------
Make a group:

name-of-group=group this

-------------------------------------------------------------------------------------------------------------

Move a unit into a vehicle:

this moveincargo name-of-vehicle
this moveindriver name-of-vehicle
this moveingunner name-of-vehicle

-------------------------------------------------------------------------------------------------------------

Move a group in a vehicle:

name-of-group=group this; "_x moveincargo name-of-vehicle" foreach units name-of-group
ex. Team1=group this; "_x moveincargo Boat1" foreach units Team1

-------------------------------------------------------------------------------------------------------------

Make the unit keep standing:

dostop this; this setunitpos "up"

-------------------------------------------------------------------------------------------------------------

Put in leaders init line to make all units stand still:

{DoStop _x} forEach units group this

-------------------------------------------------------------------------------------------------------------

Light up fire:

this inflame true

-------------------------------------------------------------------------------------------------------------

Put weapon/magazine in unit:

this addweapon "weapon-choice" ex. "binocular"
this addmagazine "magazine-choice" ex. "m16mag"

-------------------------------------------------------------------------------------------------------------

Remove all weapons in unit:

removeallweapons this

-------------------------------------------------------------------------------------------------------------

Make a marker appear after trigger:

create marker, make it empty. "name-of-marker" setmarkertype "type-of-marker"
ex. "Marker" setmarkertype "Warning"

-------------------------------------------------------------------------------------------------------------

Make objectives completed/failed:

"1" objstatus "Done","1" objstatus "Failed"

-------------------------------------------------------------------------------------------------------------

Make objectives hidden/appear after trigger:

go to init.sqs and type "1" objstatus "Hidden"
in trigger on activation type "1" objstatus "Active"

-------------------------------------------------------------------------------------------------------------

Make a unit sit:

this setbehaviour "safe";this switchmove "effectstandsitdown"

-------------------------------------------------------------------------------------------------------------

Change the behaviour of a unit:

this setbehaviour "Safe","Careless","Combat","Aware","Alert","Stealth"

-------------------------------------------------------------------------------------------------------------

Set a unit to capture mode (so it does not get attacked):

this setcaptive true
also
this setcaptive false

to make it uncaptured (so it get's attacked again)

-------------------------------------------------------------------------------------------------------------

Make a unit move after trigger is activated:

put a waypoint close to the unit, in condition type ex. blueinarea, make next waypoint as normal
(he will move to first waypoint always, that's why make the first should be close to him)
in the trigger on activation type ex. blueinarea=true

-------------------------------------------------------------------------------------------------------------

Put a unit in a tower:

this setpos [(getpos this select 0),(getpos this select 1),6]
6 is the height above ground

-------------------------------------------------------------------------------------------------------------

Get a unit type in text:

name-of-unit sidechat "bla,bla,bla"
name-of-unit groupchat "bla,bla,bla"
name-of-unit globalchat "bla,bla,bla"

-------------------------------------------------------------------------------------------------------------

Make a hint appear:

hint "bla,bla,bla"

-------------------------------------------------------------------------------------------------------------

Destroy a vehicle:

this setdammage 1

-------------------------------------------------------------------------------------------------------------

Delete a vehicle/unit:

deletevehicle name-of-unit
ex. deletevehicle plane1

-------------------------------------------------------------------------------------------------------------

Make a plane/chopper fly in a certain height (put in a waypoint):

this flyinheight 100
100 is the height above ground

-------------------------------------------------------------------------------------------------------------

Make a unit sit on a chair:

put in a trigger : name-of-unit switchmove "onchair"

-------------------------------------------------------------------------------------------------------------

Make a unit salute:

name-of-unit switchmove "effectstandsalute"

-------------------------------------------------------------------------------------------------------------

Make the mission end when group is dead:

type in the condition line of a trigger

("Alive _x" count units groupname) == 0

Choose #End2 or #loose

-------------------------------------------------------------------------------------------------------------

These are the lines in can remember right now... if you see something i made wrong or have some other lines plz let me know.  :)

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Init lines Tutorial
« Reply #1 on: 20 Jun 2006, 18:16:51 »
Code: [Select]
name-of-group=group this; "_x moveincargo name-of-vehicle" foreach units name-of-group
ex. Team1=group this; "_x moveincargo Boat1" foreach units Team1

You can also just write:

Code: [Select]
"_x moveincargo boat1" foreach units (group this)
Code: [Select]
dostop this; this setunitpos "up"
If you just want a unit to not lie down, you don't need to write "dostop this".
Also, "down" will force the unit to lie down while "auto" will let the unit choose again.

Code: [Select]
Make a plane/chopper fly in a certain height (put in a waypoint):

this flyinheight 100
100 is the height above ground

You don't really have to add it in a waypoint, you can add it in a script or the units initfield.
 ;)

Offline Northgarden

  • Members
  • *
Re: Init lines Tutorial
« Reply #2 on: 20 Jun 2006, 19:04:52 »
Thx mate. :)

I added the "down" and fixed the rest like you wrote. ;)


You don't really have to add it in a waypoint, you can add it in a script or the units initfield.
 ;)

I understand the waypoint and units initfield but this is kinda supposed to be for ppl who are not scripters and want's to find an easier solution if it is even possible.  :D

Offline Northgarden

  • Members
  • *
Re: Init lines Tutorial
« Reply #3 on: 22 Jun 2006, 23:37:22 »
Make the mission end when group is dead:

type in the condition line of a trigger

("Alive _x" count units groupname) == 0

Choose #End2 or #loose


I just tried this in my mission and it did'nt work... am i missing something?
I make coop multiplayer missions could that be a reason?

Also i could use some more ppl giving their opinion about this whole Init lines matter.  ;)

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Init lines Tutorial
« Reply #4 on: 23 Jun 2006, 00:14:27 »
? ("alive _x count units groupname <= 0)

Offline Northgarden

  • Members
  • *
Re: Init lines Tutorial
« Reply #5 on: 24 Jun 2006, 16:54:45 »
Thx Garcia  :)