Home   Help Search Login Register  

Author Topic: Desperately seeking "init.sqs" template  (Read 1230 times)

0 Members and 1 Guest are viewing this topic.

ARVN Marvin

  • Guest
Desperately seeking "init.sqs" template
« on: 05 May 2003, 19:08:38 »
Greetings All :D
Does anyone have a really detailed and commented, MP init.sqs  they wouldn't mind posting as a sort of template for us newbies?
I'm developing a good idea of what types of things I'll need to put in my own init file (snYpir's guide to MP Editing - newbie MP bible!!) but I can't find any examples to go on.
I've downloaded many MP missions and checked out the init.sqs files contained within but most are lacking comments and as a newbie, I can only decypher about 40% of it without help.

For example: I'm using toadlife's Real_HALO script (sorry if I misspelled it) and from the demo mission included, I see there is an init.sqs file that explicitly defines a variable: _unit = (w1,w2,w3,w4...etc)
I know it's just me but doesn't that seem confusing? Isn't "_unit" a local variable? I have this question and so many more regarding init files.
If anyone has a detailed one that they could comment out (to explain a little) and post, I think it would be invaulable to a great deal of people!!!
:D :D

Thanks in advance for any assistance!

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re:Desperately seeking "init.sqs" template
« Reply #1 on: 06 May 2003, 16:16:09 »
Just think of the init.sqs as a file that is run each time a mission starts.  It runs at time == 0 and AFTER all objects have initialized themselves (run their Init lines), meaning it is run when everyone is sitting in the briefing.

_unit would only be within init.sqs.  Once init.sqs ran, it would cease to exist.

There really isn't a "template" for init.sqs.  That's like asking if there's a template for a readme.txt, I think. :)  Just use init.sqs to run/initialize variables on ALL clients (& server), since all clients run init.sqs when they start.

Doolittle

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Desperately seeking "init.sqs" template
« Reply #2 on: 06 May 2003, 16:43:29 »
This is a very basic init.sqs

************************************************************************
;;You can use it to hide enemy markers from sides as seen below

? side player == west : goto "west"
? side player == east : goto "east"
#east
;;Hide West markers from East players
"Respawn_West" setmarkertype "empty"
"West_Killzone" setmarkertype "empty"
"West_NoGo" setmarkertype "empty"
"W_Start" setmarkertype "empty"  
goto "Setvariables"
 
#west
;;Hide East markers from West players
"Respawn_East" setmarkertype "empty"
"East_Killzone" setmarkertype "empty"
"East_NoGo" setmarkertype "empty"
"E_Start" setmarkertype "empty"
goto "Setvariables"

#SETVARIABLES
;;Normally used to declare and intitalise global variables and arrays
WScore= 0
Escore = 0
Following line displays time in player pool screen for those waiting for next game
estimatedtimeleft param1

You can use it to start scripts
#Exec_scripts
[]exec "options.sqs"
[]exec "Scoremessage.sqs"
[]exec "EndMission.sqs

~8
::The following line is displayed 8 seconds after the  start of game
titletext[format["Read The Notes"],"PLAIN"]
 
#End
;;You can use it for setting object states at the start
;;example below switches a lampost light from "automatic" to "off" in everon
object 8193 switchlight "Off"
Exit
;;END init.sqs
******************************************************************************
You can do anything with it that you can a normal script

As was previously informed it is automatically run while players are in briefing, therefore anything that you want intitalising at the start of the game can be done in this script.

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123